【问题标题】:jqgrid binding keydown event to celljqgrid将keydown事件绑定到单元格
【发布时间】:2010-12-01 09:00:18
【问题描述】:

我有一个这样的网格

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("")
            });
        }
    },……………………………..

选择一个单元格时,我想将键盘事件绑定到单元格,

但我无法触发事件。

这里有什么问题?

【问题讨论】:

    标签: events jqgrid cell keydown


    【解决方案1】:

    dataEventseditoptions可以用来定义colModel。它允许进行一些您需要的绑定,例如keydown

    searchoptions 也存在相同的选项。你可以在我的old answer看到对应的例子。

    【讨论】:

      【解决方案2】:

      试试这个:

      $("#temp").keydown();
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-09-03
        • 2012-01-06
        • 2012-09-24
        • 1970-01-01
        • 2015-04-06
        • 1970-01-01
        • 2011-11-15
        • 1970-01-01
        相关资源
        最近更新 更多