|
|
@@ -1364,8 +1364,15 @@
|
|
|
|
|
|
// click to select by column
|
|
|
this.$body.find('> tr > td').off('click').on('click', function () {
|
|
|
- var $tr = $(this).parent();
|
|
|
- that.trigger('click-row', that.data[$tr.data('index')], $tr);
|
|
|
+ var $td = $(this),
|
|
|
+ $tr = $td.parent(),
|
|
|
+ item = that.data[$tr.data('index')],
|
|
|
+ cellIndex = $td[0].cellIndex,
|
|
|
+ $headerCell = that.$header.find('th:eq(' + cellIndex + ')'),
|
|
|
+ field = $headerCell.data('field'),
|
|
|
+ value = item[field];
|
|
|
+ that.trigger('click-cell', value, item, $td);
|
|
|
+ that.trigger('click-row', item, $tr);
|
|
|
// if click to select - then trigger the checkbox/radio click
|
|
|
if (that.options.clickToSelect) {
|
|
|
if (that.header.clickToSelects[$tr.children().index($(this))]) {
|
|
|
@@ -1374,8 +1381,16 @@
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- this.$body.find('tr').off('dblclick').on('dblclick', function () {
|
|
|
- that.trigger('dbl-click-row', that.data[$(this).data('index')], $(this));
|
|
|
+ this.$body.find('> tr > td').off('dblclick').on('dblclick', function () {
|
|
|
+ var $td = $(this),
|
|
|
+ $tr = $td.parent(),
|
|
|
+ item = that.data[$tr.data('index')],
|
|
|
+ cellIndex = $td[0].cellIndex,
|
|
|
+ $headerCell = that.$header.find('th:eq(' + cellIndex + ')'),
|
|
|
+ field = $headerCell.data('field'),
|
|
|
+ value = item[field];
|
|
|
+ that.trigger('dbl-click-cell', value, item, $td);
|
|
|
+ that.trigger('dbl-click-row', item, $tr);
|
|
|
});
|
|
|
|
|
|
this.$selectItem = this.$body.find(sprintf('[name="%s"]', this.options.selectItemName));
|