Hi I am having a problem with the ListGrid.TransferSelectedData method. Both list grids are grouped on a field named 'category'. When I attempt to drag a record from one to the other I get the following exception:
If the both source and target grids are ungrouped then the transfer seems to work. What is the difference?
We are using SmartGWT LGPL version 2.2
The source code is below:
Thanks
Code:
(TypeError): Cannot call method 'isAdvancedCriteria' of undefined
stack: TypeError: Cannot call method 'isAdvancedCriteria' of undefined
at Object.isc_Canvas_getDropValues [as getDropValues] ([url]http://localhost:8080/MXiConsole/mxiconsole/sc/modules/ISC_Core.js:3401:106[/url])
at Object.isc_Canvas_transferRecords [as transferRecords] ([url]http://localhost:8080/MXiConsole/mxiconsole/sc/modules/ISC_Core.js:3369:147[/url])
at Object.isc_Canvas_transferSelectedData [as transferSelectedData] ([url]http://localhost:8080/MXiConsole/mxiconsole/sc/modules/ISC_Core.js:3420:100[/url])
at $transferSelectedData ([url]http://localhost:8080/MXiConsole/mxiconsole/FF1C7B48C409011194DDC7B084448AF3.cache.html:11022:10[/url])
at Object.onCellDoubleClick_1 [as onCellDoubleClick] ([url]http://localhost:8080/MXiConsole/mxiconsole/FF1C7B48C409011194DDC7B084448AF3.cache.html:21199:5[/url])
at Object.dispatch_13 [as dispatch] ([url]http://localhost:8080/MXiConsole/mxiconsole/FF1C7B48C409011194DDC7B084448AF3.cache.html:11451:29[/url])
at $fireEvent_0 ([url]http://localhost:8080/MXiConsole/mxiconsole/FF1C7B48C409011194DDC7B084448AF3.cache.html:833:17[/url])
at $fireEvent ([url]http://localhost:8080/MXiConsole/mxiconsole/FF1C7B48C409011194DDC7B084448AF3.cache.html:734:60[/url])
at Object.fireEvent_1 [as fireEvent] ([url]http://localhost:8080/MXiConsole/mxiconsole/FF1C7B48C409011194DDC7B084448AF3.cache.html:8850:21[/url])
at Object.
We are using SmartGWT LGPL version 2.2
The source code is below:
Code:
public UserRoleMaintenanceWindow(UserRoleRecord userRoleRecord, ConsoleServiceAsync service) {
UserRoleMaintenanceWindow.service = service;
if (userRoleRecord == null)
{
isNew = true;
this.userRoleRecord = new UserRoleRecord();
}
else
{
isNew = false;
getRights(userRoleRecord.getID());
this.userRoleRecord = userRoleRecord;
}
// Setup the UI
userRoleMaintenanceWindow.setSize("500px", "397px");
userRoleMaintenanceWindow.setIsModal(true);
userRoleMaintenanceWindow.setAutoCenter(true);
userRoleMaintenanceWindow.setShowHeaderIcon(true);
userRoleMaintenanceWindow.setShowResizer(false);
userRoleMaintenanceWindow.setShowTitle(true);
userRoleMaintenanceWindow.setShowStatusBar(false);
userRoleMaintenanceWindow.setShowModalMask(true);
userRoleMaintenanceWindow.setShowMinimizeButton(false);
userRoleMaintenanceWindow.setTitle("userRoleMaintenance");
// The form for the user role name
dynamicForm_Role.setWidth("100%");
dynamicForm_Role.setSelectOnFocus(true);
dynamicForm_Role.setNumCols(2);
dynamicForm_Role.setPadding(5);
dynamicForm_Role.setColWidths(60, "*");
textItem_RoleName.setSelectOnFocus(true);
textItem_RoleName.setRequired(true);
textItem_RoleName.setRequiredMessage("nameRequired");
textItem_RoleName.setWidth("*");
textItem_RoleName.setColSpan(2);
if (!isNew)
textItem_RoleName.setValue(userRoleRecord.getName());
dynamicForm_Role.setFields(new FormItem[] { textItem_RoleName});
userRoleMaintenanceWindow.addItem(dynamicForm_Role);
// The area for the user functions
Canvas canvas_Main = new Canvas();
canvas_Main.setHeight("301px");
userRoleMaintenanceWindow.addItem(canvas_Main);
listGrid_Unassigned.setCanDragRecordsOut(true);
listGrid_Unassigned.setCanAcceptDroppedRecords(true);
listGrid_Unassigned.setCanReorderFields(true);
listGrid_Unassigned.setDragDataAction(DragDataAction.MOVE);
listGrid_Unassigned.setShowDragShadow(true);
listGrid_Unassigned.addCellDoubleClickHandler(new CellDoubleClickHandler() {
public void onCellDoubleClick(CellDoubleClickEvent event) {
try {
listGrid_Assigned.transferSelectedData(listGrid_Unassigned);
}
catch (Exception e) {
MessageBox.say(e.getMessage());
}
}
});
ListGridField listGridField_UnAssigned_Name = new ListGridField("name", "unassgined");
ListGridField listGridField_UnAssigned_Category = new ListGridField("category", "category");
listGrid_Unassigned.setFields(new ListGridField[] { listGridField_UnAssigned_Name, listGridField_UnAssigned_Category});
listGrid_Unassigned.setSortField("name");
listGrid_Unassigned.setSortDirection(SortDirection.ASCENDING);
listGrid_Unassigned.setGroupStartOpen(GroupStartOpen.ALL);
listGrid_Unassigned.setGroupByField("category");
listGrid_Unassigned.hideField("category");
listGrid_Unassigned.setData(UserFunctionData.getRecords());
EdgedCanvas edgedCanvas_Unassigned = new EdgedCanvas();
edgedCanvas_Unassigned.addChild(listGrid_Unassigned);
canvas_Main.addChild(edgedCanvas_Unassigned);
edgedCanvas_Unassigned.setRect(6, 6, 225, 296);
EdgedCanvas edgedCanvas_Assigned = new EdgedCanvas();
listGrid_Assigned.setCanDragRecordsOut(true);
listGrid_Assigned.setCanAcceptDroppedRecords(true);
listGrid_Assigned.setCanReorderFields(true);
listGrid_Assigned.setDragDataAction(DragDataAction.MOVE);
listGrid_Assigned.setShowDragShadow(true);
listGrid_Assigned.addCellDoubleClickHandler(new CellDoubleClickHandler() {
public void onCellDoubleClick(CellDoubleClickEvent event) {
listGrid_Unassigned.transferSelectedData(listGrid_Assigned);
}
});
ListGridField listGridField_Assigned_Name = new ListGridField("name", "unassgined");
ListGridField listGridField_Assigned_Category = new ListGridField("category", "category");
listGrid_Assigned.setFields(new ListGridField[] { listGridField_Assigned_Name, listGridField_Assigned_Category});
listGrid_Assigned.setSortField("name");
listGrid_Assigned.setSortDirection(SortDirection.ASCENDING);
listGrid_Assigned.setGroupStartOpen(GroupStartOpen.ALL);
listGrid_Assigned.setGroupByField("category");
listGrid_Assigned.hideField("category");
edgedCanvas_Assigned.addChild(listGrid_Assigned);
canvas_Main.addChild(edgedCanvas_Assigned);
// Buttons for transfer
transferImgButton_Assign.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
listGrid_Assigned.transferSelectedData(listGrid_Unassigned);
}
});
canvas_Main.addChild(transferImgButton_Assign);
transferImgButton_Assign.setRect(237, 98, 22, 22);
transferImgButton_AssignAll.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
listGrid_Unassigned.selectAllRecords();
listGrid_Assigned.transferSelectedData(listGrid_Unassigned);
}
});
canvas_Main.addChild(transferImgButton_AssignAll);
transferImgButton_AssignAll.setRect(237, 126, 22, 22);
transferImgButton_UnAssign.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
listGrid_Unassigned.transferSelectedData(listGrid_Assigned);
}
});
canvas_Main.addChild(transferImgButton_UnAssign);
transferImgButton_UnAssign.setRect(237, 154, 22, 22);
transferImgButton_UnAssignAll.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
listGrid_Assigned.selectAllRecords();
listGrid_Unassigned.transferSelectedData(listGrid_Assigned);
}
});
canvas_Main.addChild(transferImgButton_UnAssignAll);
transferImgButton_UnAssignAll.setRect(237, 182, 22, 22);
edgedCanvas_Assigned.setRect(263, 6, 220, 296);
Canvas canvas_Bottom= new Canvas();
canvas_Bottom.setHeight("36px");
SGWTButton button_Cancel = new SGWTButton("cancel");
button_Cancel.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
userRoleMaintenanceWindow.destroy();
}
});
canvas_Bottom.addChild(button_Cancel);
button_Cancel.moveTo(277, 6);
SGWTButton button_Save = new SGWTButton("save");
button_Save.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
if (dynamicForm_Role.validate())
{
applyChanges();
}
}
});
canvas_Bottom.addChild(button_Save);
button_Save.moveTo(383, 6);
userRoleMaintenanceWindow.addItem(canvas_Bottom);
}
Thanks
Comment