JqG​​rid自定义函数editoptions

时间:2012-07-09 16:14:42

标签: jquery jqgrid

我有一个带有列的jqgrid,它有一个自定义的editoptions。

      editable: true,
      edittype: "custom",
      editoptions: { custom_element: itemFirstPaidElem, custom_value: itemFirstPaidValue 

以下是两个自定义功能:

function itemFirstPaidElem(value, options) {
    var el = "<label>" + value + "</label><a style='margin-left:10px' href='#' class='ItemFirstPaidPickValue' value='" + value + "'><img src='" + path + "/Content/Images/calendar_edit.png'/></a>";
    return el;
}

function itemFirstPaidValue(elem, operation, value) {
    if (operation === 'get') {
        var val = $(elem).text();
        return val;
    }
}

我要做的是在用户完成行编辑时获取标签的内容。 问题是对象$(elem).text();总是未定义的。

我看了一下chrome developer工具,我看到的是我需要的值包含在prevObject中。

enter image description here

我试过调用$(elem).prevObject.text()但是它不起作用,我不确定它是什么。 在这一点上,有人可以帮助我。

先谢谢

0 个答案:

没有答案
相关问题