Announcement

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

    Set selection and scroll to row in listgrid with datasource

    We have a listgrid with >1000 entries and want to scroll to a row and select the row in the lsitgrid.
    In the documentation there is the possibility to call scrollToRow(index) and selectSingleRecord(index).

    Using this in the example of the documentation scolls to the row, but it doesn't select the object at this row.
    This example http://www.smartclient.com/docs/10.0/a/system/reference/SmartClient_Explorer.html?skin=Enterprise#databoundFilter and afterwards you can paste this code to the console. After the second time you execute this snippet the row is correclty set.
    Code:
    countryList.scrollToRow(60);
    countryList.selectSingleRecord(60);
    Should this work, or is this constellation of scrollToRow and select a row a unsupported combination?

    I saw that selectSingleRecord would like to have a record, but in a datasource this record is not always present and getting the record out of listgrid.data.find() doesn't work for datasources (because the data is not loaded).

    What is the correct way, to scroll to an specific row and select this row while using a datasource in the listgrid?

    #2
    If scrollToRow() causes a data fetch, the scrolling is performed only after the data is retrieved. So you would need to wait for the dataArrived event before trying to affect the selection.

    Comment

    Working...
    X