1. #21
    Sencha User SlashEMc2k's Avatar
    Join Date
    Jul 2007
    Posts
    84
    Vote Rating
    0
    SlashEMc2k is on a distinguished road

      0  

    Default Architect

    Architect


    huh.png

    Not sure what I'm doing wrong using sencha architect -
    The grid displays a list of all data items and does not page by 5 items but the page toolbar displays correct paging of 100 items but interaction with it does not update the grid.. ie hitting next page.


    So this -
    Code:
    {
                                xtype: 'gridpanel',
                                id: 'test',
                                title: 'My Grid Panel',
                                store: 'MyJsonStore',
                                dockedItems: [
                                    {
                                        xtype: 'pagingtoolbar',
                                        dock: 'bottom',
                                        width: 360,
                                        displayInfo: true,
                                        store: 'MyJsonStore'
                                    }
                                ],
                                columns: [
                                    {
                                        xtype: 'gridcolumn',
                                        dataIndex: 'test1',
                                        text: 'Test1'
                                    },
                                    {
                                        xtype: 'gridcolumn',
                                        dataIndex: 'test2',
                                        text: 'Test2'
                                    },
                                    {
                                        xtype: 'gridcolumn',
                                        dataIndex: 'test3',
                                        text: 'Test3'
                                    }
                                ]
                            }
    Code:
                storeId: 'MyJsonStore',
                data: {
                    items: [
                        {
                            test1: 'Test1 1',
                            test2: 'Test2 1',
                            test3: 'Test3 1'
                        },
                        {
                            test1: 'Test1 2',
                            test2: 'Test2 2',
                            test3: 'Test3 2'
                        },
                        {
                            test1: 'Test1 3',
                            test2: 'Test2 3',
                            test3: 'Test3 3'
                        },
                        {
                            test1: 'Test1 4',
                            test2: 'Test2 4',
                            test3: 'Test3 4'
                        },
                        {
                            test1: 'Test1 5',
                            test2: 'Test2 5',
                            test3: 'Test3 5'
                        },
                        {
                            test1: 'Test1 6',
                            test2: 'Test2 6',
                            test3: 'Test3 6'
                        },
                        {
                            test1: 'Test1 7',
                            test2: 'Test2 7',
                            test3: 'Test3 7'
                        },
                        {
                            test1: 'Test1 8',
                            test2: 'Test2 8',
                            test3: 'Test3 8'
                        },
                        {
                            test1: 'Test1 9',
                            test2: 'Test2 9',
                            test3: 'Test3 9'
                        },
                        {
                            test1: 'Test1 10',
                            test2: 'Test2 10',
                            test3: 'Test3 10'
                        },
                        {
                            test1: 'Test1 11',
                            test2: 'Test2 11',
                            test3: 'Test3 11'
                        }
                    ]
                },
                pageSize: 5,
                proxy: {
                    type: 'memory',
                    reader: {
                        type: 'json',
                        root: 'items'
                    }
                },
                fields: [
                    {
                        name: 'test1'
                    },
                    {
                        name: 'test2'
                    },
                    {
                        name: 'test3'
                    }
                ]

    Doesn't work but this does -

    Code:
    Ext.application({
        name: 'Support',
        launch: function() {
            var store = Ext.create('PagingStore', {
                storeId: 'MyJsonStore',
                data: {
                    items: [
                        {
                            test1: 'Test1 1',
                            test2: 'Test2 1',
                            test3: 'Test3 1'
                        },
                        {
                            test1: 'Test1 2',
                            test2: 'Test2 2',
                            test3: 'Test3 2'
                        },
                        {
                            test1: 'Test1 3',
                            test2: 'Test2 3',
                            test3: 'Test3 3'
                        },
                        {
                            test1: 'Test1 4',
                            test2: 'Test2 4',
                            test3: 'Test3 4'
                        },
                        {
                            test1: 'Test1 5',
                            test2: 'Test2 5',
                            test3: 'Test3 5'
                        },
                        {
                            test1: 'Test1 6',
                            test2: 'Test2 6',
                            test3: 'Test3 6'
                        },
                        {
                            test1: 'Test1 7',
                            test2: 'Test2 7',
                            test3: 'Test3 7'
                        },
                        {
                            test1: 'Test1 8',
                            test2: 'Test2 8',
                            test3: 'Test3 8'
                        },
                        {
                            test1: 'Test1 9',
                            test2: 'Test2 9',
                            test3: 'Test3 9'
                        },
                        {
                            test1: 'Test1 10',
                            test2: 'Test2 10',
                            test3: 'Test3 10'
                        },
                        {
                            test1: 'Test1 11',
                            test2: 'Test2 11',
                            test3: 'Test3 11'
                        }
                    ]
                },
                pageSize: 5,
                proxy: {
                    type: 'memory',
                    reader: {
                        type: 'json',
                        root: 'items'
                    }
                },
                fields: [
                    {
                        name: 'test1'
                    },
                    {
                        name: 'test2'
                    },
                    {
                        name: 'test3'
                    }
                ]
            });
    
            Ext.create('Ext.grid.Panel', {
                title: 'My Grid Panel',
    			store: 'MyJsonStore',
    			dockedItems: [
    				{
    					xtype: 'pagingtoolbar',
    					dock: 'bottom',
    					width: 360,
    					displayInfo: true,
    					store: 'MyJsonStore'
    				}
    			],
    			columns: [
    				{
    					xtype: 'gridcolumn',
    					dataIndex: 'test1',
    					text: 'Test1'
    				},
    				{
    					xtype: 'gridcolumn',
    					dataIndex: 'test2',
    					text: 'Test2'
    				},
    				{
    					xtype: 'gridcolumn',
    					dataIndex: 'test3',
    					text: 'Test3'
    				}
    			],
                renderTo: Ext.getBody()
            });
        }
    });

  2. #22
    Sencha User
    Join Date
    Nov 2013
    Posts
    2
    Vote Rating
    0
    prande is on a distinguished road

      0  

    Default


    Quote Originally Posted by prande View Post
    @bbalasateesh,

    Ext js 4.2 doen't provides
    filterupdate event on grid, and on the other hand call to doRefresh() and moveFirst and causing issues when implmeneted using filterchange event , somthing is hinding the text box filter implmented with the reference of custome grid filter i.e. FeatureFilter code.
    This issue is resolved by extending defined store with Paginstore, it works just perfectly, even FeatureFilter implementation for local filtering works with ease by having an filterupdate event on grid to refresh the total page count.

    Thanks bbalasateesh..!!

  3. #23
    Ext JS Premium Member
    Join Date
    Mar 2010
    Location
    Northern Virginia
    Posts
    59
    Vote Rating
    4
    aghextjs is on a distinguished road

      0  

    Default


    @SlashEMc2k

    It's hard to tell from your code, but I think you just need to make sure that the store is extending from the paging store in your Architect version.

    I tried to create a fiddle to show it, but I was fiddled challenged. Hopefully it's working. In order to get the fiddle working, I needed to rename Ext.ux.data.PagingStore to Fiddle.ext.PagingStore. It's simply a naming change to make sure the extension is included in the fiddle prior to the store class that requires it.


  4. #24
    Sencha User
    Join Date
    Sep 2013
    Posts
    4
    Vote Rating
    0
    developer@sysco.ch is on a distinguished road

      0  

    Default Bug on Load() & rowSelectionModel MULTI doesn't work

    Bug on Load() & rowSelectionModel MULTI doesn't work


    Had a bug when calling load() on store;
    First call was OK. No if reloaded the data :
    Second call gave me : the n first rows of my data + all of my data (where n = pageSize value set on store)

    I am not sure my fix is totally correct, but adding the following code in loadRecords() did the trick.

    Code:
    [...]
    if(!addRecords){
        me.data.clear(); //Extra line added
        me.data.removeAll(); //Extra line added
        
        delete me.allData;
        delete me.snapshot;
        me.clearData(true);
    }else if (allData){
    [...]
    I still haven't figured out why the MULTI mode on my rowSelectionModel doesn't work. If I change to an other JSON store multi select works fine...any ideas?

  5. #25
    Sencha User
    Join Date
    Sep 2013
    Posts
    4
    Vote Rating
    0
    developer@sysco.ch is on a distinguished road

      0  

    Default About multi select not working

    About multi select not working


    Using shift key and mouse or shift key and keyboard => not working

    When overriding selectRange(startRow, endRow, keepExisting) on the rowSelectionModel, parameters startRow and endRow aren't numbers and can't be found the store. They are objects.

    Doing the same thing with a json store (no paging), objects are found the store and selected records are populated...

    Help anyone

  6. #26
    Sencha User
    Join Date
    Sep 2013
    Posts
    4
    Vote Rating
    0
    developer@sysco.ch is on a distinguished road

      0  

    Default


    Quote Originally Posted by developer@sysco.ch View Post
    Using shift key and mouse or shift key and keyboard => not working

    When overriding selectRange(startRow, endRow, keepExisting) on the rowSelectionModel, parameters startRow and endRow aren't numbers and can't be found the store. They are objects.

    Doing the same thing with a json store (no paging), objects are found the store and selected records are populated...

    Help anyone
    Solution :
    override indexOf()

    Code:
    indexOf: function(record){
    if(this.isPaging(Ext.apply({}, this.lastOptions ? this.lastOptions : {}))){
        var index =  -1;
        for(var i = 0; i < this.data.length; i++){
            if(this.data.getAt(i).id === record.id){
                index = i;
            }
        }
        return index;
    }
    else{
        this.callParent(record);
    }
    }

  7. #27
    Sencha User
    Join Date
    Sep 2013
    Posts
    4
    Vote Rating
    0
    developer@sysco.ch is on a distinguished road

      0  

    Default Solution to multi select

    Solution to multi select


    override indexOf(record)

    Code:
    if(this.isPaging(Ext.apply({}, this.lastOptions ? this.lastOptions : {}))){
        var index =  -1;
        for(var i = 0; i < this.data.length; i++){
            if(this.data.getAt(i).id === record.id){
                index = i;
            }
        }
        return index;
    }
    else{
        this.callParent(record);
    }

  8. #28
    Ext JS Premium Member
    Join Date
    Mar 2010
    Location
    Northern Virginia
    Posts
    59
    Vote Rating
    4
    aghextjs is on a distinguished road

      0  

    Default


    developer@sysco.ch - what version of Ext JS are you using?

  9. #29
    Sencha Premium Member dscoular's Avatar
    Join Date
    Mar 2007
    Posts
    12
    Vote Rating
    0
    dscoular is on a distinguished road

      0  

    Question Problems deleting records from PaginStore

    Problems deleting records from PaginStore


    Hi,
    I've been tasked with creating a grid with a local in-memory paging store with which I can add or delete records. I've tried to use the PagingStore.js user extension and it gets me most of the way there but if I try and delete the last record visible on the last page I'm suddenly on page 0 of 0 with no records. If I create a new record all my lost records miraculously re-appear.

    I've created a sencha fiddle here:

    https://fiddle.sencha.com/fiddle/53m/preview

    The code I use to delete the selected row looks like this:

    Code:
    onDeleteIncident: function(event) {
        console.log("Delete Incident button was clicked...");
        if (this.selectedRecord) {
            this.getMemCasesStore().remove(this.selectedRecord);
        }
        this.getMemCasesStore().load();
        this.getToolbar().doRefresh();
        },
    Any help or thoughts hugely appreciated.

    Cheers,

    Doug
    "The big print giveth and the small print taketh away."

  10. #30
    Ext JS Premium Member
    Join Date
    Mar 2010
    Location
    Northern Virginia
    Posts
    59
    Vote Rating
    4
    aghextjs is on a distinguished road

      0  

    Default


    Hi Doug-

    Did you figure out what's happening? I'd like to know. I was out of town last week so didn't get a chance to look at this. I'll try to look at it soon, might have some time tomorrow.

    Annie