Skip to content

Commit

Permalink
datatable的insert监听传入的rows要过滤掉删除的数据
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuYueKai committed Jul 5, 2017
1 parent d9a428a commit 0f1a94b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/row.js
Expand Up @@ -169,9 +169,15 @@ const insertRows = function(index, rows) {
this.updateSelectedIndices(index, '+', rows.length)
this.updateFocusIndex(index, '+', rows.length)
this.updatePageAll();
var insertRows = []
$.each(rows,function(i){
if(this.status == Row.STATUS.NORMAL || this.status == Row.STATUS.UPDATE || this.status == Row.STATUS.NEW){
insertRows.push(this);
}
})
this.trigger(DataTable.ON_INSERT, {
index: index,
rows: rows
rows: insertRows
})
if (this.ns) {
if (this.root.valueChange[this.ns])
Expand Down

0 comments on commit 0f1a94b

Please sign in to comment.