SmartClient Ajax RIA system
Version v12.0p_2018-12-18/PowerEdition Deployment (2018-12-18)
getting the following error when doing nested items in a dynamicForm
here is a test case
if you remove the gridGroupByField: ["supplierkey", "paperCode" ],
the error disappears
Version v12.0p_2018-12-18/PowerEdition Deployment (2018-12-18)
getting the following error when doing nested items in a dynamicForm
Code:
Uncaught RangeError: Maximum call stack size exceeded
at _3.getCriteria (ISC_Grids.js:2957)
at _3.getCriteria (ISC_Grids.js:2957)
at _3.getCriteria (ISC_Grids.js:2957)
here is a test case
Code:
isc.ClassFactory.defineClass("GridEditorItem", "CanvasItem");
isc.GridEditorItem.addProperties({
height:"*", width:"*",
rowSpan:"*", colSpan:"*",
endRow:true, startRow:true,
// this is going to be an editable data item
shouldSaveValue:true,
// Override createCanvas to create the ListGrid with the user can use to set the value.
createCanvas : function () {
var gridDS = isc.DS.get(this.gridDataSource);
return isc.ListGrid.create({
autoDraw:false,
// fill the space the form allocates to the item
leaveScrollbarGaps:false,
// dataSource and fields to use, provided to a listGridItem as
// listGridItem.gridDataSource and optional gridFields
dataSource:gridDS,
fields:this.gridFields,
sortField:this.gridSortField,
groupByField:this.gridGroupByField,
sortDirection: this.gridSortDirection,
saveByCell:this.gridSaveByCell,
editByCell:this.gridEditByCell,
// the record being edited is assumed to have a set of subrecords
data:this.getValue(),
canEdit:this.gridCanEdit,
editEvent:this.gridEditEvent,
saveLocally: true, // prevents updates to the datasource
autoFetchData:false,
canMultiGroup: true,
showRecordComponents: true,
showRecordComponentsByCell: true,
// update form when data changes
cellChanged : function () {
this.canvasItem.saveValue(this.data);
if (this.canvasItem.gridSortField != null) {
this.sort(this.canvasItem.gridSortField,this.canvasItem.gridSortDirection);
}
},
//recordDoubleClick: "addItemForm.setData(record);addItemWindow.show();",
emptyMessage: "<br>"+("nothingSelected")+"</b>",
createRecordComponent : this.gridRecordComponent,
cellContextClick: this.gridCellContextClick
});
},
// implement showValue to update the ListGrid data
// Note that in this case we care about the underlying data value - an array of records
showValue : function (displayValue, dataValue) {
if (this.canvas == null) return;
this.canvas.setData(dataValue);
}
});
isc.RestDataSource.create({
ID: 'items',
clientOnly: true,
fields:[
{ name: "orderkey", primaryKey:true, hidden:true},
{ name: "supplierkey" },
{ name: "supplierName", hidden:true},
{ name: "paperCode", title: ('paperCode')},
{ name: "width", title: ('width'), },
{ name: 'comment', title: ('comment')}
]
});
isc.DynamicForm.create({
ID: "requestForm"
,width:"100%"
,height:"100%"
,autoDraw:true
,useAllDataSourceFields:false
,fields: [
{name:"items", align:"center", width:"*", height:"*",
showTitle:false,
gridCanEdit:false,
editorType:"GridEditorItem",
gridDataSource:"iitems",
gridGroupByField: ["supplierkey", "paperCode" ],
gridFields:[
{ name: 'editItemBtn', title:" ",width:25},
{ name: 'removeItemBtn', title:" ",width:25},
{ name: "supplierkey",canEdit:false},
{ name: "paperCode", canEdit:false},
{ name: "width", showGridSummary:false, showGroupSummary: false ,canEdit:false},
{ name: 'comment', length:255,canEdit:false}
],
saveLocally: true, // prevents updates to the datasource
autoFetchData:false,
startRow:false ,
endRow:false
}
]
});
if you remove the gridGroupByField: ["supplierkey", "paperCode" ],
the error disappears
Comment