JEasyUI: Bug Fixing for perpertygrid
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JEasyUI: Bug Fixing for perpertygrid相关的知识,希望对你有一定的参考价值。
The propertygrid is really a nice plugin. However, you may encounter error if load it with ajax method as below.
$(‘#p_prop‘).panel(‘refresh‘, ‘./property_data.php‘);
When editing a loaded property field, user abort the action by refreshing the property panel again. You will get below error:
Reason:
Inside stopEditing which is called during propertygrid initialization, the opts line failed, due to currTarget is global variable which is not reset when reloading by ajax
function stopEditing(target){ var t = $(target); if (!t.length){return} var opts = $.data(target, ‘propertygrid‘).options; opts.finder.getTr(target, null, ‘editing‘).each(function(){ var index = parseInt($(this).attr(‘datagrid-row-index‘)); if (t.datagrid(‘validateRow‘, index)){ t.datagrid(‘endEdit‘, index); } else { t.datagrid(‘cancelEdit‘, index); } }); opts.editIndex = undefined; }
Solution:
function buildGrid(target){ var state = $.data(target, ‘propertygrid‘); var opts = $.data(target, ‘propertygrid‘).options; currTarget = undefined; //bug fixing for ajax reload
以上是关于JEasyUI: Bug Fixing for perpertygrid的主要内容,如果未能解决你的问题,请参考以下文章
MIP启发式算法:Variable fixing heuristic
Fixing the train-test resolution discrepancy