简体   繁体   中英

How to Bind Store in GridPanel

i am newbie in EXT.NEt control .... i hv created a gridpanel during the design time and after that i hv created one Ext.data.Store in javascript at run time and fill the data. now how can i bind this store to gridpanel in javascript.

GridPanel during the design time....

   <ext:GridPanel ID="gridpanel" runat="server" MinWidth="1000" MinHeight="400" ForceFit="true">
        <TopBar>
            <ext:Toolbar ID="Toolbar1" runat="server">
                <Items>
                    <ext:ToolbarFill ID="ToolbarFill1" runat="server" />
                    <ext:Button ID="Button3" runat="server" Text=" Export" Icon="PageExcel">
                        <Listeners>
                            <Click Handler="submitValue(#{gridpanel}, #{FormatType}, 'xls');" />
                        </Listeners>
                    </ext:Button>
                </Items>
            </ext:Toolbar>
        </TopBar>
        <ColumnModel>
            <Columns>
                <ext:Column ID="Col8" runat="server" Text="Project" DataIndex="Project"></ext:Column>
            </Columns>
            <Columns>
                <ext:Column ID="Col1" runat="server" Text="Parcel" DataIndex="Parcel"></ext:Column>
            </Columns>                
        </ColumnModel>           
    </ext:GridPanel>

Now i create store in javascript

   var store = Ext.create('Ext.data.Store', {
            storeId: 'mapList',
            fields: ['project', 'parcel'],
            autoLoad: true,
            pageSize: 10,
            data: listdata,
            proxy: {
                type: 'memory',
                reader: {
                    type: 'json',
                    root: 'items'
                }
            }
        });
        var ExtGridPanel = Ext.getCmp('ContentPlaceHolder1_gridpanel');

Now how can i bind this store to our gridPanel

您可以使用grid.reconfigure(store, [columns])更改绑定到网格的商店。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM