First of all, define a 'label' property to the 'My Field' row.
var data = [{
"name": "My Field", "value": "O", "label":"Object", "group": "Settings",
"editor": {
"type": "combobox",
"options": {
valueField: 'value',
textField: 'label',
editable: false,
panelHeight: 100,
data: options
}
}
}];
And then define the column 'formatter' function to display the 'label' property value.
$('#pg').propertygrid({
data: data,
width: '98%',
showGroup: true,
showHeader: true,
scrollbarSize: 0,
columns: [[
{field:'name',title:'Name',width:200,resizable:false,styler:EstiloEtiquetas},
{field:'value',title:'Value',width:400,resizable:false,
formatter:function(value,row){
if (row.name == 'My Field'){
return row.label || value;
} else {
return value;
}
}
}
]],
onEndEdit: function(index,row){
if (row.name == 'My Field'){
var ed = $(this).datagrid('getEditors',index)[0];
row.label = $(ed.target).combobox('getText');
}
}
});