Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ScrollToRow not working

    I cannot seem to get programmatic scrolling to work in my ListGrid, and I don't know what I'm doing wrong. I have tried to do it in two ways, but none of them are working.

    First I tried adding a DataArrivedHandler, like such

    Code:
    grid.addDataArrivedHandler(new DataArrivedHandler(){
    			
       public void onDataArrived(DataArrivedEvent event) 
       {
    	grid.scrollToRow(event.getStartRow());
       }});
    And then I tried doing it in the callback of the fetch method, like so:

    Code:
    grid.fetchData(new Criteria("params", "A"), new DSCallback(){
    
      public void execute(DSResponse response, Object rawData, DSRequest request) 
      {
         grid.scrollToRow(response.getStartRow());
      }});
    Unfortunatly, though, my grid is ignoring all my scrolling requests, and happily stays on row 0. I have checked that the start row actually is what I expect it to, so that's not the issue.

    I'm using the latest build of SmartGwt, am on a windows 7 machine and am running in development mode from Eclipse 3.5.1.

    Please help. How do I get my grid to scroll to where I want it to be?

    #2
    Hmm try wrapping in DeferredCommand.

    Code:
    DeferredCommand.addCommand(new Command() {
      public void execute() {
         grid.scrollToRow(event.getStartRow());
      }
    };

    Comment


      #3
      That works like a charm, thank you!

      Comment

      Working...
      X