Hi
I'm using SmartClient 9.1d Enterprise version.
I've been trying to set the canDragRecordsOut and canAcceptDroppedRecords attributes dynamically and perform drag and drop operations between 2 Listgrids. It needs to work on a toggle, where only once you're in "Edit" mode can you perform those operations, and once "Done" you cannot perform those operations.
It doesn't appear that I can set these attributes dynamically and have it work. It doesn't perform any drag and drop between the grids even when I've set these attributes to true on each grid. I need to be able to set these attributes on and off.
The following is a simple illustration of what I'm trying to do. Is there something wrong in the way I'm doing it, or something I'm missing?
isc.HStack.create({
ID: "myStack",
height: 24,
width: 300,
padding: 2,
members: [
isc.IButton.create({
ID: "Edit_Done",
title: "Edit",
width: 50,
click: function() {
if (this.getTitle() !== "Done") {
//In edit mode - must enable dragging of records
countryList1.canDragRecordsOut=true;
countryList1.canAcceptDroppedRecords=true;
countryList1.dragDataAction="move";
countryList2.canDragRecordsOut=true;
countryList2.canAcceptDroppedRecords=true;
countryList2.dragDataAction="move";
countryList1.setBorder("2px solid orange");
countryList2.setBorder("2px solid orange");
Edit_Done.setTitle("Done");
} else {
//In non-edit mode (i.e. clicking Done)
countryList1.canDragRecordsOut=false;
countryList1.canAcceptDroppedRecords=false;
countryList2.canDragRecordsOut=false;
countryList2.canAcceptDroppedRecords=false;
countryList1.setBorder("1px solid lightgrey");
countryList2.setBorder("1px solid lightgrey");
Edit_Done.setTitle("Edit");
}
},
}),
isc.ListGrid.create({
ID: "countryList1",
width:300, height:224,
alternateRecordStyles:true,
data: countryData,
fields:[
{name:"countryCode", title:"Flag", width:50, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png"},
{name:"countryName", title:"Country"},
{name:"capital", title:"Capital"}
]
}),
isc.ListGrid.create({
ID: "countryList2",
width:200, height:224,
left:350,
alternateRecordStyles:true,
showAllRecords:true,
fields:[
{name:"countryCode", title:"Flag", width:40, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png"},
{name:"countryName", title:"Country"}
],
emptyMessage: "drop rows here"
})
]
});
Thanks
Stav
I'm using SmartClient 9.1d Enterprise version.
I've been trying to set the canDragRecordsOut and canAcceptDroppedRecords attributes dynamically and perform drag and drop operations between 2 Listgrids. It needs to work on a toggle, where only once you're in "Edit" mode can you perform those operations, and once "Done" you cannot perform those operations.
It doesn't appear that I can set these attributes dynamically and have it work. It doesn't perform any drag and drop between the grids even when I've set these attributes to true on each grid. I need to be able to set these attributes on and off.
The following is a simple illustration of what I'm trying to do. Is there something wrong in the way I'm doing it, or something I'm missing?
isc.HStack.create({
ID: "myStack",
height: 24,
width: 300,
padding: 2,
members: [
isc.IButton.create({
ID: "Edit_Done",
title: "Edit",
width: 50,
click: function() {
if (this.getTitle() !== "Done") {
//In edit mode - must enable dragging of records
countryList1.canDragRecordsOut=true;
countryList1.canAcceptDroppedRecords=true;
countryList1.dragDataAction="move";
countryList2.canDragRecordsOut=true;
countryList2.canAcceptDroppedRecords=true;
countryList2.dragDataAction="move";
countryList1.setBorder("2px solid orange");
countryList2.setBorder("2px solid orange");
Edit_Done.setTitle("Done");
} else {
//In non-edit mode (i.e. clicking Done)
countryList1.canDragRecordsOut=false;
countryList1.canAcceptDroppedRecords=false;
countryList2.canDragRecordsOut=false;
countryList2.canAcceptDroppedRecords=false;
countryList1.setBorder("1px solid lightgrey");
countryList2.setBorder("1px solid lightgrey");
Edit_Done.setTitle("Edit");
}
},
}),
isc.ListGrid.create({
ID: "countryList1",
width:300, height:224,
alternateRecordStyles:true,
data: countryData,
fields:[
{name:"countryCode", title:"Flag", width:50, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png"},
{name:"countryName", title:"Country"},
{name:"capital", title:"Capital"}
]
}),
isc.ListGrid.create({
ID: "countryList2",
width:200, height:224,
left:350,
alternateRecordStyles:true,
showAllRecords:true,
fields:[
{name:"countryCode", title:"Flag", width:40, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png"},
{name:"countryName", title:"Country"}
],
emptyMessage: "drop rows here"
})
]
});
Thanks
Stav