Skip to content

Commit

Permalink
API: Publish rowByItem method
Browse files Browse the repository at this point in the history
Closes #155
  • Loading branch information
tabalinas committed Dec 5, 2015
1 parent 5da7677 commit 34ce76c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/jsgrid.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1057,13 +1057,13 @@
},

editItem: function(item) {
var $row = this._rowByItem(item);
var $row = this.rowByItem(item);
if($row.length) {
this._editRow($row);
}
},

_rowByItem: function(item) {
rowByItem: function(item) {
if(item.jquery || item.nodeType)
return $(item);

Expand Down Expand Up @@ -1111,7 +1111,7 @@
editedItem = item;
}

var $row = item ? this._rowByItem(item) : this._editingRow;
var $row = item ? this.rowByItem(item) : this._editingRow;
editedItem = editedItem || this._getEditedItem();

return this._updateRow($row, editedItem);
Expand Down Expand Up @@ -1181,7 +1181,7 @@
},

deleteItem: function(item) {
var $row = this._rowByItem(item);
var $row = this.rowByItem(item);

if(!$row.length)
return;
Expand Down
4 changes: 2 additions & 2 deletions tests/jsgrid.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1206,11 +1206,11 @@ $(function() {
},
onItemUpdating: function(e) {
updatingArgs = $.extend(true, {}, e);
updatingRow = grid._rowByItem(data[0])[0];
updatingRow = grid.rowByItem(data[0])[0];
},
onItemUpdated: function(e) {
updatedArgs = $.extend(true, {}, e);
updatedRow = grid._rowByItem(data[0])[0];
updatedRow = grid.rowByItem(data[0])[0];
}
},

Expand Down

0 comments on commit 34ce76c

Please sign in to comment.