Does the dtOpts work on server side search panes
Does the dtOpts work on server side search panes
sarooptrivedi
Posts: 62Questions: 19Answers: 2
**https://datatables.net/forums/discussion/78108/searchpanes-sort-total**:
Is the dtOpts work with server side search Panes ?
{
searchPanes: {
dtOpts: {
order: [[7, 'desc']]
}
},
targets:[7],
},
Replies
The
columns.searchPanes.dtOpts
option applies to the Datatable built by SearchPanes. There are only two columns in the table. Usingorder: [[7, 'desc']]
won't work since there are 8 columns in the table.What are you trying to do?
Allan stated this about sorting by the total in the thread you linked:
Kevin
My custom table has 10 fields I am just reference the old question link here.
Yes,
dtOpts
will pass through to the child table for the search pane. However, depending on what it is you want to do, might be limited by how SearchPanes operates. It depends what you want to do, which you haven't answered Kevin's question about.As Kevin says, the SearchPane tables only have two columns, so telling it to order by column index 7 isn't going to work.
Allan
Aha,
Now I understand little bit this function. you mean that SearchPane has only two columns for label and total. so, we need to specify the values either 0 or 1
I needs to order the Year in desc order while open the SearchPanes . I want to show the current year on first (descending order)
I think.
If that doesn't work, please link to a test case showing the issue.
Allan
I figure out it is worked on column level