After Editor create, how to apply sort?

After Editor create, how to apply sort?

loukinglouking Posts: 259Questions: 52Answers: 0
edited February 2016 in Editor

Not sure how to best create example for this, but will try if necessary. I suspect this is an easy answer without an example needed.

I tried using fixedOrder for the column I'm interested in, but after the create the new row is at the bottom of the table. Note I have ordering: false for this table, which I think turns off user's ability to change the order. But I want the table shown in a particular order.

On a side issue, it would be nice (and make for more maintainable code) if column name could be given rather than index for order and fixedOrder options.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Ordering in the table is always defined by the sorting order. If ordering is disabled then the display order is identical to the order that the data was added (which is what you were seeing).

    So if you want to position the row in a particular location in the table, you would need to have ordering enabled (even if the user can't activate it - i.e. use columns.orderable to disable user ordering) and the data in the row would need to place the row where you want.

    On a side issue, it would be nice (and make for more maintainable code) if column name could be given rather than index for order and fixedOrder options.

    Agreed. This has been requested before and is something I hope to include in future!

    Allan

  • loukinglouking Posts: 259Questions: 52Answers: 0

    Thanks for the quick response!

    Agreed. This has been requested before and is something I hope to include in future!

    Another way to do this possibly is to have an attribute within the columns option, associated with a specific column, which gives the user control of sort priority and sort order.

This discussion has been closed.