Sorting a grid by row's id

Hellow,

I work on a GPL product and I need to sort a grid by row’s id desc

I need that because when I use udpateFromXML, the news rows are placed at the bottom of the grid and I need them on the top.

Is there a way to :

  • either change updateFromXML method to place new lines on the top of the grid ?
  • either sorting the grid by row’s id (without using an hidden column or a custom sort method who are not available for GPL product)

Thanks for any answer :slight_smile:

According to this thread http://forum.dhtmlx.com/viewtopic.php?f=2&t=19708&p=62329, the problem is solved with placing “top” in insert_new parameter of updateFromXML.

It help a lot but there’s still two minors problems :

  1. The documentation http://docs.dhtmlx.com/doku.php?id=dhtmlxgrid:api_method_dhtmlxgridobject_updatefromxml should be updated.

  2. If there’s multiple new rows, the newest is not on the top.

       NEW_1
       NEW_2
       NEW_3
       OLD_B
       OLD_A
    

    It should be like this :

       NEW_3
       NEW_2
       NEW_1
       OLD_B
       OLD_A
    

Thanks for your help,

@++ JC