Skip to main content

Posts

Showing posts with the label Dojo

Making a subgrid inside a enhanced grid using dojo

What I want to achieve is a subgrid within an enhanced grid using dojo just like a Jquery data table. So I followed these steps to achieve it. Create an enhanced grid in dojo using dojox/grid/EnhancedGrid. Create a dojo/data/ItemFileWriteStore from Json data which is of the format {items:[{"key":"value","subgrid":{"child":"value"}}]} Create a layout which has onBeforeRow callback which is called before the creation of any row in the grid so that we can hide the child row. The first column of the row should be a +/- image which upon clicking should show the child row. Finally the output would be something like Demo and code is @  jsFiddle

Debugging dojo

Recently I had an issue where I always get 3 as callback whenever I require a custom module. require(["modules/headerWidget"],function(header){ console.log(header); }); My headerWidget is something like this: require([ "dojo/_base/declare" , "dijit/_WidgetBase", "dijit/_TemplatedMixin" ], function(declare, _WidgetBase, _TemplatedMixin) { return declare("headerWidget",[ _WidgetBase, _TemplatedMixin ],{ templateString : <div></div> , }); }); Console always used to display only 3. I wondered as to why and here is the solution for that. The solution is to give the custom widget as module. define ([ "dojo/_base/declare" , "dijit/_WidgetBase", "dijit/_TemplatedMixin" ], function(declare, _WidgetBase, _TemplatedMixin) { return declare("headerWidget",[ _WidgetB...

Loading dojo in the project

In order to load Dojo, we can use CDN version or the downloaded package from  Dojo official site  and refer the src to Dojo package.