1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    12
    Vote Rating
    0
    ibagur is on a distinguished road

      0  

    Default how to reload a store and avoid loop

    how to reload a store and avoid loop


    Dear all,

    I got a GridPanel with a RowSelectionmodel. When I select a row, the data related to this row is displayed on a Form, so the user can change its values. So far no problem with this, but I also want the Grid store to be reloaded, so the Grid will refresh the rows in case another user of the application has updated any other row.

    The problem is that everytime I select a row I get in a nasty 'reloading' loop, that slows down everything and it does not even allow me to change and update the values in the form

    Code:
    MyGrid.getSelectionModel().addListener({
      rowselect: function(sm, rowIdx, record) {
         // Load row data in the form
         MyForm.getForm().loadRecord(record);
    
        // I want to refresh this same grid
        MyGrid.store.reload();
       }
    });
    Is there any way to make this work? Is there another event related to GridPanel where I can put the store.reload to avoid this loop?

    Thanks

  2. #2
    Sencha User
    Join Date
    Mar 2011
    Posts
    12
    Vote Rating
    0
    ibagur is on a distinguished road

      0  

    Default


    Hi,

    It's me again. I just found a solution to this. Instead of putting the 'store.reload' within the 'rowslect' event, I've just put it under the 'rowdeselect' event, and now it's working as I wanted.

    Code:
        	rowdeselect: function() {    	
        		gridEntrevistas.store.reload();
        	}

Tags for this Thread