Sep 19, 2011, 5:50 AM
[CLOSED] Javascript: Adding Dynamic Field to the Store and Creating Dynamic Column for the grid
Hi,
i have a Store and a Grid in the page
And when i add ColumnModel to the Grid it throws Javascript error.
i have a Store and a Grid in the page
<ext:Store ID="gridstore" runat ="server">
</ext:Store>
<ext:GridPanel
ID="gridSequenceRight"
runat="server"
StoreID="gridSequenceRightStore"
DDGroup="firstGridDDGroup"
EnableDragDrop="true"
StripeRows="true"
AutoExpandColumn="FullName"
Width="325"
Title="Right">
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModelRight" runat="server" />
</SelectionModel>
<GetDragDropText Fn="getDragDropText" />
</ext:GridPanel>
When i add Dynamic field to the Store, the Store doesnot show the Field valuesAnd when i add ColumnModel to the Grid it throws Javascript error.
for (var i = 0; i < s.length; i++) {
var field = new Ext.data.JsonReader({ fields: [s[i].Name] });
gridstore.addField(field,i,false);
var col = new Ext.grid.ColumnModel({
columns: [{ dataIndex: s[i].Name, header: s[i].Name, width: 160}]
});
gridSequenceLeft(col);
}
Please Help. Thank You.
Last edited by Daniil; Sep 20, 2011 at 3:33 PM.
Reason: [CLOSED]