Adding custom css class to different controls.

3 posts, 0 answers
  1. Seven Spikes
    Seven Spikes avatar
    6 posts
    Member since:
    Oct 2009

    Posted 05 Feb 2013 Link to this post

    Hello,

    We have two plug-ins(Window) on the same page which use the <div class="k-widget k-window"> as a main container.
    Each of the two plug-ins use the same Kendo classes for most of their elements, and currently
    there's no way to style the elements individualy for each plug-in. Obviously we should add
    a specific class to the <div class="k-widget k-window">, so that we could specify each element.
    Could you give us a solution to this problem ?
    Thank you.

    Kind Regards,
    Aleksandar Ivanov
    Nop-Templates.com
  2. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 07 Feb 2013 Link to this post

    Hello Aleksandar,

    Depending on your specific needs, you can do any of the following:

    1. Add a custom class to the element from which the Window is created. This is the element, which wraps all Window custom content (div.k-window-content), so if your idea is to customize the content, this will do and is easier.

    or

    2. Add a custom class to the Window outermost element (div.k-window), which is created on the fly. This is the way to go if you want to customize the appearance of the Window itself. Since the element does not exist initially, you need to use Javascript to add the class in the widget's open event, or alternatively, simply execute the script after Window initialization.


    // after initialization
     
    var winObject = $("#myWindow").kendoWindow().data("kendoWindow");
    winObject.wrapper.addClass("myCustomClass");
     
    // on open event
     
    function onWindowOpen(e) {
        this.wrapper.addClass("myCustomClass");
    }


    All the best,
    Dimo
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Seven Spikes
    Seven Spikes avatar
    6 posts
    Member since:
    Oct 2009

    Posted 07 Feb 2013 Link to this post

    Thanks for the prompt reply! All worked just as it should!

    Best Regards,
    Alexander
Back to Top