[CLOSED] not contain any records you can display a message centered on the grid

Page 4 of 5 FirstFirst ... 2345 LastLast
  1. #31
    Please replace your listeners with
    <Load Handler="var grid = #{GridPanel3};
                   if (grid.rendered) {
                       onLoadGrid(store, records, grid);
                   }" />
    The more issue which, though, doesn't cause any error, but remove this:
    <ViewReady Handler="this.on('viewready');" />
    because it doesn't make any sense.
  2. #32
    Quote Originally Posted by Daniil View Post
    Please replace your listeners with
    <Load Handler="var grid = #{GridPanel3};
                   if (grid.rendered) {
                       onLoadGrid(store, records, grid);
                   }" />
    The more issue which, though, doesn't cause any error, but remove this:
    <ViewReady Handler="this.on('viewready');" />
    because it doesn't make any sense.
    Ok, it was very good.
    But now when I run the filter on the grid and has no record.
    How should I use to call the function DataChanged onLoadGrid?
  3. #33
    Quote Originally Posted by majunior View Post
    How should I use to call the function DataChanged onLoadGrid?
    It's the Store listener.
  4. #34
    Quote Originally Posted by Daniil View Post
    It's the Store listener.
    Assembled as follows.
    But when you click the button that feeds the store, it states that the "records" is not defined

      <ext:GridPanel ID="GridPanel1" runat="server" StripeRows="true" TrackMouseOver="true"
                                    Flex="1">
                                    <Store>
                                        <ext:Store ID="Store1" runat="server" AutoLoad="false">
                                            <Reader>
                                                <ext:ArrayReader>
                                                    <Fields>
                                                        <ext:RecordField Name="test1" />
                                                        <ext:RecordField Name="test2" />
                                                        <ext:RecordField Name="test3" />
                                                    </Fields>
                                                </ext:ArrayReader>
                                            </Reader>
                                            <Listeners>
                                                <Load Handler="var grid = #{GridPanel1};
                                                                if (grid.rendered) {
                                                                    onLoadGrid(store, records, grid);
                                                                }" Delay="10" />
                                                <DataChanged Handler="var grid = #{GridPanel1};
                                                                if (grid.rendered) {
                                                                    onLoadGrid(store, records, grid);
                                                                }" />
                                            </Listeners>
                                        </ext:Store>
                                    </Store>
                                    <ColumnModel ID="ColumnModel1" runat="server">
                                        <Columns>
                                            <ext:Column Header="Test1" DataIndex="test1" />
                                            <ext:Column Header="Test2" DataIndex="test2" />
                                            <ext:Column Header="Test3" DataIndex="test3" />
                                        </Columns>
                                    </ColumnModel>
                                    <View>
                                        <ext:GridView ID="GridView1" runat="server">
                                            <HeaderRows>
                                                <ext:HeaderRow>
                                                    <Columns>
                                                        <ext:HeaderColumn Cls="x-small-editor">
                                                            <Component>
                                                                <ext:TextField ID="Filtertest1" runat="server" EnableKeyEvents="true">
                                                                    <Listeners>
                                                                        <KeyUp Handler="applyFilter(this);" Buffer="250" />
                                                                    </Listeners>
                                                                </ext:TextField>
                                                            </Component>
                                                        </ext:HeaderColumn>
                                                        <ext:HeaderColumn Cls="x-small-editor">
                                                            <Component>
                                                                <ext:TextField ID="Filtertest2" runat="server" EnableKeyEvents="true">
                                                                    <Listeners>
                                                                        <KeyUp Handler="applyFilter(this);" Buffer="250" />
                                                                    </Listeners>
                                                                </ext:TextField>
                                                            </Component>
                                                        </ext:HeaderColumn>
                                                        <ext:HeaderColumn Cls="x-small-editor">
                                                            <Component>
                                                                <ext:TextField ID="Filtertest3" runat="server" EnableKeyEvents="true">
                                                                    <Listeners>
                                                                        <KeyUp Handler="applyFilter(this);" Buffer="250" />
                                                                    </Listeners>
                                                                </ext:TextField>
                                                            </Component>
                                                        </ext:HeaderColumn>
                                                    </Columns>
                                                </ext:HeaderRow>
                                            </HeaderRows>
                                        </ext:GridView>
                                    </View>
                                </ext:GridPanel>
  5. #35
    Please read the ExtJS doc article about DataChanged to know the arguments of this event.
    http://dev.sencha.com/deploy/ext-3.3.1/docs/
  6. #36
    Quote Originally Posted by Daniil View Post
    Please read the ExtJS doc article about DataChanged to know the arguments of this event.
    http://dev.sencha.com/deploy/ext-3.3.1/docs/
    I tried using this.getAt (0 )||{}

    <DataChanged Handler="onLoadGrid(store, this.getAt(0)||{}, #{GridPanel1});" />
    But he does not return the amount of stored records.

    It was not clear to me how you get the amount of records from the store.
  7. #37
    Please try
    <DataChanged Handler="onLoadGrid(store, this.getAllRange()||[], #{GridPanel1});" />
  8. #38
    Quote Originally Posted by Daniil View Post
    Please try
    <DataChanged Handler="onLoadGrid(store, this.getAllRange()||[], #{GridPanel1});" />
    If I put my filter in a filter that returns no records, running the command DataChanged "this.getAllRange ()||[]" sends the amount of records that the store is before the filter.
  9. #39
    Please try .getRange() instead of .getAllRange().
  10. #40
    Quote Originally Posted by Daniil View Post
    Please try .getRange() instead of .getAllRange().
    Strange, because if I debug the message correctly.
    But when he finished the script executes the command and removes the message below.


    Ext.net.ResourceMgr.init({id:"ResourceManager1",BLANK_IMAGE_URL:"/extjs/resources/images/default/s-gif/ext.axd",aspForm:"Form1",theme:"blue"});Ext.onReady(function(){Ext.QuickTips.init();new Ext.net.Viewport({id:"Viewport",renderTo:"Form1",items:[{id:"pnlLayoutMaster",region:"north",boxMinHeight:29,height:226,split:true,items:[{id:"pnlSUtToolbarMaster",height:28},{store:this.Store1=new Ext.ux.data.PagingStore({proxyId:"Store1",reader:new Ext.data.ArrayReader({fields:[{name:"test1"},{name:"test2"},{name:"test3"}]}),directEventConfig:{},proxy:new Ext.data.PagingMemoryProxy({}),listeners:{datachanged:{fn:function(store){onLoadGrid(store, this.getRange()||[], GridPanel1);}},load:{delay:10,fn:function(store,records,options){var grid = GridPanel1;
Page 4 of 5 FirstFirst ... 2345 LastLast

Similar Threads

  1. Replies: 3
    Last Post: Jun 22, 2011, 7:37 PM
  2. Replies: 10
    Last Post: May 13, 2011, 2:30 PM
  3. Replies: 0
    Last Post: Mar 21, 2011, 3:55 PM
  4. Replies: 1
    Last Post: Jul 07, 2010, 8:00 AM
  5. Replies: 6
    Last Post: Feb 22, 2010, 1:18 AM

Tags for this Thread

Posting Permissions