1
votes

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

1
As I know - it is not possible to generate grid without store and set it later. During grid creation you need provide a correct store. Why you don't want to generate grid on js side? - Andron
Hi @Andron thank you for response .. i tried to create the grid at javascript and that is working but paging is not working . i given the pagesize as 10 but it is not taking and showing all the record. - Rahul Gupta

1 Answers

0
votes

You can use grid.reconfigure(store, [columns]) to change which store is bound to the grid.