Namoshek/DataTables.NetStandard

Default ordering on first access cannot be changed

nino-s opened this issue · 3 comments

The definition of DataTablesColumn opens the possibility to add a "default" sorting order by changing OrderingIndex and OrderingCaseInsensitive. But those options are not parsed in the initial request. Therefore the request is build upon the table which has the default option "order by first column ascending". The options should be inside the script to avoid this, shouldn't they?

Reproduction:

  • Build a table
  • Define a ordering not to first column
  • Access the site and you will see that default ordering is still on first column

Please have a look at #2. I implemented the changes you suggested, but I'd appreciate feedback about the documentation (if it's clear enough).

Maybe you should point out, that those options are only used on first request (depending on stateSave of data table)
But everything else looks good!

Thank you, I tried to clearify it even more.