Announcement

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

    Adding an object to a specific postition in a listgrid

    Hey guys,

    I’m currently working on a listgrid which doesn’t use any kind of sort or group. Now I’d like to add new objects without reloading all data. The new objects furthermore should be inserted to a specific position. Therefore I searched your documentation and found no method of ListGrid to do so. The only option I found was to manipulate ListGrid.data with addAt().

    Doing so doesn’t feel correct, because the listgrid should do this work.
    Besides that, if the user decides to use grouping, the ListGrid.data will become a tree and will no longer understand addAt().

    Is there a legit way to add a single object to a specific position in a listgrid?

    Best Regards

    #2
    Hey guys,

    are there any news about this?
    Do you need more information about the described behavior?

    Thanks for your response.

    Best Regards

    Comment


      #3
      You have a couple of options here:
      For a simple grid with data provided locally (as an array), manipulating the data object is correct.
      Going through the List APIs should cause the data to call 'dataChanged' which will cause the ListGrid to update its view as appropriate (regrouping if necessary, etc).
      Alternatively you can call dataChanged yourself to notify the ListGrid of the changes.

      Alternatively, if you have a DataBound grid, you'd notify the DataSource on the client-side of the new record via DataSource.updateCaches().
      Of course ordering the data in this case is more tricky - you'd basically have to rely on an explicitly specified sort field, populated such that the new record would show up in the expected spot.

      Regards
      Isomorphic Software

      Comment

      Working...
      X