Canvas
Canvas

Reputation: 5897

jqGrid ondblclickevent not being called

I'm trying to add a function to the jqgrid ondblclick function but i am trying to attach this event in a JavaScript file so it will be attached to all the grids, but when I go to double click the row nothing happens at all.

Here is my code:

$(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 })
                            });
});

What is the function name for jqgridondblClickRow?

Upvotes: 0

Views: 61

Answers (2)

Canvas
Canvas

Reputation: 5897

Its ok, i had to change the name "jqgridondblClickRow" to "jqGridDblClickRow" here is the fixed code

$(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 });
                            });
});

Upvotes: 0

Ammar Khan
Ammar Khan

Reputation: 2585

It should be

$(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 })
                            });
});

Upvotes: 1

Related Questions