I have created a dojox.grid.DataGrid embedded in dijit.Dialog programatical开发者_如何学Pythonly. I'm using a dojo.data.ItemFileWriteStore for the grid. When I create the ItemFileWriteStore using "url" constructor, it works and the grid gets displayed.
var store = new dojo.data.ItemFileWriteStore({
"url": "data/reportTypes.json"
}
);
However, when I create the ItemFileWriteStore using "data" constructor, nothing is displayed. Grid is absent, without even showing an error.
var store = new dojo.data.ItemFileWriteStore({
//"url": "data/reportTypes.json"
data: _reportGridData
}
);
Also, in case of "url" constructor (1st scenario), I checked the rowCount attribute after calling grid.startup()
It was zero. That means rows were not rendered. Whereas in case of "data" constructor (2nd scenario), rowCount is 8, but I do not see the grid!
Can a grid not be embedded into a Dialog? What exactly is the problem?
Can someone please help me out with this?
I had a similar problem this week and the problem was that when the grid is rendered inside an element where the displayed
css attribute is none
the grid will be rendered as wide as it's parent container but only 0 pixels high.
You could try showing the dialog and then programmaticly building the grid inside the open dialog.
精彩评论