SS Column Sort Requests in 1.10
SS Column Sort Requests in 1.10
crunchfactory
Posts: 29Questions: 8Answers: 2
We are experiencing oddball output from the new dataTables:
order[0][column] = 6
order[0][dir] = desc
........
columns[17][search][regex] = false
columns[48][search][value] =
columns[4][search][value] =
columns[22][name] =
columns[47][name] =
columns[39][search][value] =
columns[28][search][regex] = false
columns[31][orderable] = true
columns[33][name] =
columns[6][name] =
columns[44][name] =
columns[7][search][value] =
columns[44][searchable] = true
columns[25][search][value] =
columns[0][data] = partNumber
columns[7][search][regex] = false
columns[34][orderable] = true
columns[46][name] =
columns[43][searchable] = true
columns[15][searchable] = true
If you'll notice, no matter what column is clicked to be sorted, the result will always only reference "order[0]":
order[0][column] = 6
order[0][dir] = desc
shouldn't this actually send the dom number of the column in the integer array? In our servlet we made a hashmap of the column dom to point to the appropriate db field name
What do we do here, this can't be correct, is it?
Thank you,
j
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Means that the first column the table is sorted on is column 6, and in descending order.
If the table is being sorted by multiple columns, there will be multiple entries, each with a column number and direction.
The '0' is the array index of the order array, not the column index.
So to send your column reference to the db (if you are only sorting by a single column), you want the value of order[0][column]
Is it even possible to sort by more than one column? From the DataTables interface I can click on individual column headers to cause a sort, but if I use CTRL key and click to select multiple column headers I still only get to sort on one column. Are we supposed to be able to sort by more than one column?
Hold shift down, that does the multicolumn select for the sort, and the ajax calls are sent each progressive time, so if you did 3 cols, the final call would contain:
etc... it looked odd at first, but it makes sense in terms of multicolumn sort...
Incidentally, you may be interested in knowing that JED v1.1 has just been released. It is now supporting DataTables v1.10.0 and Editor v1.3.1. Check it out: http://jed-datatables.ca/jed/