Hello,
I have an editable grid. With a column that is a combox. The combox has a datasource and it can contain thousands of entries. I cannot use the Smart Client Server. Because I´m using Smart Client with a proprietary back end. This is the grid source:
The data store of this column named openAdvancesTripColumn answers its data in JSON. Example:
Everything works fine so far. The user can chose a travel form the combobox.
But I need to access the key (in this case the attribute generatedIndex) of the chosen object of the openAdvancesTripColumn.
But when asking the grid with
I´m getting only the chosen string, not the generatedIndex.
What should I do in order to get the generatedIndex?
Regards Thomas
I have an editable grid. With a column that is a combox. The combox has a datasource and it can contain thousands of entries. I cannot use the Smart Client Server. Because I´m using Smart Client with a proprietary back end. This is the grid source:
Code:
isc.ListGrid.create( { ID:"openAdvancesListGrid", isGroup:false, selectionType:"single", canEdit:true, editEvent:"click", autoSaveEdits:false, alternateRecordStyles:true, modalEditing:true, fields: [ { editorType:"comboBox", ID:"openAdvancesTripColumn", displayField:"openAdvancesTripColumn", editorProperties: { optionDataSource:isc.DataSource.create( { fields: [ { primaryKey:true, name:"generatedIndex" }, { name:"openAdvancesTripColumn" } ], dataFormat:"json", dataURL:"ScComboBoxDataStore?viewNumber=7&id=openAdvancesTripColumn", transformRequest:function (dsRequest) { var operationType = { operationType: dsRequest.operationType }; if (dsRequest.operationType == 'fetch') { var params = { start : dsRequest.startRow, end : dsRequest.endRow }; // combine paging parameters with criteria return isc.addProperties({}, operationType, dsRequest.data, params); }}, transformResponse:function (dsResponse, dsRequest, jsonData) { if (dsRequest.operationType == 'fetch') { dsResponse.totalRows = jsonData.totalRows; dsResponse.endRow = jsonData.endRow; dsResponse.startRow = jsonData.startRow; }; if (dsRequest.operationType == 'update') { console.log(dsResponse); }; }, recordXPath:"/resultData" } ), displayField:"openAdvancesTripColumn" }, width:250, name:"openAdvancesTripColumn", title:"Travels" } ], data: [ { openAdvancesTripColumn:"01.08 - 02.08 London", generatedIndex:"1" } ] } ) ...
Code:
{ totalRows:"3", resultData: [ { openAdvancesTripColumn:" – No Travel - ", generatedIndex:"1" }, { openAdvancesTripColumn:"03.08 - 03.08 Paris", generatedIndex:"2" }, { openAdvancesTripColumn:"01.08 - 02.08 London", generatedIndex:"3" } ] }
But I need to access the key (in this case the attribute generatedIndex) of the chosen object of the openAdvancesTripColumn.
But when asking the grid with
Code:
openAdvancesListGrid.getEditValue(0,0)
What should I do in order to get the generatedIndex?
Regards Thomas
Comment