Hi there - How am I able to preset the date in the Min field of the Date selector? I tried putting: (column 17 is my field with the date) ..
[code]
yadcf.exFilterColumn(oTable, [[17, "02/02/2015"]]);
[/code]
Thanks Daniel, I've started using the plugin and have run into a problem with select2.
I tried using the latest versions but the did not work, seemed to have an issue with the "destroy" command. I am now using version 3.5.2 and it is working.
What version do you recommend?
When using the multi_select option, I can select multiple options but it only filters on one. Your showcase page has the same issue.
If you select "Some Data 1" and then "Some Data 2", it will only look for "Some Data 2".
I tried adding the multiple option with this line, but it did not work. Any ideas?
Thank you, Daniel. I'm using the latest version of yadcf. Once I set the filter type to exact match, it worked for me.
I do get an error in the console when I select more than one option, but it doesn't seem to affect anything. The error is:
Uncaught TypeError: Cannot read property '0' of null
On this line of select2: function focus($el) {if ($el[0] === document.activeElement) return;
Is there a way to have the pre-populated select list from the table, and add a custom selection?
Example. List is:
A
B
C
D
E
I want to add a selection called "A-C". When selected, it will filter for A,B or C.
Can this be done?
@bdunsmuir , it should work without the exact too (see in showcase) , regarding the Cannot read property '0' of null I need to see a live example that reproduces it (jsbin/jsfiddle)
As to the "A-C" filter A,B or C you should use the filter_type: custom_func or multi_select_custom_func, see it in action on showcase (first column)
Daniel, Here's how I'm doing it now. I have workcenters A,B,C,D,E. Your plugin populates these values into the multi-select list automatically.
I want to add an option to the list that will filter for A,B & C.
I do that using the custom function below. Now the multi-select list is no longer auto-populated like before, I have to manually add all the possible filter values to the list myself.
Is there a way to create a custom filter and add it to the list, but still have the list auto populated with all the possible filters?
Perhaps I am doing this all wrong. Code below:
function workcenter_filters(filterVal, columnVal) {
var final_values='';
var found;
if (columnVal === '') {
return true;
}
if (filterVal==null) {
found = 1;
}else{
//Loop through all the values in fliterVal array
$.each(filterVal, function( index, value ) {
if (value == 'ABC') { //If we are adding the ABC group of filters
final_values=final_values+"A|B|C";
}
else{
final_values=final_values+value+"|"; //Add a single workcenter name
}
});
found = columnVal.search("/:-\]|:\\)|"+final_values+":D/g");
}
if (found!== -1) {
return true;
}
return false;
}
yadcf.init(oTable, [
{column_number : wc_index,
select_type:'select2',
filter_type: "multi_select_custom_func",
custom_func: workcenter_filters,
data: [
{value: 'ABC', label: 'ABC'},
{value: 'A', label: 'A'},
{value: 'B', label: 'B'},
{value: 'C', label: 'C'},
{value: 'D', label: 'D'},
{value: 'E', label: 'E'},
],
filter_default_label:'All WC'
}
]);
I have an issue with your plugin first of all I have to have the date range filter based on date and time not just date and second your plugin is not supporting bootstrap and stop working with bootstrap.
yadcf support only date filtering if you want it to support date with time you need to open a feature request on github, yadcf does support bootstrap - tested my self and I know it works for others too, you can provide a jsbin with your issue and will take a look at it
Replies
Hi there - How am I able to preset the date in the Min field of the Date selector? I tried putting: (column 17 is my field with the date) ..
[code]
yadcf.exFilterColumn(oTable, [[17, "02/02/2015"]]);
[/code]
Hi,
Take a look at the docs: https://github.com/vedmack/yadcf/blob/master/lab/jquery.dataTables.yadcf.js#L197
Daniel
yadcf 0.8.7 is out! Added support ColReorder / Complex headers / Filter multiple columns / and much much more.
Read changelog for more info
http://yadcf-showcase.appspot.com/
Love YADCF! Great work.
I was noticing that the slider doesn't seem to work on a touch device.
Any suggestions on using a slider such as Ion.RangeSlider (http://ionden.com/a/plugins/ion.rangeSlider/demo.html) in the place of the current range slider?
@Spaghetti_Monster , thanks, just include the jQuery UI Touch Punch on your page and it should make the slider work just fine on mobile, see similar question on SO
Excellent.
Thanks Daniel!
Daniel, do I have to specify a filter for every column? I only need to filter a few columns out of about 30.
Can I do:
@bdunsmuir ,
1) No need to specify for every column (it will be such a waste of code).
2) Yes you can :)
Thanks Daniel, I've started using the plugin and have run into a problem with select2.
I tried using the latest versions but the did not work, seemed to have an issue with the "destroy" command. I am now using version 3.5.2 and it is working.
What version do you recommend?
When using the multi_select option, I can select multiple options but it only filters on one. Your showcase page has the same issue.
If you select "Some Data 1" and then "Some Data 2", it will only look for "Some Data 2".
I tried adding the multiple option with this line, but it did not work. Any ideas?
Awesome plugin!
Currently its better to use the selec2 v.3.5 (there is an open issue for version 4 - https://github.com/vedmack/yadcf/issues/171 )
As to the second issue with the ("Some Data 1" and then "Some Data 2") it was fixed in the latest yadcf version you can check the showcase / github
Thank you, Daniel. I'm using the latest version of yadcf. Once I set the filter type to exact match, it worked for me.
I do get an error in the console when I select more than one option, but it doesn't seem to affect anything. The error is:
Uncaught TypeError: Cannot read property '0' of null
On this line of select2:
function focus($el) {
if ($el[0] === document.activeElement) return;
Is there a way to have the pre-populated select list from the table, and add a custom selection?
Example. List is:
A
B
C
D
E
I want to add a selection called "A-C". When selected, it will filter for A,B or C.
Can this be done?
Thanks for the help, I very much appreciate it.
@bdunsmuir , it should work without the exact too (see in showcase) , regarding the
Cannot read property '0' of null
I need to see a live example that reproduces it (jsbin/jsfiddle)As to the
"A-C"
filterA,B or C
you should use the filter_type: custom_func or multi_select_custom_func, see it in action on showcase (first column)Daniel, Here's how I'm doing it now. I have workcenters A,B,C,D,E. Your plugin populates these values into the multi-select list automatically.
I want to add an option to the list that will filter for A,B & C.
I do that using the custom function below. Now the multi-select list is no longer auto-populated like before, I have to manually add all the possible filter values to the list myself.
Is there a way to create a custom filter and add it to the list, but still have the list auto populated with all the possible filters?
Perhaps I am doing this all wrong. Code below:
No, there is no such option (but you can ask for it on github page of yadcf (new issue)
Regarding your posted code, it looks ok, its up to you to write the right code for your custom search...
For future questions please use stackoverflow and tag it with yadcf, I don't want to spam this forum :)
Thank you, Daniel. I entered a couple of issues on github. Hopefully they are issues and not my ineptness at programming.
yadcf 0.8.8 is out!
New features added , bugs were fixed
See changelog
Showcase
Hi Daniel,
I have an issue with your plugin first of all I have to have the date range filter based on date and time not just date and second your plugin is not supporting bootstrap and stop working with bootstrap.
Best Regards,
Ali.M
yadcf support only date filtering if you want it to support date with time you need to open a feature request on github, yadcf does support bootstrap - tested my self and I know it works for others too, you can provide a jsbin with your issue and will take a look at it
I just put my request in github thanks for your reply hope to see this feature soon.