1. 程式人生 > >UniEAP實現grid點選選中當前行

UniEAP實現grid點選選中當前行

unieap.grid.manager.ViewManager.extend({	//滑鼠點選事件
	_doClick: function(e) {
		if (e.cell) {
			var selectionManager = this.grid.managers.managers["SelectionManager"];
			if(selectionManager) {
				selectionManager.setSelect(e.rowIndex,!selectionManager.isSelected(e.rowIndex));
			}
			this.onCellClick(e.cell, e.rowIndex);
		}
		var rows = this.grid.managers.get("RowManager");
		if (isNaN(e.rowIndex)) {
			return;
		}
		this.onRowClick(e);
		rows.updateCurrnetRow(Number(e.rowIndex));
	}
});


效果如下圖所示: