Announcement

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

    How to keep checkbox checked when ListGrid is refresh?

    Hi, I would like to know if there are method for the ListGrid to remain checkbox checked when I call ListGrid.refresh()?
    In our application, there will be a timer triggered every 5 seconds, when the timer runs out, we will invoke ListGrid.refresh() and retrieving data from server side.
    The checked checkbox will be cleared when the timer timed out. I've try to use ListGrid.setReselectOnUpdate() but it doesn't work or getSelectedState() when the timer times out and setSelectedState() before refresh() and still no luck.
    Can you suggest how to achieve this goal that I need to keep the checkbox checked when the list grid is refreshed? Thanks in advance.

    #2
    We assume you actually mean refreshData(), not refresh().

    Re-applying selected state via setSelectedState() is correct, but needs to be done once the refresh has actually completed. Use the callback provided in the refreshData() API to call setSelectedState() at the right time.

    Comment


      #3
      Many thanks for your kindly reply. Yes, we do use ListGrid.refreshData(), not refresh(), sorry for typo. I will try it and let you know if there are any questions. :)
      One more question about setReselectOnUpdate(), I just thought that this API will do the save and apply the selected state internally of SmartGWT but seems I have misunderstanding about this API. Can you give example for how to use setReselectOnUpdate()?
      Last edited by gilberth; 10 May 2018, 02:27.

      Comment

      Working...
      X