在 jqgrid 中编辑树形网格展开列的任何字段时..获取该单元格的 html 内容,而不是实际值。有什么解决办法吗?

2024-03-31

在 jqgrid for treegrid 中,当我单击 ExpandColumn:'name' 列的单元格中显示的值进行编辑时,我将获取单元格内内容的 html。

我得到的 html 内容是:-

<div class="tree-wrap tree-wrap-ltr" style="width: 54px;"><div style="left: 36px;" class="ui-icon ui-icon-radio-off tree-leaf treeclick"></div></div><span class="cell-wrapperleaf">Sub-subtask1</span>

虽然我的实际价值只是:- Sub-subtask1

我的网格设置如下:-

jQuery("#tree").jqGrid({
        url:'json/jsonSamplePots.json',
        datatype: "json",
        mtype:'GET',
        colNames: ["id", "no.", "name", "col1", "col2", "col3", "col4", "col5", "col6", "col7", "col8", "col9", "col10", "col11", "col12", "col13", "col14", "col15", "col16"],
        colModel: [
            {name:'id',width: 30, editable:false, align:"right",sortable:false, hidden: true, key: true},
            {name:'no',width:80, editable:false, align:"left", sortable:true, sorttype:"int"},
            {name:'name', width:150, editable:true, sortable:true, sorttype:"text"},
            {name:'col1', width:80, editable:true, align:"right", sortable:true, sorttype:"int"},
            {name:'col2', width:80, editable:true, align:"right", sortable:true, sorttype:"date"},
            {name:'col3', width:80, editable:true, align:"right", sortable:true, sorttype:"date"},
            {name:'col4', width:80, editable:true, align:"right", sortable:true, sorttype:"int"},
            {name:'col5', width:80, editable:false, align:"right", sortable:true, hidden: true, sorttype:"date"},
            {name:'col6', width:80, editable:false, align:"right", sortable:true, hidden: true, sorttype:"date"},
            {name:'col7', width:80, editable:false, align:"right", sortable:true, hidden: true, sorttype:"int"},
            {name:'col8', width:80, editable:false, align:"right", sortable:true, hidden: true, sorttype:"date"},
            {name:'col9', width:80, editable:false, align:"right", sortable:true, hidden: true, sorttype:"date"},
            {name:'col10', width:80, editable:false, align:"right", sortable:true, hidden: true, sorttype:"int"},
            {name:'col11', width:120, editable:true, align:"left", sortable:true, sorttype:"text"},
            {name:'col12', width:80, editable:true, align:"left", sortable:true, sorttype:"text"},
            {name:'col13', width:80, editable:true, align:"right", sortable:true, hidden: true, sorttype:"text"},
            {name:'col14', width:80, editable:false, align:"right", sortable:true, hidden: true, sorttype:"text"},
            {name:'col15', width:300, editable:true, align:"left", sortable:true, sorttype:"int"},
            {name:'col16', width:80, editable:true, align:"right", sortable:true, sorttype:"int"},
        ],
        rowNum:10,
        rowList:[10,20,30],
        treeGridModel:'adjacency',
        treeGrid: true,
        cellEdit: true,
        ExpandColumn:'name',
        cellsubmit : 'clientArray',

});

你必须使用行内编辑 http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3ainline_editing代替细胞编辑 http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3acell_editing。您不能将 TreeGrid 与单元格编辑一起使用,或者至少不能使用您在其中声明的“名称”列的编辑ExpandColumn.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 jqgrid 中编辑树形网格展开列的任何字段时..获取该单元格的 html 内容,而不是实际值。有什么解决办法吗? 的相关文章

随机推荐