Copy link to clipboard
Copied
In Flex I used to use the dataGrid.scrollToIndex(XX) to scroll down to a selected row.
I can't seem to get anything to work for the Spark DataGrid in FB4.5. Searching around I tried to impliment this:
dataGrid.ensureCellIsVisible(selectedSlideIndex);
dataGrid.setSelectedIndex(selectedSlideIndex);
The selectedSlideIndex is set when a row is selected to store the int.
I can't get the DataGrid to scroll to the index, OR select the index..
So what is the Spark DataGrid version of the MX DataGrid.scrollToIndex?
Copy link to clipboard
Copied
Have you got the statement order right?:
dataGrid.setFocus();
dataGrid.dataProvider.addItemAt(item,dataGrid.dataProvider.length);
dataGrid.validateNow();
dataGrid.setSelectedIndex(dataGrid.dataProvider.length-1);
dataGrid.ensureCellIsVisible(dataGrid.selectedIndex);
- Rob
Copy link to clipboard
Copied
This worked for me! Thanks BV!
Copy link to clipboard
Copied