我正在使用yadcf和Datatable
JavaScript的:代码
$(document).ready(function () { $.ajax({ url: 'data.asmx/getData', method: 'post', dataType: 'json', success: function (data) { $("#tableDiv").show(); var t = $('#studentDataTable').DataTable({ data: data, 'columns': [ { data: null render: function (data, type, row) { return data['fname']+' '+data['mname']+' '+ data['lname']; } }, ], }); yadcf.init(t, [ { column_number: 0, filter_type: "auto_complete", } 'footer', { cumulative_filtering: true, } ); t.draw(); } }); });但是当我在文本框中键入任何数据时,它不会搜索它。 我也尝试过选择过滤类型,也不起作用,选择框保持为空,除了默认标签。 谁知道这个问题是什么?
am using yadcf with Datatable
javaScript:code
$(document).ready(function () { $.ajax({ url: 'data.asmx/getData', method: 'post', dataType: 'json', success: function (data) { $("#tableDiv").show(); var t = $('#studentDataTable').DataTable({ data: data, 'columns': [ { data: null render: function (data, type, row) { return data['fname']+' '+data['mname']+' '+ data['lname']; } }, ], }); yadcf.init(t, [ { column_number: 0, filter_type: "auto_complete", } 'footer', { cumulative_filtering: true, } ); t.draw(); } }); });but When i type any data in the text box its not searching it. I also tried Select filtering type that also not working,select box stays empty apart from default label. anyone knows whats the Problem ?
最满意答案
获取0.9.0.beta.12并使用column_data_type: rendered_html作为过滤器, 请参阅docs
{ column_number: 0, column_data_type: rendered_html, filter_type: "auto_complete", }对于范围滑块 - 应使用以下设置(请注意ignore_char / filter_plugin_options
{ column_number: 2, filter_type: "range_number_slider", ignore_char: "%", filter_plugin_options: {step:0.01} }看到工作jsfiddle
如果这没有用,请提供一个jsbin示例来解决您的问题
Grab the 0.9.0.beta.12 and use column_data_type: rendered_html for the filter, see docs
{ column_number: 0, column_data_type: rendered_html, filter_type: "auto_complete", }As to your range slider - the following setup should be used (notice the ignore_char / filter_plugin_options
{ column_number: 2, filter_type: "range_number_slider", ignore_char: "%", filter_plugin_options: {step:0.01} }see working jsfiddle
If that won't help, provide a jsbin sample with your issue
更多推荐
发布评论