Help filtering column data
Help filtering column data
I've been looking for ways to filter a column that contains all SELECT elements. I'm using an INPUT with keyup and fnFilter() passing the filter chars and column index.
To throw a monkey wrench in, all the SELECT element values are set "selected" via JavaScript.
I looked at creating a type-based filter plugin but the data passed to the function is a serialized String. Not the DOM node. So while I can transform that into a SELECT element I can't get the selected value from it.
I looked at columns.render() function but that also gets a serialized String Not the live DOM node.
I'm hoping someone can provide some guidance on how I can proceed.
Thank you for any help
patrick
This question has an accepted answers - jump to answer
Answers
You can try my yadcf and its
filter_type: 'custom_func'
, you might add some other attribute to your selected option (maybe your "selected" via JavaScript will be enough) and inside the custom function do the necessary logic, see it ion action and scroll down to see the code usedhttp://yadcf-showcase.appspot.com/DOM_source.html (first column)