Dec 01, 2011, 2:39 PM
[CLOSED] [1.2] Switch panels?
Hello,
If you run the below example and click on the "Move Up" button for the Field 2; I was thinking it would move the Field 2 above the Field 1 panel. However, it appears the .insert method on the FieldSet method does not move it? If you click the button again, it will tell you that the index is now 0.
Any suggestions? This has been bugging me for a bit now :(
Appreciate any assistance.
Timothy
If you run the below example and click on the "Move Up" button for the Field 2; I was thinking it would move the Field 2 above the Field 1 panel. However, it appears the .insert method on the FieldSet method does not move it? If you click the button again, it will tell you that the index is now 0.
Any suggestions? This has been bugging me for a bit now :(
Appreciate any assistance.
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Example</title>
<ext:ResourcePlaceHolder ID="ResourcePlaceHolder" runat="server" />
</head>
<body>
<ext:ResourceManager ID="ResourceManager" runat="server" ScriptMode="Debug" StateProvider="Cookie" Theme="Gray" />
<ext:Viewport runat="server">
<Items>
<ext:Panel ID="FieldSet" runat="server"
Border="false">
<Items>
<ext:Panel ID="Parent1" runat="server">
<Items>
<ext:Panel ID="Field1" runat="server"
Border="false">
<TopBar>
<ext:Toolbar runat="server">
<Items>
<ext:ToolbarFill runat="server" />
<ext:Button runat="server"
StandOut="true"
Text="Move Up">
<Listeners>
<Click
Buffer="300"
Handler="
"
/>
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Content>
Field 1
</Content>
</ext:Panel>
</Items>
</ext:Panel>
<ext:Panel ID="Parent2" runat="server">
<Items>
<ext:Panel ID="Field2" runat="server"
Border="false">
<TopBar>
<ext:Toolbar runat="server">
<Items>
<ext:ToolbarFill runat="server" />
<ext:Button runat="server"
StandOut="true"
Text="Move Up">
<Listeners>
<Click
Buffer="300"
Handler="
var index = FieldSet.items.indexOf(#{Field2}.ownerCt);
alert(index);
FieldSet.insert(0, FieldSet.getComponent(index));
FieldSet.doLayout();
"
/>
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Content>
Field 2
</Content>
</ext:Panel>
</Items>
</ext:Panel>
</Items>
</ext:Panel>
</Items>
</ext:Viewport>
</body>
</html>
Cheers,Timothy
Last edited by Daniil; Dec 01, 2011 at 4:22 PM.
Reason: [CLOSED]