[英]JQgrid inline edit second time previously selected row not edit?
I am used onSelectRow
event for editing selected row. 我用
onSelectRow
事件来编辑所选行。
Initially this event work fine but after editing row, if 最初这个事件工作正常,但编辑行后,如果
My onSelectRow
is: 我的
onSelectRow
是:
onSelectRow: function(id)
{
if(id && id!==lastsel)
{
jQuery('#My_grid').jqGrid('restoreRow',lastsel);
jQuery('#My_grid').jqGrid('editRow',id,true);
lastsel=id;
}
}
so please tell me how to fix this problem. 所以请告诉我如何解决这个问题。
Thank You 谢谢
Can you please try this: 你能试试这个:
if ($("tr#"+id).attr("editable") == "1") { // Checking state of grid row
jQuery('#My_grid').jqGrid('restoreRow',id);
}
else
{
jQuery('#My_grid').jqGrid('editRow',id,true);
}
Hope this helps.. 希望这可以帮助..
hey Avinash I solved this issue I am just change in my onSelectRow
event 嘿Avinash我解决了这个问题我只是改变了我的
onSelectRow
事件
onSelectRow: function(id)
{
if(id)
{
jQuery('#My_grid').jqGrid('restoreRow',lastsel);
jQuery('#My_grid').jqGrid('editRow',id,true);
lastsel=id;
}
}
Edit in if condition used if(id)
instead of if(id && id!==lastsel)
. 编辑if if条件使用
if(id)
而不是if(id && id!==lastsel)
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.