Permalink
Browse files

fix: 解决表格全选操作之后翻页需要点击2次才能执行全选操作

  • Loading branch information...
LiuYueKai committed Apr 7, 2017
1 parent 30ef645 commit 2eae2b99114bbc95c488f561ec1dfeb04f2638c7
Showing with 5 additions and 4 deletions.
  1. +1 −4 src/js/gridCompEvent.js
  2. +4 −0 src/js/gridCompOperateRow.js
View
@@ -25,13 +25,10 @@ const initGridEventFun = function() {
this.initContentDivEventFun();
// 全选
$('#' + this.options.id + '_header_multi_input').on('click', function(e) {
- if (this.hasChecked) {
+ if (oThis.hasChecked) {
oThis.setAllRowUnSelect();
- this.hasChecked = false;
} else {
oThis.setAllRowSelect();
- this.hasChecked = true;
-
}
});
};
@@ -6,8 +6,10 @@ const isCheckedHeaderRow = function() {
if (this.selectRows.length !== 0 && (this.selectRows.length == this.dataSourceObj.rows.length)) {
//修改全选标记为false
$('#' + this.options.id + '_header_multi_input').addClass('is-checked')
+ this.hasChecked = true;
} else {
$('#' + this.options.id + '_header_multi_input').removeClass('is-checked')
+ this.hasChecked = false;
}
}
/*
@@ -646,6 +648,7 @@ const setAllRowSelect = function() {
fixContentTrs: fixContentTrs
});
}
+ this.hasChecked = true;
if (typeof this.options.onAllRowSelected == 'function') {
var obj = {};
obj.gridObj = this;
@@ -670,6 +673,7 @@ const setAllRowUnSelect = function() {
for (var i = 0; i < this.dataSourceObj.rows.length; i++) {
this.setRowUnselect(i);
}
+ this.hasChecked = false;
if (typeof this.options.onAllRowUnSelected == 'function') {
var obj = {};
obj.gridObj = this;

0 comments on commit 2eae2b9

Please sign in to comment.