【发布时间】:2017-03-10 22:53:41
【问题描述】:
朋友们,我正在尝试在使用 jeditable 进行编辑后立即更新我的数据表。这样新数据就会在数据表中得到更新,并且每当我搜索它时,它应该在搜索结果中可见。但目前一切正常,但唯一的问题是,每当我编辑某些内容并搜索新的编辑值时,搜索结果就会显示 - 未找到结果。 为了克服这个问题,我使用了以下代码,但现在它给了我错误消息-“fnGetPosition 不是函数”。这是代码-
$(document).ready(function(){
var table1 = $('#tasksheet').DataTable();
table1.$('.edit_areaD<?php echo $row["id"]; ?>').editable('savetask.php', {
id: 'element_id',
name: 'dhanraj',
indicator : 'Saving...',
placeholder: "",
onblur:'submit',
cssclass: 'textheight',
tooltip : 'click to edit...',
"callback": function( sValue, y ) {
var aPos = table1.fnGetPosition( this );
table1.fnUpdate( sValue, aPos[0], aPos[1] );
},
"submitdata": function ( value, settings ) {
return {
"row_id": this.parentNode.getAttribute('id'),
"column": table1.fnGetPosition( this )[2]
};
},
});
});
});
提前致谢。
【问题讨论】:
-
好吧,即使我认为它应该是
.dataTable()而不是.DataTable()。但是当我将其更改为.dataTable()时,它说table1.search不是函数。@JaromandaX -
我们..然后建议我做一个更好的方法..因为到目前为止..我只有这个..@JaromandaX
-
是的,我得到 fnGetPostion 不是函数@JaromandaX
-
它解决了我使用了一些不同的方式来搜索它需要 .DataTable() 和 fnGetPosition 它需要 .datatable() 所以我重新初始化它来搜索感谢@JaromandaX
标签: javascript jquery datatable html-table jeditable