PDA

View Full Version : [CLOSED] Dynamically Adding DragZones



ATLAS
Oct 10, 2013, 3:29 PM
I have a page working with static defined dragzones.

I am trying to get this to dynamically add the dragzones with no success - so far I have


@{
var countItem = 0;

foreach (var cu in model.OptionalCompetencyUnitGroups)
{
var unitName = "={#{CU_SELECT_ID" + countItem + "}.getEl()}";
var unitNameDom = "={#{CU_SELECT_ID" + countItem++ + "}.body.dom}";
var groupie = "units" + countItem;
Html.X().DragZone()
.Target(unitName)
.Group(groupie)
.GetDragData(h => h.Fn = "fnGetDragData")
.GetRepairXY(h => h.Fn = "fnGetRepairXY");

Html.X().DropTarget()
.ID("DT"+groupie)
.Target(unitNameDom)
.Group("selected0")
.NotifyDrop(h => h.Fn = "fnNotifyDropTakeBackPanel");
}


I have also tried creating a container and adding the DragZone/DropTages in - but it provides a blank page with no errors

Any suggestions?

Thanks

ATLAS
Oct 10, 2013, 3:45 PM
Fixed you can close this - the DragZone have to be in @( ) now working


I have a page working with static defined dragzones.

I am trying to get this to dynamically add the dragzones with no success - so far I have


@{
var countItem = 0;

foreach (var cu in model.OptionalCompetencyUnitGroups)
{
var unitName = "={#{CU_SELECT_ID" + countItem + "}.getEl()}";
var unitNameDom = "={#{CU_SELECT_ID" + countItem++ + "}.body.dom}";
var groupie = "units" + countItem;
Html.X().DragZone()
.Target(unitName)
.Group(groupie)
.GetDragData(h => h.Fn = "fnGetDragData")
.GetRepairXY(h => h.Fn = "fnGetRepairXY");

Html.X().DropTarget()
.ID("DT"+groupie)
.Target(unitNameDom)
.Group("selected0")
.NotifyDrop(h => h.Fn = "fnNotifyDropTakeBackPanel");
}


I have also tried creating a container and adding the DragZone/DropTages in - but it provides a blank page with no errors

Any suggestions?

Thanks