[CLOSED] Note Right Align

  1. #1

    [CLOSED] Note Right Align

    Hi,

    I need NoteAlign="right" how to do this.. There is no property for Note to align right.

    <ext:TextField runat="server" Note="Simple note" />
    Last edited by Daniil; May 22, 2013 at 3:05 PM. Reason: [CLOSED]
  2. #2

    RE: [CLOSED] Note Right Align

    Hi speedstep,

    You can use css to right-align the note. I was able to right-align the note by wrapping the note in a .

    Example

    <ext:TextField 
        ID="TextField1" 
        runat="server" 
        FieldLabel="Test"
        Note="<div style='text-align:right;'>Simple note
    " 
        />
    Hope this helps.

    Geoffrey McGill
    Founder
  3. #3
    Thanks for the tip. Unfortunately I find it no longer works (at least not with a date picker). One thing I was able to do, however, using the inspector in Chrome and Firebug was figure out a possible alternative:

    The note is wrapped by a div with a class of x-field-note, so by default as a block level element this will cause its contents to appear on the next line which is what now happens. So in CSS, I was able to target my particular instance of x-field-note (for me certain date pickers where I have a note to the right), and use CSS similar to this:

    .my-date-field .x-field-note {
        position: absolute;
        left: 105px; /* this depends on if you know the width of your field; if not, you will need to find an alternative solution unfortunately */
        top: 3px; /* this depends on your font sizes, but 3px aligns it a bit better with the text in the field */
    }
    I haven't tested on IE6 yet, but hope that helps.

    Also wonder if that is something the Ext.NET team have a suggestion for? I don't think there is a fully CSS-only way to force the note to the right; you would need to run some JS to get the component width and set the "left" value to that with plus any comfortable padding/spacing that is needed.

    Here's a full sample to see the various effects:

    <%@ Page Language="C#" %>
    <!DOCTYPE html>
    <html>
        <head runat="server">
            <title>Right aligned field note tests</title>
            <style>
                .my-date-field .x-field-note{
                    position: absolute;
                    left: 105px;
                    top: 3px;
                }
            </style>
        </head>
        <body>
            <ext:ResourceManager runat="server" />
            
            <ext:FormPanel runat="server" Width="400" PaddingSummary="5">
                <Items>
                    <ext:TextField
                        runat="server"
                        FieldLabel="Text field"
                        Note="<div style='text-align:right;'>Simple note</div>"
                        />
                    
                    <ext:DateField
                        runat="server"
                        FieldLabel="Date field"
                        Note="Simple note"
                        />
    
    
                    <ext:DateField
                        runat="server"
                        CtCls="my-date-field"
                        FieldLabel="Date field"
                        Note="Right-aligned note"
                        Width="100"
                        />
                </Items>
            </ext:FormPanel>
        </body>
    </html>
    P.S. As this was a previously closed thread, let me know if I should paste this comment into a new thread.

    Thanks!
  4. #4
    Hi Anup,

    What about to use IndicatorText?

    Example
    <ext:DateField
        runat="server"
        FieldLabel="Date field"
        IndicatorText="Test"
        IndicatorCls="x-field-note"
        />
  5. #5
    He he... neat trick.

    I completely forgot about about IndicatorText (even though I mentioned it in the book, too :))
  6. #6
    It is hard to recall everything that you mentioned in the book;)

    Do you mind we close the thread?
  7. #7
    Quote Originally Posted by Daniil View Post
    It is hard to recall everything that you mentioned in the book;)
    Agreed :)

    Quote Originally Posted by Daniil View Post
    Do you mind we close the thread?
    Yes. Please do. Thanks.

Similar Threads

  1. [CLOSED] [1.1] FileUploadField Note
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 29, 2013, 10:58 AM
  2. [CLOSED] Note Align Not Working in Composite Field
    By alexkay in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Aug 12, 2010, 9:11 PM
  3. Replies: 3
    Last Post: Jul 08, 2010, 8:48 PM
  4. [CLOSED] CompositeField and Note
    By bethc in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: May 27, 2010, 12:41 PM
  5. Replies: 3
    Last Post: Jul 14, 2009, 7:02 AM

Posting Permissions