Get Grid Row via Store

  1. #1

    Get Grid Row via Store

    I have a GridPanel associated to a store.

    I am using
    store.each(function(){....})
    to go through each record in the store to validate against the server. While Im doing this I woule like to set a loading gif in the first column of the grid but Im not sure how I would get access to the relative grid row based on the current record of the store?

    Could someone give me a hint on how to acheive this?
    Last edited by Daniil; Dec 07, 2011 at 7:37 AM. Reason: Please use [CODE] tags
  2. #2
    Hi,

    Please clarify how it should look:
    Quote Originally Posted by glenh View Post
    to set a loading gif in the first column of the grid
    Would you like to mask a Column? If so, it's impossible, because a column is different <td>-s of different <tr>-s of different <table>-s html elements.

    You could easily mask a whole grid:

    Show mask
    Ext.net.Mask.show({el : GridPanel1, msg : "Validating..."});
    Hide mask
    Ext.net.Mask.hide();
  3. #3
    Hi Dani,

    Thanks for your reply. Sorry I know how it will look, I already have a span with a background image in the first column (td) which I will just change the class name to give it a loading.gif but I just need access to the correct row (tr) based on the store.

    I have found that GridPanel.getView().getRow(rowNum) will get me the <div> of the row but am I correct in thinking that the row index from store.each() will be in sync with the same grid row? Or is there another method I should use?

    Thanks
    Glen
  4. #4
    Quote Originally Posted by glenh View Post
    I have found that GridPanel.getView().getRow(rowNum) will get me the <div> of the row but am I correct in thinking that the row index from store.each() will be in sync with the same grid row?
    Yes, it's correct. So, the following should suite your needs.

    Example
    var view = GridPanel1.getView(),
        row;
    
    GridPanel1.getStore().each(function (r, index) {
        row = view.getRow(index);
    });

Similar Threads

  1. Replies: 1
    Last Post: Dec 22, 2011, 6:17 AM
  2. [CLOSED] Access Grid Data Store and manually store to database
    By macap in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Oct 05, 2011, 8:52 AM
  3. Replies: 1
    Last Post: Nov 01, 2010, 9:00 PM
  4. Replies: 1
    Last Post: Feb 24, 2010, 3:05 PM
  5. Store and Grid - CodeBehind
    By Puia in forum 1.x Help
    Replies: 0
    Last Post: Oct 08, 2009, 12:02 PM

Posting Permissions