I'm using datatables and yadcf to filter a table. Now I'd like to take all the table row id values, for example, and use those as arguments in a POST request. How can I "collect" the values of these ids from the result of the filters that have been applied? I've seen this example , which doesn't seem to apply to yadcf , but is similar to my use-case.
I was able to get the information I wanted using the answer found here<\/a> . I didn't realize that jQuery will select only the visible elements, which is what I want. So, after applying the yadcf<\/strong> filter to my table it's simple to select all the tr.id values resulting from the filter.
"Yes, the submit content is only the visible row with datatables.
If you have 5 rows and after filter 2 rows, if you click on submit button with the active filter only 2 rows will be submitted.
And if, conversely, you still wanted to submit all the elements of the table despite the filtering, on the onsubmit there is a yadcf function that you just have to execute which deactivates all active filtering to submit the entire table like this :
var table = $('#mytable').DataTable( {}) ;
document.onsubmit = function(){
yadcf.exResetAllFilters(table) ;
};
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.