This is a migrated thread and some comments may be shown as answers.
newbie Kendo Window content question
5 Answers 284 Views
This is a migrated thread and some comments may be shown as answers.
Kashim
Top achievements
Rank 1
Kashim asked on 02 May 2012, 04:30 PM
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

5 Answers, 1 is accepted

Sort by
0
Kashim
Top achievements
Rank 1
answered on 03 May 2012, 11:22 AM
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'
0
Kashim
Top achievements
Rank 1
answered on 04 May 2012, 11:17 AM
Ignore my question.
Older posts have already answered my question
0
Dr.YSG
Top achievements
Rank 2
answered on 04 May 2012, 08:01 PM
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();
}
0
Kashim
Top achievements
Rank 1
answered on 05 May 2012, 12:27 AM
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(); 
 
0
Kevin Babcock
Top achievements
Rank 1
answered on 14 Jun 2013, 01:23 PM
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
Asked by
Kashim
Top achievements
Rank 1
Answers by
Kashim
Top achievements
Rank 1
Dr.YSG
Top achievements
Rank 2
Kevin Babcock
Top achievements
Rank 1
Share this question
or