How to get a jqGrid cell value when editing

前端 未结 23 2641
日久生厌
日久生厌 2020-11-27 17:43

How to get a jqGrid cell value when in-line editing (getcell and getRowData returns the cell content and not the actuall value of the input element).

23条回答
  •  星月不相逢
    2020-11-27 18:38

    I think a better solution than using getCell which as you know returns some html when in edit mode is to use jquery to access the fields directly. The problem with trying to parse like you are doing is that it will only work for input fields (not things like select), and it won't work if you have done some customizations to the input fields. The following will work with inputs and select elements and is only one line of code.

    ondblClickRow: function(rowid) {
        var val = $('#' + rowid + '_MyCol').val();
    }
    

提交回复
热议问题