How to get a jqGrid cell value when editing

前端 未结 23 2568
日久生厌
日久生厌 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:29

    Hi, I met this problem too. Finally I solved this problem by jQuery. But the answer is related to the grid itself, not a common one. Hope it helps.

    My solution like this:

    var userIDContent = $("#grid").getCell(id,"userID");  // Use getCell to get the content
    //alert("userID:" +userID);  // you can see the content here.
    
    //Use jQuery to create this element and then get the required value.
    var userID = $(userIDContent).val();  // var userID = $(userIDContent).attr('attrName');
    

提交回复
热议问题