Skip to content

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

@anna-git

Description

@anna-git
               <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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions