Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If one column is not sortable between other sortable columns, wrong column is processed server side #7

Open
anna-git opened this issue Aug 16, 2018 · 0 comments

Comments

@anna-git
Copy link
Contributor

               <tr>
                                <th data-name="c1">@Localizer["Column1"]</th>
                                <th data-name="c2" data-orderable='false'>@Localizer["Column2"]</th>
                                <th data-name="c3" class="">@Localizer["Column3"]</th>
                                <th data-name="c4" class="">@Localizer["Column4"]</th>
               </tr>

If c2 is not sortable, and the user order the table by c3, jquery datatables will send index 2 to server.
As the model will be decorated with
[DataTableResolver(OrderableColumns = new[] { nameof(C1), nameof(C3), nameof(C4) }

As index 2 is sent to the server by datatables writing in the data callback:
JSON.stringify(data)

Then the server will wrongly assume we want to order on C4, whereas we clicked on C3 header.

@anna-git anna-git changed the title If one column is not sortable between other sortable columns, wrong column is considered server side If one column is not sortable between other sortable columns, wrong column is processed server side Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant