0

I have a grid like this

jQuery("#champDetail").jqGrid({
    data: {},
    height: 300,
    width: 800,
    colNames: ['ID', 'Combination No', 'Qty', 'SMT Program', 'SMT Machine',
               'Product Date', 'Tracking No'],
    colModel: [{ name: 'ID', width: 50 },
        { name: 'CombinationNo', width: 120, sortable: false },
        { name: 'QTY', width: 80, sortable: false, editable: true,
          editrules: { custom: true, custom_func: QTYCheck} },
        { name: 'SMTProg', width: 120, sortable: false, editable: true },
        { name: 'SMTMach', width: 120, sortable: false, editable: true },
        { name: 'ProductDate', width: 120, sortable: false, editable: true },
        { name: 'TrackingNo', width: 100, sortable: false, editable: true }
    ],……………..

    onCellSelect: function(rowid, colid) {
        debugger;
        if (colid == 3) {
            var cm = jQuery("#champDetail").getRowData(rowid)
            var temp = cm["QTY"]
            $("#temp").keydown(function() {
                alert("")
            });
        }
    },……………………………..

when select a cell,i want to bind a keydown event to the cell ,

but i can't trigger the event.

what is the problem here?

Oleg
  • 220,925
  • 34
  • 403
  • 798
user526259
  • 11
  • 1
  • 3

2 Answers2

1

There are dataEvents editoptions which can be used to the definition of the colModel. It allows to make some bindings like keydown which you need.

The same option exist also for the searchoptions. You can see the corresponding example in my old answer.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
0

Try this:

$("#temp").keydown();
vefthym
  • 7,422
  • 6
  • 32
  • 58