Can the Notification be positioned within a given container with appendTo

3 posts, 0 answers
  1. Peter
    Peter avatar
    55 posts
    Member since:
    Jan 2014

    Posted 26 Mar 2015 Link to this post


    I have a series of tabs in my interface, and notifications belong in each.
    So for this, I really need to insert my notification into the DOM of the TAB (which has it's own HTML content) - in order to show it "within that area"

    Is this what the "appendTo" method is supposed to be used for?
    I realize it says "Defines the element to which the notifications will be appended or prepended"
    But why would you use it?

    I'm asking because I cannot seem to get appendTo working, when I use it, my notification doesn't appear at all, and I just need a sanity check as to whether I should be bothering to use this to "position" the notification in the first place.
  2. Peter
    Peter avatar
    55 posts
    Member since:
    Jan 2014

    Posted 26 Mar 2015 in reply to Peter Link to this post

    Incidentally, if position property in Notification worked like jQuery's position (which takes an element to position near to, rather than absolute coordinates, then that would probably be perfect.
  3. Dimo
    Dimo avatar
    8431 posts

    Posted 30 Mar 2015 Link to this post

    Hi Peter,

    Yes, the appendTo property of the Notification widget is designed to be used when you want to show the notification messages inside a desired container.

    Note that in this case the messages are not popups, i.e. they are simple static elements rendered where you have specified.

    If the messages do not appear at all, try setting the "autoHideAfter" property to zero, so that they do not disappear, and try to locate them in the DOM via the browser's DOM inspector. There may be some custom CSS styles, which interfere.

    Send a runnable example if you need further assistance with this.


    If you want to use appendTo, and position the notification messages, then you cannot use the widget's position property, but you can still apply custom positioning-related CSS styles to the notification messages (.k-notification elements). However, a more commonsense approach in this scenario is to position the container in which the messages are rendered, instead of the messages themselves.

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top