Hi Telerik,
This problem might be extremely complicated, or maybe it's extremely trivial and I am overthinking my issues. I've attached a very brief image showing what's happening.
Here's what I've got:
There's a RadListBox on the page which has drag-and-drop enabled. The user drag-and-drops a RadListBoxItem onto the page (their mouse is over a RadDockZone). At this point, I call doPostBack targeting that RadDockZone and create a RadDock on this RadDockZone. Afterwards, I synch all RadDock's ForbiddenZones.
So, there's already one Dock (RadDock1) on a DockZone on the page. The user then drag-and-drops a second time. After this RadDock (RadDock2) is created, and the page is rendered to the user, since RadDock1's DockZone has not been told to update it does not reflect its ForbiddenZones properly.
I've have the above hierarchy of controls on the page. As you can see, when a RadDockZone gains a control, its UpdatePanel handles a partial page-refresh. In this way I handle updating only parts of my page.
So, I am left with this issue. I am trying to keep the amount of work happening on the page to a minimum, but it seems like I have to call update on every DockZone during these scenarios.. which is terrible. Flickering occurs on all the RadDocks.
I call SyncAndUpdate on every dock on the page during the follow scenarios:
All of these have an effect on the 'dockability' of the dock's DockZone. I would like to inform all other DockZones of this change in 'dockability' without flashing the controls.
Is this possible? Is this a place where I should consider using RadXMLHTTPPanel? Do I have other options?
Thanks.
This problem might be extremely complicated, or maybe it's extremely trivial and I am overthinking my issues. I've attached a very brief image showing what's happening.
Here's what I've got:
//When the user drops a RadListBoxItem onto the dashboard we have to figure out
//what RadDockZone the control was dropped onto, rip out information about the event,
//and then pass that data to the server for processing.
function OnClientDropping(sender, eventArgs) {
eventArgs.set_cancel(
true
);
sender.clearSelection();
previousZone =
null
;
var sourceItem = eventArgs.get_sourceItem();
var droppedID = eventArgs.get_htmlElement().id;
if
(droppedID.indexOf(
"RadDockZone"
) != -1) {
var dockZoneDroppedOn = $find(droppedID);
if
(dockZoneDroppedOn.get_docks().length == 0) {
dockZoneDroppedOnID = droppedID;
var eventData = {};
eventData[
"sourceItemText"
] = sourceItem.get_text();
eventData[
"sourceItemValue"
] = sourceItem.get_value();
eventData[
"listBoxID"
] = sender.get_id();
if
(queue.length == 0) {
queue.push(dockZoneDroppedOn._uniqueID);
queue.push(eventData);
__doPostBack(dockZoneDroppedOn._uniqueID, $.toJSON(eventData));
}
else
{
queue.push(dockZoneDroppedOn._uniqueID);
queue.push(eventData);
}
}
}
else
{
dockZoneDroppedOnID =
""
;
}
}
There's a RadListBox on the page which has drag-and-drop enabled. The user drag-and-drops a RadListBoxItem onto the page (their mouse is over a RadDockZone). At this point, I call doPostBack targeting that RadDockZone and create a RadDock on this RadDockZone. Afterwards, I synch all RadDock's ForbiddenZones.
So, there's already one Dock (RadDock1) on a DockZone on the page. The user then drag-and-drops a second time. After this RadDock (RadDock2) is created, and the page is rendered to the user, since RadDock1's DockZone has not been told to update it does not reflect its ForbiddenZones properly.
<
cs:CormantRadPane
ID
=
"RadPane2"
Runat
=
"Server"
BackColor
=
"White"
>
<
nStuff:StyledUpdatePanel
Runat
=
"Server"
ID
=
"UpdatePanel1"
UpdateMode
=
"Conditional"
CssClass
=
"maxHeight"
>
<
ContentTemplate
>
<
cs:CormantRadSplitter
ID
=
"RadSplitter3"
Runat
=
"Server"
Visible
=
"false"
/>
<
cs:CormantRadDockZone
ID
=
"RadDockZone1"
Runat
=
"Server"
/>
</
ContentTemplate
>
</
nStuff:StyledUpdatePanel
>
</
cs:CormantRadPane
>
I've have the above hierarchy of controls on the page. As you can see, when a RadDockZone gains a control, its UpdatePanel handles a partial page-refresh. In this way I handle updating only parts of my page.
So, I am left with this issue. I am trying to keep the amount of work happening on the page to a minimum, but it seems like I have to call update on every DockZone during these scenarios.. which is terrible. Flickering occurs on all the RadDocks.
/// <summary>
/// Shows where docks can/can't be moved. Forbidden zones are all DockZone's with Docks.
/// So, a dock can move to any other dockZone that does not have a control. Those are the allowed zones.
/// Its own spot is allowed so that the highlighting looks correct -- but it is not necessary.
/// </summary>
public
void
SynchForbiddenZones()
{
IEnumerable<CormantRadDockZone> dockZonesWithDocks = LayoutManager.Instance.RegisteredDockZones.Where(dockZone => dockZone.Docks.Any());
ForbiddenZones = dockZonesWithDocks.Select(dockZone => dockZone.ID).ToArray();
Logger.DebugFormat(
"Forbidden zones for dock: {0} are {1}"
, ID, ForbiddenZones);
}
public
void
SyncAndUpdate()
{
SynchForbiddenZones();
GetWrappingUpdatePanel().Update();
}
I call SyncAndUpdate on every dock on the page during the follow scenarios:
- RadDock gets created.
- RadDock position changes.
- RadDock gets closed.
All of these have an effect on the 'dockability' of the dock's DockZone. I would like to inform all other DockZones of this change in 'dockability' without flashing the controls.
Is this possible? Is this a place where I should consider using RadXMLHTTPPanel? Do I have other options?
Thanks.