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
原文:http://www.cnblogs.com/binglong/p/5253600.html