PDA

View Full Version : [CLOSED] BeforeNodeDrop listener in Treepanel



speedstepmem4
Oct 09, 2013, 3:47 AM
Hi,

How we can use before node drop function in treepanel listener ?.

Earlier we used the following source,



<ext:ColumnLayout ID="ColumnLayout1" runat="server" FitHeight="true">
<Columns>
<ext:LayoutColumn ColumnWidth="0.400">
<ext:TreePanel ID="treePanelSource" runat="server" RootVisible="false" EnableDD="true"
Mode="Local" AllowLeafDrop="true" AutoScroll="true" Header="false">
<Listeners>
<BeforeNodeDrop Fn="X.beforeDrop" />
</Listeners>
</ext:TreePanel>
</ext:LayoutColumn>
<ext:LayoutColumn ColumnWidth="0.200">
<ext:Panel ID="Panel2" runat="server" Width="40" BodyStyle="background-color: transparent;"
Border="false" Layout="AnchorLayout" Height="340">
<Items>
<ext:Panel ID="Panel3" runat="server" Border="false" BodyStyle="background-color: transparent;"
AnchorVertical="39%" AnchorHorizontal="39%" />
<ext:Panel ID="Panel4" runat="server" Border="false" BodyStyle="padding:5px;background-color: transparent;"
AnchorVertical="61%">
<Items>
<ext:Button ID="btn_moveright" runat="server" IconCls="move-right" StyleSpec="margin-bottom:2px;"
Width="90">
<Listeners>
<Click Delay="1" Handler="X.add(treePanelSource, treePanelDestination);" />
</Listeners>
</ext:Button>
<ext:Button ID="btn_moveleft" runat="server" IconCls="move-left" StyleSpec="margin-bottom:2px;"
Width="90">
<Listeners>
<Click Delay="1" Handler="X.remove(treePanelSource, treePanelDestination);" />
</Listeners>
</ext:Button>
</Items>
</ext:Panel>
</Items>
</ext:Panel>
</ext:LayoutColumn>
<ext:LayoutColumn ColumnWidth="0.400">
<ext:TreePanel ID="treePanelDestination" runat="server" RootVisible="false" UseArrows="true"
AutoScroll="true" Animate="false" EnableDD="true" Mode="Local" AllowLeafDrop="true"
ContainerScroll="true" Header="false">
<Listeners>
<BeforeNodeDrop Fn="X.beforeDrop" />
<Click Delay="1" Handler="if(editFlag) imgEditProp.setDisabled(false);" />
</Listeners>
</ext:TreePanel>
</ext:LayoutColumn>
</Columns>
</ext:ColumnLayout>



Note: Most of the breaking changes are missed in changes log and breaking changes log. is there any updated document available?

Daniil
Oct 09, 2013, 3:58 AM
Hi @speedstepmem4,

The breaking change #81 is related to the problem.


81. The TreePanel's drag@drop related properties have been removed: EnableDD, EnableDrag, EnableDrop, AllowLeafDrop, DDAppendOnly, DDGroup, DDScroll, ContainerScroll. Configure a TreeViewDragDrop plugin for a TreePanel's View.
http://examples2.ext.net/#/TreePanel/Basic/Reorder_Nodes/ (http://examples2.ext.net/#/TreePanel/Basic/Reorder_Nodes/)
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.tree.plugin.TreeViewDragDrop (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.tree.plugin.TreeViewDragDrop)

I updated it with a new sentence:

BeforeDrop and Drop events are available in a TreeView.

I think you can use the BeforeDrop event instead of the BeforeNodeDrop in v1.



Note: Most of the breaking changes are missed in changes log and breaking changes log. is there any updated document available?

Yes, unfortunately, many ones have been missed. No other document is available.

Here are my best thoughts regarding migration.
http://forums.ext.net/showthread.php?18358&p=79239&viewfull=1#post79239

speedstepmem4
Oct 11, 2013, 4:47 AM
Hi @speedstepmem4,

The breaking change #81 is related to the problem.


I updated it with a new sentence:


I think you can use the BeforeDrop event instead of the BeforeNodeDrop in v1.



Yes, unfortunately, many ones have been missed. No other document is available.

Here are my best thoughts regarding migration.
http://forums.ext.net/showthread.php?18358&p=79239&viewfull=1#post79239

Hi Daniil,

Drop and BeforeDrop event is not available in Treepanel listener.

How can we use the drop event in TreePanel?

Daniil
Oct 11, 2013, 8:56 AM
They are a TreeView's events.

<ext:TreePanel runat="server">
<View>
<ext:TreeView>
<Listeners>
<BeforeDrop Handler="" />
<Drop Handler="" />
</Listeners>
</ext:TreeView>
</View>
</ext:TreePanel>