【发布时间】:2016-07-25 14:54:04
【问题描述】:
我收到此错误无法读取未定义数据表的属性“oFeatures”我正在使用数据表编辑器的气泡编辑
<script type="text/javascript">
var editor;
$(document).ready(function(){
// use a global for the submit and return data rendering in the examples
editor = new $.fn.dataTable.Editor( {
ajax: 'http://52.77.155.163/web/index.php?r=ivision/productprices/datatable',
table: '#example',
fields: [ {
label: "Id:",
name: "id"
},
],
formOptions: {
inline: {
onBlur: 'submit'
}
}
} );
$('#example').on( 'click', 'tbody td', function (e) {
var index = $(this).index();
if ( index === 0 ) {
editor.bubble( this );
}
});
var table=$('#example').DataTable( {
ajax: 'http://52.77.155.163/web/index.php?r=ivision/productprices/datatable',
dom: "Bfrtip",
scrollY: 300,
paging: false,
bSort: false,
columns: [
{ data: "id" },
{ data: "getcat(cat_id)" },
{ data: "getproduct(p_id)" },
{ data: "m_price" },
{ data: "c_price" },
{ data: "e_price" },
{
data: null,
defaultContent: '<a href="#" class="remove">Delete</a>',
orderable: false
}],
buttons: [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor }
],
} );
});
</script>
我在控制台中收到此错误,Cannot read property 'oFeatures' of undefined 。我正在为 datatables.net 编辑器使用气泡编辑。
【问题讨论】:
-
提供代码示例会有很大帮助
-
你好,我已经添加了代码,现在你能给我一些帮助@Chris Hopkins
标签: datatables jquery-datatables-editor