Hi All,
I have a TreeGrid linked to a RestDataSource but when I initiate an edit with startEditing() the editor presents an empty cell rather than showing the existing value.
Any pointers to what I'm doing wrong would be gratefully received.
The following code shows it happening with a newly added record but it happens when editing existing records too.
TIA,
Dan
SmartClient Version: SC_SNAPSHOT-2011-05-27/LGPL Deployment (built 2011-05-27)
Browser: IE8
I have a TreeGrid linked to a RestDataSource but when I initiate an edit with startEditing() the editor presents an empty cell rather than showing the existing value.
Any pointers to what I'm doing wrong would be gratefully received.
The following code shows it happening with a newly added record but it happens when editing existing records too.
Code:
isc.RestDataSource.create({ ID: "menu", dataFormat: "json", dataURL: "menu.ashx", nameProperty: "name", idField: "id", parentIdField: "parentId", treeRootValue: 1, fields: [{ name: "name", title: "Name", type: "text", canEdit: true, required: true }, { name: "id", title: "ID", type: "integer", primaryKey: true, canEdit: false, hidden: true, required: true }, { name: "parentId", title: "parentId", type: "integer", canEdit: false, hidden: true, required: true } ], transformRequest: function (dsRequest) { var data = this.Super("transformRequest", arguments); if (dsRequest.operationType == "fetch") { data = isc.addProperties({}, data, { dataex: dsRequest.parentNode.data, sNodeType: dsRequest.parentNode.sNodeType }); } return data; } }); treeMain = isc.TreeGrid.create({ ID: "treeMain", dataSource: "menu", canEdit: true, canEditCell: function (rowNum, colNum) { return (m_editMode) ? true : this.Super("canEditCell", arguments); }, editByCell: true, autoFetchData: true, showHeader: false, dataArrived: onInitialDataArrived, click: onClickNode, animateFolders: true, showAllRecords: true, showOpener: false, showConnectors: false }); var ret = menu.addData({ "id": newId, "parentId": pid, "name": "New Item", "sNodeType": 19, "displayMode": 1, "isFolder": false}, function (dsResponse, data, dsRequest) { var i = treeMain.data.findIndex("id", data[0].id); treeMain.startEditing(i, 0, false); });
TIA,
Dan
SmartClient Version: SC_SNAPSHOT-2011-05-27/LGPL Deployment (built 2011-05-27)
Browser: IE8
Comment