Use string with column filter?
-
Hi Tobias
I would like to ‘pre-filter’ my table. E.g. using a simple PHP script to execute the shortcode.
The row filter does something like this well. My PHP script simply takes the shortcode passed to it from a form field value and executes it.
However, the row filter finds the term in all columns whereas I want to confine the filtering to a set of category labels in a special column for filtering (and only those labels).
I have experimented with combining the row filter and column filter but that doesn’t seem to work. Here’s the shortcode I have tried so far:
[table id=11 datatables_columnfilterwidgets=true datatables_columnfilterwidgets_exclude_columns=1,2,3 filter=’cpd’ /]
The filter term is in column 4 which is hidden using CSS.
It seems that the row filter is not affected by the column filtering because all rows from all unhidden columns containing the filter term are displayed.
Perhaps I am not doing this right (likely!) OR this simply won’t work.
What would be useful, if it’s possible, would be either:
(i) an optional parameter to add a column filter to the shortcode e.g. something like columnfilter-4=”CPD”. That way I could automate different views of the table.
OR
(ii) make the row filter ignore excluded columns.I hope my description is clear!
Incidentally, the string matching used by column filter and row filter is an ‘in string’ match rather than a unique match – so ‘CPD1’ and ‘CPD2’ are both filtered by ‘CPD’. Again, for my purposes an exact string match would be useful too.
I’m not asking for a lot am I? ??
Any suggestions or advice appreciated. Thanks.
- The topic ‘Use string with column filter?’ is closed to new replies.