[FIXED] [#269] [2.x] how to add window's item from session to another window's item?

Page 2 of 3 FirstFirst 123 LastLast
  1. #11
    eg:

    1. Select 3 => a, b, c
    2. A user types in some field within the b, the close the pop window.
    3. Select 3 => a, b (the typed text persists),c
    4. close the pop window.
    5. select 2=> a,b (the typed text persists)
    6.close the pop winodw.
    7. select 5=>a,b(the typed text persists),c1,d,e(c1 is different c becuase the step 6)
  2. #12
    Thank you, it gets clearer.

    But I am not sure that I understand this:

    Quote Originally Posted by tobros View Post
    6.close the pop winodw.
    7. select 5=>a,b(the typed text persists),c1,d,e(c1 is different c becuase the step 6)
    "c1 is different c". Well, is there a scenario when you will need the initial "c", which is generated in the step 3?
  3. #13
    Quote Originally Posted by tobros View Post
    eg:

    1. Select 3 => a, b, c
    2. A user types in some field within the b, the close the pop window.
    3. Select 3 => a, b (the typed text persists),c
    4. close the pop window.
    5. select 2=> a,b (the typed text persists)
    6.close the pop winodw.
    7. select 5=>a,b(the typed text persists),c1,d,e(c1 is different c becuase the step 6)
    Quote Originally Posted by Daniil View Post
    Thank you, it gets clearer.

    But I am not sure that I understand this:



    "c1 is different c". Well, is there a scenario when you will need the initial "c", which is generated in the step 3?
    yes , the step 3, because user select 3, so the pop window in which there is 3 panels a,b,c .it's time create panels and textfields in it.

    in step 5,because user select 2 , then pop window.so it's time to destory panel c.
    Last edited by tobros; Jun 07, 2013 at 12:57 AM.
  4. #14
    Please look at this example.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        private Ext.Net.Panel GetPanel(int index)
        {
            return new Ext.Net.Panel()
            {
                Title = "Panel " + index,
                Items = 
                {
                    new TextField() { FieldLabel = "TextField1" },   
                    new TextField() { FieldLabel = "TextField2" }
                }
            };
        }
    
        protected void NumberField1_IconClick(object sender, DirectEventArgs e)
        {
            int currentCount = int.Parse(e.ExtraParams["currentCount"]);
            int neededCount = (int)this.NumberField1.Number;
            int panelsToAdd = neededCount - currentCount;
    
            if (panelsToAdd > 0)
            {
                for (int i = 1; i <= panelsToAdd; i++)
                {
                    this.GetPanel(i + currentCount).AddTo(this.Window1);
                }
            }
            else if (panelsToAdd < 0)
            {
                X.Js.Call("removeFrom", this.Window1.ConfigID, -panelsToAdd, currentCount);
            }
    
            this.Window1.Show();
        }
    </script>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    
        <script>
            var removeFrom = function (win, countToRemove, totalCount) {
                win = App[win];
    
                var items = win.items;
    
                Ext.suspendLayouts();
                for (var i = 1; i <= countToRemove; i++) {
                    win.remove(items.getAt(totalCount - i));
                }
    
                Ext.resumeLayouts(true);
            };
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:NumberField ID="NumberField1" runat="server" Icon="Add">
                <DirectEvents>
                    <IconClick OnEvent="NumberField1_IconClick">
                        <ExtraParams>
                            <ext:Parameter Name="currentCount" Value="App.Window1.items.getCount()" Mode="Raw" />
                        </ExtraParams>
                    </IconClick>
                </DirectEvents>
            </ext:NumberField>
    
            <ext:Window 
                ID="Window1" 
                runat="server" 
                Width="300" 
                Height="300" 
                Hidden="true"
                Layout="AccordionLayout" />
    
        </form>
    </body>
    </html>
  5. #15
    Attached Thumbnails Click image for larger version. 

Name:	1.png 
Views:	10 
Size:	78.1 KB 
ID:	6332  
    Last edited by tobros; Jun 07, 2013 at 6:36 AM.
  6. #16
    I cannot reproduce. Could you update from the SVN trunk and retest?
  7. #17
    Quote Originally Posted by Daniil View Post
    I cannot reproduce. Could you update from the SVN trunk and retest?
    update version , now is ok.
    but some little bug
    select 3, pop window , then fill sth in textfield in panel1, and panel1. then decrease 3 to 1, then pop window , there is only one panel , but the panel is blank. there are no textfields in it , maybe a bug?
    plz see screenshot
    http://screencast.com/t/RxPPmTsy
  8. #18
    I can't reproduce again. Please clarify what is the Ext.NET version you updated to?
  9. #19
    Quote Originally Posted by Daniil View Post
    I can't reproduce again. Please clarify what is the Ext.NET version you updated to?
    Ext.Net version 2.2.0.40838
  10. #20
    I could reproduce this issue. Try to use the following:

    var removeFrom = function (win, countToRemove, totalCount) {
    	win = App[win];
    
    	var items = win.items;
    
    	Ext.suspendLayouts();
    	for (var i = 1; i <= countToRemove; i++) {
    		win.remove(items.getAt(totalCount - i));
    	}
    
    	Ext.resumeLayouts(true);
    	
    	if (win.items.length > 0)
    		win.items.first().getBody().el.setVisible(true);
    };
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. [CLOSED] asp:datalist inside ext window item.count always zero
    By Tonic in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 15, 2013, 12:49 PM
  2. Replies: 4
    Last Post: Jan 21, 2013, 7:23 AM
  3. Replies: 17
    Last Post: Dec 17, 2012, 11:58 AM
  4. [CLOSED] Always selected Item is nothing for combobox as menu item
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 04, 2011, 4:51 PM
  5. Replies: 1
    Last Post: Jun 01, 2009, 5:15 PM

Posting Permissions