I found an example for using custom commands to sort multiple columns. I want to sort the STATE and ZIP columns in ascending order. Here is what I have:
"order": [[ 4, 'asc' ], [ 5, 'asc' ]]
However it is not working for me. Can you tell me what I am doing wrong?
Thank you!
]]>I’m using the hidden column code snippet in Custom Commands and it’s working great! I was wondering if I can have multiple code snippets in that Custom Commands window, as I’d like to remove sorting from certain columns.
Thanks in advance!!
]]>Initialisation code is here but not sure where to place it
https://legacy.datatables.net/extras/thirdparty/ColumnFilterWidgets/DataTables/extras/ColumnFilterWidgets/separator.html
WordPress Plugins I have installed:
Tablepress
TablePress Extension: DataTables ColumnFilterWidgets
Trying to get ‘/’ as my separation mark as seen in “Recommended Players” on https://localmultiplayergames.com/pc/
]]>I would like to both apply the command
“columnDefs”: [ { “type”: “date”, “targets”: [ 1 ] } ]
to set the second column’s format to mm/dd/yyyy date, and I would like to apply the command
“order”: [[ 1, ‘desc’ ]]
so that the table sorts by default to descending date order.
Each of these commands work individually, but I cannot figure out how to apply them simultaneously. I have tried entering them into a text editor on sequential lines, but the line breaks do not transfer when I paste them into the “Custom Commands” field, and the table does not update properly.
]]>it is possibile to change <input> to <textarea>? It would be nice to spread the conmmands over several lines (multiline).
Cheers
Sascha
A couple of years ago you helped me with setting up a custom command for one of my tables, so that it would show the current year’s statics from the table. You can reference that discussion here: https://www.ads-software.com/support/topic/auto-display-of-customized-filter-widgets/
The challenge I am experiencing today is that, for some reason, the custom command seems to have stopped working. The current command code I am using is as follows:
“fnInitComplete”: function() { $(‘#tablepress-5_wrapper’).find(‘.column-filter-widget’).last().find(‘select’).val(‘2016’).change(); }
Alternatively, I tried the following (removing the “fn” from the beginning):
“InitComplete”: function() { $(‘#tablepress-5_wrapper’).find(‘.column-filter-widget’).last().find(‘select’).val(‘2016’).change(); }
Not sure what’s wrong here. Your help would be greatly appreciated.
Thank you,
Dave
Is it possible to put the above custom command in the shortcode? If not, is there another workaround?
Thank you for the amazing plugin!
]]>Like others I need to hide a column but still have it searchable. I have this in the custom commands field for the table:
“columnDefs”: [ { “visible”: false, “targets”: [ 3 ] } ]
intending to hide column 3 (4th column starting count at 0).
This now breaks the JS for tablepress. I get the following error in the browser:
TypeError: undefined is not an object (evaluating ‘i._DT_CellIndex={row:b,column:l}’)
Jajquery.datatables.min.js:23:174
Njquery.datatables.min.js:15:231
(anonymous function)jquery.datatables.min.js:15:343
(anonymous function)jquery.js:1:927
mapjquery.js:1:3717
mapjquery.js:1:894
majquery.datatables.min.js:15:310
Just the first few lines in the call stack.
Any hep would be fantastic.
RB
https://www.ads-software.com/plugins/tablepress/
]]>Now, if we save the Custom Commands, they will be there, but if we re-open the table, the code is gone. Below is the code that is ALWAYS in the Custom Commands, followed by our code. Do you have any advice? Could we save the code in the ftp drive folders anywhere? Do you think the Table is simply too big (it loads very slowly) and that could be causing the error? I’ve loved TablePress, hope we can continue using it, and looks forward to donating once this issue is figured out. Here is the code (yours and mine) …
“columnDefs”:[{“fnRender”:function(oObj){if (typeof oObj.aData[0] !== “undefined” && oObj.aData[0].length>0){return ““+oObj.aData[2]+”“;}else{return oObj.aData[2];}},”bUseRendered”:false,”targets”:[2]},{“visible”:false,”targets”:[0]},{“fnRender”:function(oObj){return oObj.aData[1].replace(/(\d\d\d\d)-(\d\d)-(\d\d)/,”$2/$3/$1″);},”bUseRendered”:false,”targets”:[1]}],”autoWidth”:false
“aoColumnDefs”:[{“fnRender”:function(oObj) {if (typeof oObj.aData[0] !== “undefined” && oObj.aData[0].length > 0) {return “” + oObj.aData[1] + ““;} else {return oObj.aData[1];}},”bUseRendered”:false,”aTargets”:[1]},{“bVisible”:false,”aTargets”:[0]},{“fnRender”:function(oObj) {return oObj.aData[3].replace(/(\d\d\d\d)-(\d\d)-(\d\d)/, “$2/$3/$1″);},”bUseRendered”:false,”aTargets”:[3]}],”bAutoWidth”:false
Sincerely,
Jeff Bayer
https://www.ads-software.com/plugins/tablepress/
]]>I’d like the ability to filter and remove columns.
this is the shortcode I’m using:
[table id=1 datatables_colvis=true datatables_columnfilterwidgets=true datatables_columnfilterwidgets_exclude_columns=1,2,3,4 datatables_columnfilterwidgets_separator=, /]
link to my post with the datatable:
https://ntcl.org/2015/01/14/test-post/
https://www.ads-software.com/plugins/tablepress/
]]>