Announcement

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

    ListGrid Row Selection

    Hi,

    I have a ListGrid bound to a RestDataSource. I am trying to figure out how to advance the grid to a specific row programmatically.

    For example, I may have 5000 rows in the datasource and only the first 50 are displayed. I would then like to be able click a button and advance to row 3422. I can capture the click event but I am having trouble figuring out how to select row 3422.

    Thanks,
    Arend

    #2
    Hi,

    I made some progress on this. The following code will select 21st (zero index) record.

    Code:
    addDataArrivedHandler(new DataArrivedHandler() {
    
    	public void onDataArrived(DataArrivedEvent event) {
    		// TODO Auto-generated method stub
    		selectRecord(20);
    	}
    });
    However, if I changed it to selectRecord(3422), nothing happens. My data source only loads 50 records at a time.

    Thanks,
    Arend

    Comment


      #3
      If I am not mistaken when you click your button, you will have to do a fetch passing in startRow, endRow of 3400 and 3450 and then in your dataArrived event select record 21

      Comment


        #4
        Thanks for the reply.

        I finally found a nice little function called scrollToRow()

        Code:
        DeferredCommand.addCommand(new Command() {
        	public void execute() {
        		scrollToRow(3433);
        	}
        });
        That did the trick.

        Thank,
        Arend

        Comment

        Working...
        X