Yadcf with data range
Yadcf with data range
esaesa
Posts: 6Questions: 2Answers: 0
Hi
I integrated datatables 1.10 successfully with yadcf both are geat.
But i can't get the range select filter_type: "range_number_slider" to work
My work is straight forward except the the data is mixed between numbers and null or empty string and i use renderer to check it and show zero instead of null but slider is not shown without any error in console. and here is my complete script
$(document).ready(function () {
var myTable = $('#example').DataTable({
ajax: "CRUD1.php",
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"pagingType": "full_numbers",
"columnDefs": [
{
// The `data` parameter refers to the data for the cell (defined by the
// `data` option, which defaults to the column being worked with, in
// this case `data: 0`.
"render": function (data, type, row) {
if (!(data > 0))
{
return '<span style="color:red;">0</span>';
}
else {
return data;
}
},
"targets": [4]
},
{"visible": true, "targets": [3]},
{
// The `data` parameter refers to the data for the cell (defined by the
// `data` option, which defaults to the column being worked with, in
// this case `data: 0`.
"render": function (data, type, row) {
if (!(data > 0))
{
return '<span style="color:red;">0</span>';
}
else {
return data;
}
},
"targets": [5]
}
],
columns: [
{
data: "type_name"
}
,
{
data: "Sp"
}
,
{
data: "Po"
}
,
{
data: "Cl"
},
{data: "Count_id"},
{data: "ideal"}
]
});
yadcf.init(myTable, [
{column_number: 0,
filter_type: "multi_select",
select_type: 'select2'
},
{column_number: 1
},
{column_number: 2},
{column_number: 3},
{column_number: 4,
filter_type: "range_number_slider"
},
{column_number: 5}//
]);
});
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
If you will provide a working example with your issue I think it won't be too hard to pinpoint the problem.
http://jsfiddle.net/esaesa/8ouku3of/5/
if i removed the slider filter every thing is working well
All yadcf integrations with other third party library's requires their inclusion on the page, you haven't included jquery ui, thats why it dis not work for you
here's a working fiddle
http://jsfiddle.net/esaesa/8ouku3of/5/
You are right. But still i can't regenerate my issue on simple example at fiddle so be sure i will return back to you with a complete public one showing the issue. also if i found the reason i will submit it here.
Thanks
Here you go, http://jsfiddle.net/8ouku3of/10/ issue reproduced... now go and open an issue on yadcf github and cross fingers... :)
Thanks. I just opened it here https://github.com/vedmack/yadcf/issues/108
Thanks for your solution
https://github.com/vedmack/yadcf/issues/108#issuecomment-63887553