Results 1 to 2 of 2

Thread: Focus on a specified grid line after a store reload...

  1. #1

    Question Focus on a specified grid line after a store reload...

    Hi all,

    When i load (or reload) a grid store, i would like to focus the grid view on the line i want to specify, directly after the load.

    The grid have more than 200 hundred lines but only show 20 at a given time. The focus would allow me not to scroll manually to the x line.

    So i made something like this :

    PHP Code:
    //Afterload
    gridStore.on('load', function(e) {           
       
    actualPosition=20;
       
    gridStore.getSelectionModel().selectRow(actualPosition);
       
    gridStore.getView().focusRow(actualPosition);
       
    gridStore.getView().focusEl.focus();
       
    gridStore.getView().focusCell(actualPosition1);
    }); 
    I left here (in this example) all the methods to focus I used on purpose. I know they do almost the same action.

    When i try these lines in a button function, it works and it places the line in the view.
    But it don't work just after the store load...

    Is it a delay problem or something like that ?
    Any idea to put the line wanted on the first position on the grid view ?

    Thanks in advance !

  2. #2
    Sencha User ashaihullin's Avatar
    Join Date
    Jan 2010
    Location
    Kyrgyzstan, Bishkek
    Posts
    67

    Default

    as a variant you can configure callback property when calling load method:

    Code:
    this.store.load({
        scope: this,
        callback: function(){
             this.getSelectionModel().selectRow(1);
        }				
    });
    it work's for me every time i reload the store...

Similar Threads

  1. Grid Store reload from popup??
    By sang7603 in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 9 May 2010, 8:59 PM
  2. problem Focus in line grid in IE
    By cooluser7 in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 26 Aug 2009, 5:28 AM
  3. Grid Store Reload
    By adamli in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 25 Jun 2009, 6:11 AM
  4. Mask a grid before store.reload() method and Unmask after store.reload()
    By faqlcp in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 23 Nov 2008, 10:05 AM
  5. Reload grid with different/new store
    By SGulseth in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 12 Aug 2008, 12:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •