[CLOSED] Align InfoPanel to element on server side?

  1. #1

    [CLOSED] Align InfoPanel to element on server side?

    Hi.
    I have a server-side method, and I want to show an InfoPanl right below my button element:
    Notify("Test","Test",this.btn.ClientID);

            
    public static void Notify(string title, string content, string element, UI ui = UI.Warning)        { 
                X.Msg.Info(new InfoPanel
                {
                    Title = title,
                    UI = ui,
                    Icon = Icon.Exclamation,
                    AlignmentEl = element + ".el",
                    AlignmentSpec = "t-b", 
                    Html = content
                }).Show(); 
            }
    Always shows in middle of page...
    How I align to an element?
    Last edited by Daniil; Jul 08, 2014 at 5:45 AM. Reason: [CLOSED]
  2. #2
    Hi @rthiney,

    What is the "element" that you pass?

    A full test case is appreciated.
  3. #3
    Can be any form element...

    I call it on the server side..

    So...I'd like to use the InfoPanel, and have it slide under the element passed in..

    Messenger.WarningContext(....)

    I got around it by using the CallOut, but would really rather use the InfoPanel..

    Here is my static class...
        public static class Messenger
        { 
    
    
            #region Warnings
            public static void Warning(string message, string title = "Warning")
            {
                Notify(title, message, UI.Warning, Icon.Error);
            }
            public static void WarningContext(string message, AbstractComponent element, int width = 200, int height = 100)
            {
                Callout(message, element, UI.Warning, Icon.Error, "Warning", width, height);
            }
            public static void WarningTop(string message, string title = "Warning", string queue = "")
            {
                Notify(title, message, UI.Warning, Icon.Error, "", queue);
            }
            public static void WarningModal(string message, string title = "Warning", string queue = "", int width = 200, int height = 100)
            {
                NotifyModal(title, message, UI.Warning, Icon.Error, "", queue, width, height);
            }
            #endregion
    
    
            #region Error
    
    
            public static void Error(string message, string title = "Error")
            {
                Notify(title, message, UI.Danger, Icon.Exclamation);
            }
            public static void ErrorContext(string message, AbstractComponent element, int width = 200, int height = 100)
            {
                Callout(message, element, UI.Danger, Icon.Exclamation, "Error", width, height);
            }
            public static void ErrorTop(string message, string title = "Error", string queue = "")
            {
                Notify(title, message, UI.Danger, Icon.Exclamation, "", queue);
            }
            public static void ErrorModal(string message, string title = "Error", string queue = "", int width = 200, int height = 100)
            {
                NotifyModal(title, message, UI.Danger, Icon.Exclamation, "", queue, width, height);
            }
            #endregion
    
    
            #region Information
    
    
            public static void Info(string message, string title = "Information")
            {
                Notify(title, message, UI.Primary, Icon.Information);
            }
            public static void InfoContext(string message, AbstractComponent element, int width = 200, int height = 100)
            {
                Callout(message, element, UI.Primary, Icon.Information, "Information", width, height);
            }
            public static void InfoTop(string message, string title = "Information", string queue = "")
            {
                Notify(title, message, UI.Primary, Icon.Information, "", queue);
            }
            public static void InfoModal(string message, string title = "Information", string queue = "", int width = 200, int height = 100)
            {
                NotifyModal(title, message, UI.Primary, Icon.Information, "", queue, width, height);
            }
            #endregion
    
    
            #region Success
            public static void Success(string message, string title = "Success")
            {
                Notify(title, message, UI.Success, Icon.Tick);
            }
            public static void SuccessContext(string message, AbstractComponent element, int width = 200, int height = 100)
            {
                Callout(message, element, UI.Success, Icon.Tick, "Success", width, height);
            }
            public static void SuccessTop(string message, string title = "Success", string queue = "")
            {
                Notify(title, message, UI.Success, Icon.Tick, "", queue);
            }
            public static void SuccessModal(string message, string title = "Success", string queue = "", int width = 200, int height = 100)
            {
                NotifyModal(title, message, UI.Success, Icon.Tick, "", queue, width, height);
            }
            #endregion
    
    
    
    
            public static void NotifyModal(string title, string message, UI ui = UI.Warning, Icon icon = Icon.Exclamation, string element = "", string queue = "", int width = 200, int height = 100)
            {
                Notification.Show(new NotificationConfig
                {
                    Title = title,
                    Shadow = true,
                    AutoHide = false,
                    Icon = icon,
                    Modal = true,
                    BringToFront = true,
                    Width = width,
                    Height = height,
                    AlignCfg = new NotificationAlignConfig
                    {
                        ElementAnchor = AnchorPoint.Center,
                        TargetAnchor = AnchorPoint.Center,
                        OffsetY = 0,
                        El = element
                    },
                    ShowFx = new SlideIn { Anchor = AnchorPoint.Top },
                    HideFx = new Ghost { Anchor = AnchorPoint.Top },
                    Html = message
                });
    
    
                //X.Msg.Info(new InfoPanel
                //{
                //    AutoHide = false,
                //    Closable = true,
                //    Width=width,
                //    Height=height,
                //    Title = title,
                //    UI = ui,
                //    Icon = Icon.Error, 
    
    
                //    Anchor="b", 
                //    AlignmentEl = element +".el",
                //    AlignmentSpec = "b", 
                //    Html = message
                //}).Show();
            }
            /// <summary>
            /// Pops up notification window.
            /// </summary>
            /// <param name="title"></param>
            /// <param name="content"></param>
            /// <param name="element"></param>
            public static void Notify(string title, string message, UI ui = UI.Warning, Icon icon = Icon.Exclamation, string element = "", string queue = "")
            {
    
    
                Notification.Show(new NotificationConfig
                {
                    Title = title,
                    Shadow = true,
                    HideDelay = 3000,
                    Icon = icon,
                    BringToFront = true,
                    PinEvent = "mouseover",
                    AlignCfg = new NotificationAlignConfig
                    {
                        ElementAnchor = AnchorPoint.Center,
                        TargetAnchor = AnchorPoint.Center,
                        OffsetY = 10,
                        El = element
                    },
                    ShowFx = new SlideIn { Anchor = AnchorPoint.Top },
                    HideFx = new Ghost { Anchor = AnchorPoint.Top },
                    Html = message
                });
                //X.Msg.Info(new InfoPanel
                //{
                //    Title = title,
                //    UI = ui,
                //    Icon = icon,
                //    Alignment=AnchorPoint.Bottom,
                //    AlignmentEl = element+".el",
    
    
                //    Html = message
                //}).Show(); 
            }
    
    
            public static void Callout(string message, AbstractComponent element, UI ui = UI.Warning, Icon icon = Icon.Exclamation, string title = "Attention", int width = 200, int height = 100)
            {
    
    
                X.Msg.Callout(element, new Callout
                {
                    Title = title,
                    UI = ui,
                    Icon = icon,
                    Html = message,
                    Alignment = AnchorPoint.RightTop,
                    DismissDelay = 5000,
                    CloseAction = CloseAction.Destroy,
                    Height = height,
                    Width = width
                }).Show(true);
            }
        }
    }
    Last edited by geoffrey.mcgill; Jul 03, 2014 at 2:02 PM.
  4. #4
    Hard to say what is going wrong.

    Could you, please, provide a standalone .aspx test case to reproduce the problem?

Similar Threads

  1. Replies: 3
    Last Post: Dec 26, 2011, 1:32 PM
  2. Replies: 1
    Last Post: Dec 01, 2010, 5:14 PM
  3. Replies: 4
    Last Post: Mar 19, 2010, 11:35 AM

Posting Permissions