this.$current.find('th.oe-record-selector input:checked')
.closest('tr').each(function () {
var record = {};
- _(rows[$(this).prevAll().length].data).each(function (obj, key) {
+ _(rows[$(this).data('index')].data).each(function (obj, key) {
record[key] = obj.value;
});
result.ids.push(record.id);
* @returns {Number} the position of the row in this.rows
*/
row_position: function (row) {
- return $(row).prevAll().length;
+ return $(row).data('index');
},
/**
* Returns the identifier of the object displayed in the provided table
columns: this.columns,
options: this.options,
row: this.rows[record_index],
- row_parity: (record_index % 2 === 0) ? 'even' : 'odd'
+ row_parity: (record_index % 2 === 0) ? 'even' : 'odd',
+ row_index: record_index
});
}
// drag and drop