Updaterows() method on the model, adds the new row to the top instead of bottom

  • 1
  • Problem
  • Updated 2 years ago
  • Solved
I have a model on which I am using updateRows() in a javascript. This model is displayed in a table on my skuid page. I want all rows in the model to be sorted based on a serial number. But updateRows () adds the new rows at the top of existing rows instead of the bottom. Could someone please suggest a way that could make the new row add at the bottom of existing rows?
Photo of anshulika sharan

anshulika sharan

  • 210 Points 100 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Since Model.prototype.updateRows() does not create rows, I will assume that what you are referring to is actually Model.prototype.createRow().

As per the documentation for Model.prototype.createRow, found here: http://help.skuid.com/m/11720/l/205447-skuid-model-model, if you pass doAppend: true as a parameter when creating the row, it will be appended --- that is, added to the end of the Model's data --- rather than prepended.
Photo of anshulika sharan

anshulika sharan

  • 210 Points 100 badge 2x thumb
Thanks a ton Zach! You solved my problem! :)