dataGrid编辑表格下拉框增加itemTitle属性

This commit is contained in:
thinkgem
2024-04-12 17:53:12 +08:00
parent 66e5bff947
commit 2f315cd39a

View File

@@ -5169,12 +5169,18 @@ $.extend($.jgrid,{
ovm = $.map(ovm,function(n){return $.trim(n);});
}
if ($.isArray(options.items)){
var label, value;
var label, value, title;
for (var i=0; i<options.items.length; i++){
label = options.items[i][options.itemLabel];
value = options.items[i][options.itemValue];
ov = document.createElement("option");
ov.setAttribute("role","option");
if (options.itemTitle) {
title = options.items[i][options.itemTitle];
if (title) {
ov.setAttribute("title",title);
}
}
ov.value = value; ov.innerHTML = label;
elem.appendChild(ov);
if (!msl && ( $.trim(value) === $.trim(vl) || $.trim(label) === $.trim(vl)) ) { ov.selected ="selected"; }
@@ -11376,7 +11382,7 @@ jQuery(selector).each(function() {
jQuery(this).addClass("scroll");
jQuery(this).jqGrid(jQuery.extend({
datatype: 'local',
datatype: "local",
width: w,
colNames: colNames,
colModel: colModel,