public ExtScript() { Console.WriteLine("ExtScript()"); var record = Record.create(new Schema[] { new Schema { name = "id", type = "int" }, new Schema { name = "value" } }); JsonReader reader = new JsonReader(new JsonReaderConfig { id = "id" }, record); Console.WriteLine(reader); Store store = new Store(new StoreConfig { reader = reader }); var data = new MyRecord[] { new MyRecord { id = 1, value = "first" }, new MyRecord { id = 2, value = "second" } }; Console.WriteLine(data); store.loadData(data); ColumnModelConfig[] columns = new ColumnModelConfig[] { new ColumnModelConfig { dataIndex = "id", header = "ID" }, new ColumnModelConfig { dataIndex = "value", header = "Value" } }; var colModel = new ColumnModel(columns); this.grid = new GridPanel(new GridPanelConfig { height = 150.0, renderTo = "grid", colModel = colModel, store = store }); Console.WriteLine(this.grid); this.grid.on("dblclick", new GridPanelDblclickDelegate(this.OnDblClick), this); Console.WriteLine("ready"); }
/// <summary> /// <p>Reconfigures the grid to use a different Store and Column Model /// and fires the 'reconfigure' event. The View will be bound to the new /// objects and refreshed.</p> /// <p>Be aware that upon reconfiguring a GridPanel, certain existing settings <i>may</i> become /// invalidated. For example the configured {@link #autoExpandColumn} may no longer exist in the /// new ColumnModel. Also, an existing {@link Ext.PagingToolbar PagingToolbar} will still be bound /// to the old Store, and will need rebinding. Any {@link #plugins} might also need reconfiguring /// with the new data.</p> /// @param {Ext.data.Store} store The new {@link Ext.data.Store} object /// @param {Ext.grid.ColumnModel} colModel The new {@link Ext.grid.ColumnModel} object /// </summary> public void reconfigure(Store store, ColumnModel colModel) { }
/// <summary> /// @private /// Binds a new Store and ColumnModel to this GridView. Removes any listeners from the old objects (if present) /// and adds listeners to the new ones /// @param {Ext.data.Store} newStore The new Store instance /// @param {Ext.grid.ColumnModel} newColModel The new ColumnModel instance /// </summary> public void initData(Store newStore, ColumnModel newColModel) { }
public void reconfigure(Store store, ColumnModel colModel) { throw new Exception(); }