dataGrid编辑表格下拉框增加itemTitle属性
This commit is contained in:
@@ -5169,12 +5169,18 @@ $.extend($.jgrid,{
|
|||||||
ovm = $.map(ovm,function(n){return $.trim(n);});
|
ovm = $.map(ovm,function(n){return $.trim(n);});
|
||||||
}
|
}
|
||||||
if ($.isArray(options.items)){
|
if ($.isArray(options.items)){
|
||||||
var label, value;
|
var label, value, title;
|
||||||
for (var i=0; i<options.items.length; i++){
|
for (var i=0; i<options.items.length; i++){
|
||||||
label = options.items[i][options.itemLabel];
|
label = options.items[i][options.itemLabel];
|
||||||
value = options.items[i][options.itemValue];
|
value = options.items[i][options.itemValue];
|
||||||
ov = document.createElement("option");
|
ov = document.createElement("option");
|
||||||
ov.setAttribute("role","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;
|
ov.value = value; ov.innerHTML = label;
|
||||||
elem.appendChild(ov);
|
elem.appendChild(ov);
|
||||||
if (!msl && ( $.trim(value) === $.trim(vl) || $.trim(label) === $.trim(vl)) ) { ov.selected ="selected"; }
|
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).addClass("scroll");
|
||||||
|
|
||||||
jQuery(this).jqGrid(jQuery.extend({
|
jQuery(this).jqGrid(jQuery.extend({
|
||||||
datatype: 'local',
|
datatype: "local",
|
||||||
width: w,
|
width: w,
|
||||||
colNames: colNames,
|
colNames: colNames,
|
||||||
colModel: colModel,
|
colModel: colModel,
|
||||||
|
|||||||
Reference in New Issue
Block a user