Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 如何进行内联数据表编辑_Jquery - Fatal编程技术网

Jquery 如何进行内联数据表编辑

Jquery 如何进行内联数据表编辑,jquery,Jquery,我的应用程序中有以下代码: var编辑器; $(文档).ready(函数(){ var t=$(“#新艺术”).DataTable({ 栏目:[ {标题:“COD:”}, {标题:“NOMBRE”}, {标题:“MARCA”}, {“标题”:“P/U”}, {标题:“猫:”}, {标题:“子类别:”} ], 语言:{ “sProcessing”:“Procesando…”, “长度菜单”:“Mostrar菜单”, “sZeroRecords”:“无任何结果”, “sEmptyTable”:“

我的应用程序中有以下代码:

var编辑器;
$(文档).ready(函数(){
var t=$(“#新艺术”).DataTable({
栏目:[
{标题:“COD:”},
{标题:“NOMBRE”},
{标题:“MARCA”},
{“标题”:“P/U”},
{标题:“猫:”},
{标题:“子类别:”}
], 
语言:{
“sProcessing”:“Procesando…”,
“长度菜单”:“Mostrar菜单”,
“sZeroRecords”:“无任何结果”,
“sEmptyTable”:“Ningún dato可争议的资产”,
“sInfo”:“开始和结束登记总登记”,
“sInfoEmpty”:“注册总数为0的Mostrando registros del 0 al 0 de un total de 0 registros”,
“sInfoFiltered”:(最大登记总数的过滤器)”,
“sInfoPostFix”:“,
“搜索”:“客车:”,
“sUrl”:“,
“信佛千”:“,”,
“sLoadingRecords”:“Cargando…”,
“oPaginate”:{
“sFirst”:“Primero”,
“sLast”:“Último”,
“sNext”:“Siguiente”,
“前”:“前”
},
“奥里亚”:{
“升迁之旅”:“升迁之旅”活动,
“教师指导”:“下一代教师专栏”活动
}
},
响应:真});
$('#addRow')。在('单击',函数(){
t、 行。添加([
“ALFANUMERICO”,
“PRODUCTO”,
“玛卡”,
"PRECIO",,
"范畴",,
“子类别”
])。抽签(假);
} );
$('#nuevoart')。在('click','t body td',function(){
} );

});好吧,我使用了Mayank上面的代码,现在它功能完美,但我做了一些更改:

var oldValue=null;
$(document).on('dblclick','.editable',function()){
oldValue=$(this.html();
$(this).removeClass('editable');//停止重复请求
$(this.html(“”);
$(this.find('.update').focus();
});
var newValue=null;
$(文档).on('blur','.update',函数(){
var elem=$(本);
newValue=$(this.val();
var empId=$(this.parent().attr('id');
var colName=$(this.parent().attr('name');
$(elem).parent().addClass('editable');
$(this.parent().html(newValue);
});

好吧,我使用了Mayank的上述代码,现在它功能完美,但我做了一些更改:

var oldValue=null;
$(document).on('dblclick','.editable',function()){
oldValue=$(this.html();
$(this).removeClass('editable');//停止重复请求
$(this.html(“”);
$(this.find('.update').focus();
});
var newValue=null;
$(文档).on('blur','.update',函数(){
var elem=$(本);
newValue=$(this.val();
var empId=$(this.parent().attr('id');
var colName=$(this.parent().attr('name');
$(elem).parent().addClass('editable');
$(this.parent().html(newValue);
});

请参考:但我的问题是如何使用类“editable”创建记录的每个字段,以便使用您的示例。因为我没有获取数据,所以我只想插入一条新记录。请参考:但我的问题是如何使用类“editable”创建记录的每个字段,以便使用您的示例。因为我没有获取数据,所以我只想插入一条新记录。