gpt4 book ai didi

jquery - jqgrid是否支持多复选框列表编辑

转载 作者:行者123 更新时间:2023-12-01 03:54:03 27 4
gpt4 key购买 nike

我是playing around with jqgrid我想编辑行条目。其中一个单元格是一个列表,所以我想要在单元格内使用某种多选编辑器。我没有看到对单元格编辑的支持,我可以从列表中选择多个条目。选择(多选列表或更好的复选框下拉列表)

有类似的支持吗? enter image description here

最佳答案

工作示例:

{ name: "Id_ListaMultiple", index:"Id_ListaMultiple",editable:true,edittype:"custom",editoptions:{custom_element:multiCheckElem, custom_value:multiCheckVal,list:"2:Reposición;1:Solicitud Inicial"}},

function multiCheckElem(values, optio) {
var id = optio.id;
var ctl = '<div id="'+ id + '" class="checklist">';
var ckboxAry = optio.list.split(';');
var aValues = [];
if (values && values.length)
{
aValues = values.split(",");
}
for (var i = 0; i < ckboxAry.length; i++)
{
var item = ckboxAry[i].split(':');
ctl += '<input type="checkbox" ';

if (aValues.indexOf(item[0]) != -1)
{
ctl += 'checked="checked" ';
}
ctl += 'value="' + item[0] + '"> ' + item[1] + '</input><br/>';
}
return ctl + '</div>';
}

function multiCheckVal(elem, action, val) {
var items = '';
if (action == 'get') // submitted
{

$("input[type=checkbox]:checked", elem).each(function (i, e)
{
if (items) items += ","
items += e.value;
});

}
else // launched
{

}
return items;
}

问候亨利

关于jquery - jqgrid是否支持多复选框列表编辑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4876433/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com