AJAX sorting - send column names to the server instead of column index

AJAX sorting - send column names to the server instead of column index

andy_250andy_250 Posts: 3Questions: 1Answers: 0
edited September 2014 in Free community support

Hi devs!

I am quite new to datatables.net, yet I am really happy with it - it is nicely structured and has a wide range of options. I have built a custom sortable grid - it works great. But I have one thing I'd like to improve. Scenario:

  • the data is fetched from server with ajax
  • on column sort an ajax call is made with parameters: order[0][column] = "0", order[0][dir] = "asc"
  • this is fine, however this requires a mapping between "0" and the column name I want to sort on i.e.the server needs to know that column 0 actually is column "userName"
  • is it possible for me to tweak the ajax sort request parameters so I can replace "0" with proper column name (using datatables api I can easily get the column name)?

Regards
Andy

Answers

  • miyamiya Posts: 2Questions: 0Answers: 0

    I have the same issue. Will be great to setup the mapping on the client side, otherwise this becomes tricky when using ColReorder.
    Any help will be much appriciated

This discussion has been closed.