我正在尝试向jqgrid ondblclick
函数添加一个函数,但我尝试将此事件附加到JavaScript
文件中,以便它将附加到所有网格,但是当我去双击该行什么都没发生。
这是我的代码:
$(function () {
var grid = jSnap.grids.createGrid($("#productSetStockSearchList"));
$(grid.grid).on('jqgridondblClickRow', function (id) {
var rowData = $(this).getRowData(id);
jSnap.modals.openModal({ action: "StockDetails", controller: "Stock", itemId: rowData.StockId, width: 800, height: 600 })
});
});
jqgridondblClickRow
的功能名称是什么?
答案 0 :(得分:1)
应该是
$(function () {
var grid = jSnap.grids.createGrid($("#productSetStockSearchList"));
$(grid.grid).on('ondblClickRow:', function (id) {
var rowData = $(this).getRowData(id);
jSnap.modals.openModal({ action: "StockDetails", controller: "Stock", itemId: rowData.StockId, width: 800, height: 600 })
});
});
答案 1 :(得分:0)
没关系,我不得不更改名称" jqgridondblClickRow"到" jqGridDblClickRow"这是固定代码
$(function () {
var grid = jSnap.grids.createGrid($("#productSetStockSearchList"));
$(grid.grid).on('jqGridDblClickRow', function (e, id) {
var rowData = $(this).getRowData(id);
jSnap.modals.openModal({ action: "StockDetails", controller: "Stock", itemId: rowData.StockId, width: 800, height: 675 });
});
});