SearchPanes: How to retrieve filters applied
SearchPanes: How to retrieve filters applied
Hi,
I've a datatable with searchpane, user can apply more than one filtering.
I need to extract list of selection
criteria applied.
Let me do an example.
User select from searchpane ("City" = "Milano") and ("Dummy2" = "B").
I've a button to submit data to server, but I need to send selection criteria too; so I've to send:
{"data": {"Name": "Maurizio", "City": "Milano", "Dummy1": "A", "Dummy2": "B"},
"criteria": {["Column": "City", "Value": "Milano"], ["Column": "Dummy2", "Value": "B"]} }
Is there a method to extract search criteria?
Thanks in advance.
This question has an accepted answers - jump to answer
Answers
You can do something like this here : http://live.datatables.net/midaduvi/1/edit .
This is getting the values of the selected rows, which you could then construct your message with,
Colin
Yes, it works; but only if searchPane are on-screen.
I've a searchPanes activated from a button; so divs are not visible when I can submit the message.
May be it exists a more elegant solution than I got, below action on button.
That'll work. It's going inside the DataTables object, so it may change in the future (tho unlikely), but yep, that'll do it!
Colin