[CLOSED] Resizable & TextArea Grow="true"

  1. #1

    [CLOSED] Resizable & TextArea Grow="true"

    Hi

    Can you please advise, how to use a TextArea with Grow="true" and Resizable to let the user resize it if necessary?
    As you will be able to see in the example below if the textarea grows, the resizable control does not.

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!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>Resizable &amp; TextAreaGrow</title>
    </head>
    <body>
        <ext:ScriptManager runat="server" />
        <h1>
            Resizable &amp; TextAreaGrow in Markup</h1>
        <ext:TextArea ID="TextAreaDescription" runat="server" FieldLabel="Description" GrowMax="200"
            Grow="true">
            <Listeners>
                <AutoSize Handler="debugger;" />
            </Listeners>
        </ext:TextArea>
        <ext:Resizable ID="CustomResizer" runat="server" Element="={#{TextAreaDescription}.el}"
            Wrap="true" Pinned="false" Handles="SouthEast" Draggable="false" Dynamic="false">
        </ext:Resizable>
    </body>
    </html>
    Thanks

    Leo
  2. #2

    RE: [CLOSED] Resizable & TextArea Grow="true"

    Hi,

    Try the following code
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!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 id="Head1" runat="server">
        <title>Resizable &amp; TextAreaGrow</title>
    </head>
    <body>
        <ext:ScriptManager ID="ScriptManager1" runat="server" />
        <h1>
            Resizable &amp; TextAreaGrow in Markup</h1>
        <ext:TextArea ID="TextAreaDescription" runat="server" FieldLabel="Description" GrowMax="200"
            Grow="true">
            <Listeners>
                <AutoSize Handler="#{CustomResizer}.resizeTo(this.getWidth(), this.getHeight());" />
            </Listeners>
        </ext:TextArea>
        
        <ext:Resizable ID="CustomResizer" runat="server" Element="={#{TextAreaDescription}.el}"
            Wrap="true" Pinned="false" Handles="SouthEast" Draggable="false" Dynamic="false">
            <Listeners>
                <Resize Handler="#{TextAreaDescription}.growMin = height;" />
            </Listeners>
        </ext:Resizable>
    </body>
    </html>
  3. #3

    RE: [CLOSED] Resizable & TextArea Grow="true"

    Hi Vlad,

    Thank you very much for the quick reply.
    That's works like a charm.

    It is not essential for me at this stage, but Is there a way to auto shrink it back when it "ungrow" by deleting characters?
    I mean, in a scenario where resizable is not present, as I edit the text within the textarea and delete lines it shrink the textarea back.

    Once again, thank you very much.
    This thread can now be marked as solved.

    Leo
  4. #4

    RE: [CLOSED] Resizable & TextArea Grow="true"

    Hi,

    If resizable is not presented then shrink back will be performed automatically. For check it, remove resizable control and AutoSize listener
  5. #5

    RE: [CLOSED] Resizable & TextArea Grow="true"

    Hi

    That is exactly what I meant Vlad. I know this is the normal behaviour when Resizable is not present. What I was wondering is if it is possible to perform the same behaviour when Resizable present?

    Just out of curiosity, because, as I mentioned earlier, it is not fundamental for us at this stage.

    vladimir (1/20/2010)Hi,

    If resizable is not presented then shrink back will be performed automatically. For check it, remove resizable control and AutoSize listener
    Thanks

    Leo.
  6. #6

    RE: [CLOSED] Resizable & TextArea Grow="true"

    Hi,

    if it is possible to perform the same behaviour when Resizable present?

    Hmm... Such behaviour will raise conflict between resizable control and textarea. For example, you resize textarea and strart typing, textarea will decrease height of textarea (because it is greater than required). In this case resizable control has no size because textarea will cancel its resiazing always after typing

    You can see that behaviuor removing Resize listener from Resizable control
  7. #7

    RE: [CLOSED] Resizable & TextArea Grow="true"

    Hi,

    Yeah, I thought so...
    Anyway, thank you for your willingness to clarify all doubts.


    this now can be marked as solved.


    Leo.

Similar Threads

  1. [CLOSED] DropDownField with Grow="true" and GrowMax="xxx"
    By deejayns in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 12, 2012, 12:00 PM
  2. Replies: 1
    Last Post: Oct 07, 2011, 8:34 AM
  3. [CLOSED] TextArea - Grow to early.
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 06, 2011, 9:43 PM
  4. [CLOSED] [1.0] Combobox Grow property; Textfield Grow
    By betamax in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 03, 2010, 8:01 PM
  5. Replies: 1
    Last Post: Mar 17, 2010, 7:39 AM

Posting Permissions