Skip to content

Commit

Permalink
fix: 优化grid编辑下连续点击出错的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
yuekai liu committed Dec 2, 2016
1 parent 4433d23 commit d8b35b6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion js/gridCompClick.js
Expand Up @@ -70,6 +70,7 @@ const clickFun = function(e){
if(oThis.options.rowClickBan){
return;
}
this.clickFunEdit(e,index);
var rowChildIndex = oThis.getChildRowIndex(row);
if(oThis.options.contentFocus || !oThis.options.multiSelect){
if(oThis.dataSourceObj.rows[index].focus && oThis.options.cancelFocus){
Expand All @@ -89,7 +90,7 @@ const clickFun = function(e){
}
}
}
this.clickFunEdit(e,index);

}
}
};
Expand Down
16 changes: 15 additions & 1 deletion js/re_gridCompEdit.js
Expand Up @@ -273,13 +273,27 @@ const editRow = function($tr,colIndex){
*/
const re_editClose = function(){
var row = this.dataSourceObj.rows[this.eidtRowIndex];
var inputDom = null;
try{
var inputDom = this.editComp.element.parentNode.querySelector('input');
}catch(e){
}

if(inputDom){
inputDom.blur();
}
if(this.editComp && this.editComp.hide){
this.editComp.hide();
}
if (this.editComp && this.editComp.comp && this.editComp.comp.hide) {
this.editComp.comp.hide();
}
$('#' + this.options.id + '_placeholder_div').remove();
try{
$('#' + this.options.id + '_placeholder_div').remove();
}catch(e){

}

if(!row)
return;
if(this.options.editType != 'form'){
Expand Down

0 comments on commit d8b35b6

Please sign in to comment.