Set a default value in yadcf
Set a default value in yadcf
mbenci
Posts: 11Questions: 6Answers: 0
Hi all,
I'd like to know if there is a method to define a default filter value (NO default label) using yadcf.
Thanks and regards,
Marco B
This discussion has been closed.
Answers
You should use the exFilterColumn function of yadcf, see it in action: http://yadcf-showcase.appspot.com/multiple_tables.html (notice the "Numbers" and "Values" column filters)
Use the latest 0.8.2 version (in case you use it already then download it again from github - because I just published a fix for 0.8.2)
Here its documentation:
Hi Daniel,
Hi Daniel,
thanks for your answer.
I tried your solution but it does not work for me.
Some details: I use a "server side" configuration and I use "yadcf_data" to populate the select. I've also updated my yadcf version as suggested by you.
The filter works correctly but there is not pre selection.
My code is:
Thanks and regards,
Marco B
Hi Daniel,
I've changed a little my code: now I use DataTable (D uppercase) and now in firebug I've this error:
All works except the exFilterColumn.
The code now is:
I haven't tried exFilterColumn with serverside so there might be a bug , but regarding the
My guess it has to do with you mixing new datatabled API (Capital "D") with old API style attributes (Hungarian notation) , change bProcessing -> processing , aoColumns - > columns ... etc... (see migration guide or some docs of datatable)
Also , I strongly recommend you to use (for range_number_slider)
or any other number to reduce server usage (read docs for more info)
Hi Daniel,
neither if I use DataTable nor dataTable the preSelection works correctly using server side.
Do you can make a check please?
Thanks and regards,
Marco B
Yes,
please open an issue for that https://github.com/vedmack/yadcf/issues
When I tried to use this it didn,t work for me either
yadcf.exFilterColumn(oTable, [
[1, "2014"],
[2, "1"]
]);
Byt when I added [] around the sorting argument it worked fine.
yadcf.exFilterColumn(oTable, [
[1, ["2014"]],
[2, ["1"]]
]);