I am trying to change the gridComponent to have the my ToolStrip bar to be on the Right side of the grid within a DynamicForm
so basically i have taken the example for Embedding a ListGrid inside of Dynamic form. but i having a probelm with the this.canvasItem.storeValue(this.data);
the canvasItem is null in this instance and i am not sure why it is null
can you please check what i am missing or if there is better way to do what i am trying to accomplish within a DynamicForm attached a print screen of what the list grid would look like
so basically i have taken the example for Embedding a ListGrid inside of Dynamic form. but i having a probelm with the this.canvasItem.storeValue(this.data);
the canvasItem is null in this instance and i am not sure why it is null
can you please check what i am missing or if there is better way to do what i am trying to accomplish within a DynamicForm attached a print screen of what the list grid would look like
Code:
isc.ClassFactory.defineClass("GridEditorItem", "CanvasItem");
isc.GridEditorItem.addProperties({
//height:"*", width:"*",
//rowSpan:"*", colSpan:"*",
endRow:false, startRow:false,
autoDraw:false,
// 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);
var grid = isc.ListGrid.create({
autoDraw:false,
canSort:false,
startRow:false,
endRow:false,
// fill the space the form allocates to the item
leaveScrollbarGaps:false,
headerHeight:20,
layoutAlign:"center",
// dataSource and fields to use, provided to a listGridItem as
// listGridItem.gridDataSource and optional gridFields
dataSource:gridDS,
fields:this.gridFields,
sortField:this.gridSortField,
gridComponents:["header", "body"],
canRemoveRecords: true,
showHeader:this.gridShowHeader,
// the record being edited is assumed to have a set of subrecords
data:this.getValue(),
canEdit:true,
saveLocally:true,
modalEditing:true,
selectionType: "single",
// update form when data changes
cellChanged : function () {
this.canvasItem.storeValue(this.data);
if (this.canvasItem.gridSortField != null) {
this.sort(this.canvasItem.gridSortField);
}
},
getGrid:function(){return this;}
});
return isc.HLayout.create({
autoDraw: false,
padding: 5,
overflow:"auto",
members:[grid,this.gridEditControlField],
setData:function(data){
grid.setData(data);
},
getGrid:function(){return grid;}
});
},
// 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);
}
});
Comment