Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions paper-datatable.html
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,13 @@
});
},

_setRowKeys: function(){
_setRowKeys: function(splices){
var rowKeys = [];
this._dataKeyCollection = Polymer.Collection.get(this.data);
if (splices) {
// ensure no lingering indices exist that point to removed elements
Polymer.Collection.applySplices(this.data, splices);
}
this.data.forEach(function(row){
var key = this._dataKeyCollection.getKey(row);
if('filter' in this){
Expand Down Expand Up @@ -839,7 +843,21 @@
}
}
},

/**
* Removes all selected elements from the dataset and the view
*/
removeSelectedRows: function () {
var i = 0, key=null;
for (i; i < this.selectedKeys.length; ++i) {
key = this.selectedKeys[i];
this.splice('selectedKeys', i--, 1);
this._removeRowAtKey(key);
}
},
_removeRowAtKey: function(key) {
var obj = this._getByKey(key);
this.splice('data', this.data.indexOf(obj), 1);
},
/**
* Sort the specified column, where `column` is a reference to the actual `<paper-datatable-column>`
* element.
Expand Down