1. #1
    Ext User
    Join Date
    Oct 2009
    Posts
    4
    Vote Rating
    0
    jlouros is on a distinguished road

      0  

    Default Refreshing a Grid using static data

    Refreshing a Grid using static data


    Hello,

    I using a grid to display a static data Array, and I am adding/removing data from this array. I can update the store used by the grid correctly, but the grid itself doesn't refresh. Any suggestions?


    Thanks

  2. #2
    Sencha User
    Join Date
    Jul 2009
    Posts
    88
    Vote Rating
    1
    Ash2009 is on a distinguished road

      0  

    Default


    try

    myGrid.getView().refresh();

  3. #3
    Ext User
    Join Date
    Oct 2009
    Posts
    4
    Vote Rating
    0
    jlouros is on a distinguished road

      0  

    Default


    Thanks Ash2009, that works perfectly.

    Now I have another problem. Deleting a record from a store. I am using myGrid.store.removeAt(i), being i my index, but it doesn't work.

  4. #4
    Sencha User
    Join Date
    Jul 2009
    Posts
    88
    Vote Rating
    1
    Ash2009 is on a distinguished road

      0  

    Default


    I have used remove() at all places,it works fine.

    like..

    store.remove(store.getAt(rowIndex));

    or

    var sel = grid.getSelectionModel().getSelected();
    grid.getStore().remove(sel);

  5. #5
    Ext User
    Join Date
    Oct 2009
    Posts
    4
    Vote Rating
    0
    jlouros is on a distinguished road

      0  

    Default


    Thanks for the help Ash2009, but I am using ExtJS 2.2 and maybe that's why some methods doesn't work. Exemple, getSelected() doesn't work. However I found a way to do what I wanted, by adding a .data in front of store. So it looks like myGrid.store.data.remove(index).

Thread Participants: 1