newbie Kendo Window content question

6 posts, 0 answers
  1. Kashim
    Kashim avatar
    19 posts
    Member since:
    Dec 2011

    Posted 02 May 2012 Link to this post

    I have 2 questions.


    Question1) Is it possible to initialize/widgetify kendo window content

    eg 
    var mywindow = $("<div/>").kendoWindow({
        width: "300px",
            height: "200px",
            title: "Some title",
            modal: true
    });

    var kendoWindow = mywindow.data("kendoWindow");
    var mycombo = "<input id="comboBox"/>";
    var windowcontent = kendoWindow.content(_mycombo);

    //can i make mycombo into widget ...code below doesnt work gives a jquery error
    $(windowcontent).kendoComboBox({
       dataTextField: "text",
       dataValueField: "value",
       dataSource: [
           { text: "Item1", value: "1" },
           { text: "Item2", value: "2"}]
    });


    Question2) If I have this code

    var myoptions = {a:"some text", b:"more text"};
    var mywindow = $("<div/>").kendoWindow({
        width: "300px",
            height: "200px",
            modal: true,
            title: myoptions.a,
    content:"test.html"
    });

    How do i pass 'myoptions' object into test.html?  (does it have to be a global variable?)

    thanks
    kashim
  2. Kashim
    Kashim avatar
    19 posts
    Member since:
    Dec 2011

    Posted 03 May 2012 Link to this post

    Any ideas?

    Another question - Can we pass a url parameter in with the content html eg

    var mywindow = $("<div/>").kendoWindow({
         ..
    content:"test.html?value=hello"
    }); 

    I tried this but in test.html I haven't figured out what function to use to access 'value=hello'
  3. Kendo UI is VS 2017 Ready
  4. Kashim
    Kashim avatar
    19 posts
    Member since:
    Dec 2011

    Posted 04 May 2012 Link to this post

    Ignore my question.
    Older posts have already answered my question
  5. Dr.YSG
    Dr.YSG avatar
    210 posts
    Member since:
    Dec 2009

    Posted 04 May 2012 Link to this post

    Can you provide a link to the answers from the older posts. I have not found them.

    Also, can you give me a pointer to your dynamic creation of an kendoWindow (without any HTML markup).

    I naively tried this, but it is not working for me: (it says that window is not defined, which is because the kendoWindow does not return the handle to the new window, you need to get it from the DOM $("#whatever") 



    function selectColumns() {
    var window = $("<div/>").kendoWindow({
        width: "300px",
            height: "200px",
            title: "Some title",
            modal: true
    });
    window.center();
    window.open();
    }
  6. Kashim
    Kashim avatar
    19 posts
    Member since:
    Dec 2011

    Posted 04 May 2012 Link to this post

    Sure the links that helped me were

    http://www.kendoui.com/forums/ui/window/how-to-use-the-data-passed-to-a-window.aspx 

    and 
    http://www.kendoui.com/forums/ui/window/how-to-load-window-content-from-partialview.aspx 

    As for your code, you need to do add this
    ..
    var window1 = window.data("kendoWindow");
    window1.center();
    window1.open();

    or 
    window.data("kendoWindow").center();
    window.data("kendoWindow").open(); 
     
  7. Kevin Babcock
    Kevin Babcock avatar
    189 posts
    Member since:
    Mar 2007

    Posted 14 Jun 2013 Link to this post

    Quick tip folks: you can chain your function calls when opening the kendoWindow.

    So this...
    1.// example 1
    2.var widget = $("#my-selector").data("kendoWindow");
    3.widget.center();
    4.widget.open();
    5. 
    6.// example 2
    7.$("#my-selector").data("kendoWindow").center();
    8.$("#my-selector").data("kendoWindow").open();
    ...becomes this...
    1.// example 1
    2.var widget = $("#my-selector").data("kendoWindow");
    3.widget.center().open();
    4. 
    5.// example 2
    6.$("#my-selector").data("kendoWindow")
    7.    .center()
    8.    .open();

    Regards,

    Kevin
Back to Top
Kendo UI is VS 2017 Ready