Hi all,
we have a problem using the keys/values column.
(we followed this sample: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/gridkeyvaluescolumnwitharray.htm?web)
After grid binding, the cell with foreign values is always empty.
Here the some parts of our code:
valueTypes is the array used for the dropdown :
var valueTypes = [
{'CdCode': 'B', 'DsDescription': 'Descr B' },
{'CdCode': 'C', 'DsDescription': 'Descr C' }
];
var valueTypesSource =
{
datatype: "array",
datafields: [
{ name: 'CdCode', type: 'string' },
{ name: 'DsDescription', type: 'string' }
],
localdata: valueTypes
};
var valueTypesAdapter = new $.jqx.dataAdapter(valueTypesSource, {
autoBind: true
});
These the columns declared in the grid for the ValueType combo:
...
{
name: 'ValueType',
value: 'CdValueType',
values: { source: valueTypesAdapter.records, value: 'CdCode', name: 'DsDescription' }
},
{ name: 'CdValueType', type: 'string' }
...
and here the declaration of the column for the rendering part:
...
{
text: 'Value type', datafield: 'CdValueType', displayfield:'ValueType', width: 200, columntype: 'dropdownlist',
createeditor: function (row, value, editor) {
editor.jqxDropDownList({ source: valueTypesAdapter, displayMember: 'DsDescription', valueMember: 'CdCode' });
}
},
...
After a bit of debugging I noticed that the objects retrieved from the server (after the jqx databind) didn’t have the “ValueType” property that should contain the description of “CdValueType” field.
Note that we decided to overwrote the “loadServerData” in dataadapter calls for the grid binding.
My impression is that the method “addForeignValues” isn’t called when method “loadServerData” has been overwritten.
Thanks in advance for your help.
Best regards
Giovanni