简体   繁体   中英

How to collect all the id values for a yadcf filtered table

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.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM