Hi
I have problem of setting data to a tree grid for the below code if i called
SwitchListDetailsTree.fetchData() it fetches fine .. but after doing this i cant reorder records . I think this is because of the DataSource assigned to it . thinking so i tried set data to it by calling
SwitchListDetailsTree.fetchData(null,“SwitchListDetailsTree.setData(data)”);
although the request generates and response comes it does not display the data. how can i set dynamicaly generated data in to a tree grid?
Regards
shivantha
DataSource.create({
ID:"RailCarDetails",
transformRequest : function (dsRequest) {
var params =
{
railRoadId :document.getElementById('railRoad').value,
switchListId : selectedSwitchId
};
return params;
},
fields: [
{name: "categoryName", type:"text", primaryKey: true, title: "Item", length: 128},
{name: "station", type:"text", title: "station", length: 128},
{name: "parentID", type:"text", hidden: true, foreignKey: "supplyCategory.categoryName", rootValue:"root"},
{name: "equipmentInitial", type:"text", title:"Equipment Initial", type:"text", length:500},
{name: "equipmentNumber", type:"text", title:"Equipment Number", type:"text", length:500},
{name: "carTypeCd", type:"text", title:"Car Type Code", type:"text", length:500},
{name: "outsideLength", type:"text", title:"Outside Length", type:"text", length:500},
{name: "outsideWidth", type:"text", title:"Outside Width", type:"text", length:500},
{name: "outsideHeight", type:"text", title:"Outside Height", type:"text", length:500},
{name: "tareWeight", type:"text", title:"Tare Weight", type:"text", length:500},
{name: "weight", type:"text", title:"Weight", type:"text", length:500},
{name: "trackSeqId", type:"text", title:"Track Sequence", type:"text", length:500},
{name: "equipStatusCd", type:"text", title:"Equipment Status", type:"text", length:500},
{name: "isHazmat", type:"text", title:"is Hazmat", type:"text", length:500},
{name: "destOnline", type:"text", title:"Destination Online", type:"text", length:500},
{name: "comments", type:"text", title:"Comments", type:"text", length:500},
{name: "receivedDTM", type:"text", title:"Recieved Date", type:"text", length:500},
{name: "fromToRoad", type:"text", title:"From To Road", type:"text", length:500},
{name: "lastMoveDTM", type:"text", title:"Last Move Date", type:"text", length:500},
{name: "equipmentMoveType", type:"text", title:"Equipment Move Type", type:"text", length:500},
{name: "lastStorageMove", type:"text", title:"Last Storage Move", type:"text", length:500},
{name: "lastPlacementMove", type:"text", title:"Last Placement Move", type:"text", length:500},
{name: "lastStatusMove", type:"text", title:"Last Status Move", type:"text", length:500},
{name: "lastStatusMoveDTM", type:"text", title:"Last Status Move Date", type:"text", length:500},
{name: "lastPlacementStatusSame", type:"text", title:"Last Placement Satus Same", type:"text", length:500},
{name: "badOrderReasonCd", type:"text", title:"Bad Order Reason", type:"text", length:500},
{name: "trackLocation", type:"text", title:"Track Location", type:"text", length:500},
{name: "blockId", type:"text", title:"Block Id", type:"text", length:500},
{name: "isSelectedIcon", type:"boolean", defaultValue:false ,title:"Selected"},
{name: "descIcon", type:"text", title:"Description Icon", type:"text", length:500},
{name: "railCarIcon", type:"text", title:"Railcar Icon", type:"text", length:500},
{name:"moveTypes", width:300, title:"Move Type" , type: "comboBox"},
{name:"moveDate", title:"Move Date", type: "Date"},
{name:"moveTime", title:"Move Time", type: "Time"},
{name:"moveStations",title:"Stations" , type: "comboBox"},
{name:"moveLocations",title:"Locations" , type: "comboBox"},
{name:"patrons",title:"Patrons" , type: "comboBox"},
{name:"barOrderCodes",title:"Bad order code", type: "comboBox"},
{name:"Comments",title:"Move Comments", type: "text", length:500}
]
})
isc.TreeGrid.create({
ID:"SwitchListDetailsTree",
dataSource:"RailCarDetails",
//nodeClick:"SwitchListDetailsFindForm.findItems(node.categoryName)",
leaveScrollbarGap:false,
animateFolders:true,
canAcceptDroppedRecords:true,
canReparentNodes:false,
selectionType:"multiple",
animateRowsMaxTime:750,
sortFieldNum: 3,
headerHeight: 30,
sortDirection: "ascending",
canReorderRecords: true,
fields: [
{name: "categoryName" ,width:350},
{name:"descIcon", title:"Description Icon", width:80, align:"center",wrap:true,canEdit:false,
formatCellValue : function (value, record, field, rowNum, colNum) {
if (value !="" || value !=null ) return isc.Canvas.imgHTML("demoApp/checked.png",13,13);
//else return isc.Canvas.imgHTML("demoApp/unchecked.png",13,13)
}},
{name:"railCarIcon", title:"Railcar Icon", width:80, align:"center",wrap:true,canEdit:false,
formatCellValue : function (value, record, field, rowNum, colNum) {
if (value !="" || value !=null ) return isc.Canvas.imgHTML("demoApp/checked.png",13,13);
//else return isc.Canvas.imgHTML("demoApp/unchecked.png",13,13)
}},
{name:"trackSeqId",wrap:true,width:32},
{name:"equipmentInitial", title:"Railcar Initail", canEdit:false},
{name:"equipmentNumber", title:"Railcar Number", showHover:true,canEdit:false},
{name:"destOnline", title:"Detsination", showHover:true,canEdit:false,width:190},
{name:"equipmentMoveType", title:"Equipment Move Type", showHover:true,canEdit:false}
]
// folderDrop: function (dragRecords, dropFolder) {
// var record = SwitchListDetailsItemList.getSelectedRecord();
// var newCategory = dropFolder.categoryName;
// record.category = newCategory;
//supplyItem.updateData(record);
// }
});