smartdevkz / dropthings

Automatically exported from code.google.com/p/dropthings
0 stars 0 forks source link

After deleting a widget on a zone, widgets can't be dropped on this zone anymore #58

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add 1 or more widgets on several zones
2. Delete a widget from a zone
3. Try to drag a widget from an other zone and drop it into the one where 
you deleted a widget

What is the expected output? What do you see instead?
I expect to have the possibility to move widgets from a zone to an other, 
even if I previously deleted a widget on this zone before.

What version of the product are you using? On what operating system?
Version 2.4 on WinXP SP3

Please provide any additional information below.
I think that the zone is not properly refreshed after the deletion of a 
widget.
I saw this code in WidgetInstanceZone.ascx.cs :

    private void RefreshZoneUpdatePanel()
    {
        this.WidgetZoneUpdatePanel.Update();

//ScriptManager.RegisterStartupScript(this.WidgetHolderPanelTrigger, 
this.WidgetHolderPanelTrigger.GetType(), this.ClientID + "_InitWidgets" + 
DateTime.Now.Ticks.ToString(),
        //        "$(document).ready(function() {" + 
"DropthingsUI.refreshSortable('{0}');"
        //        .FormatWith(this.WidgetPanel.ClientID) + "});", true);
    }

but refreshSortable doesn't exist anymore.
I saw Issues 12 and tried to fix this bug by following that way, but I 
couldn't.

Original issue reported on code.google.com by nourdine...@gmail.com on 11 Feb 2010 at 4:29

GoogleCodeExporter commented 8 years ago

Original comment by glope...@gmail.com on 15 Feb 2010 at 3:05

GoogleCodeExporter commented 8 years ago
After deleting a widget on a column, sortable and draggable objects which were 
link 
to that column are not connected anymore. I think that something happens due to 
the 
update event of the UpdatePanel, but I don't understand what. Anyway... I found 
a 
solution, but I don't know if it's the right way or just a patch. If someone 
have a 
better answer... :)

Because of the lost of the connexion between the concerned column and the 
others 
objects, I had to set again connectWith and connectToSortable properties.

In WidgetInstanceZone.ascx.cs :

private void Widget_Deleted(WidgetInstance wi, IWidgetHost host)
{
  if (host is Control)
    this.WidgetHolderPanel.Controls.Remove(host as Control);
  this.RefreshZoneUpdatePanel();

  ScriptManager.RegisterStartupScript(
    this.WidgetHolderPanelTrigger,
    this.WidgetHolderPanelTrigger.GetType(), 
    this.ClientID + "_InitConnectProperties" + DateTime.Now.Ticks.ToString(),
    "jQuery(document).ready(function() {{ refreshConnectWith(); }});", 
    true);
}

and the JavaScript function :

function refreshConnectWith() {
  $('.new_widget').draggable('option', 'connectToSortable', '.widget_zone');
  $('.widget_zone').sortable('option', 'connectWith', '.widget_zone');
}

With that, I can drop widgets from sortable columns or the widget list into a 
column 
where a widget was previously deleted.

Original comment by nourdine...@gmail.com on 16 Feb 2010 at 8:52

GoogleCodeExporter commented 8 years ago
Fixed in v2.5.2

Original comment by omaralzabir@gmail.com on 18 Apr 2010 at 10:48