This is a migrated thread and some comments may be shown as answers.

[Solved] ID, center and draggable functions on javascript window

4 Answers 46 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alvaro
Top achievements
Rank 1
Alvaro asked on 09 Dec 2011, 11:54 AM
I would like to know how to assign an ID to my window generated with javascript. Besides draggable property is not identified (firebug message is: "b.draggable is not a constructor")  and did not center the window. This is the function that creates the window:
function crearModal() {
    var popUp = $.telerik.window.create({
        title: "A title",
        html: "Text",
        contentUrl: "",
        modal: true,
        visible: false,
        resizable: false,
        draggable: true,
        width: 300,
        height: 150
    });
 
    popUp.attr("id", "myId");
    var w = popUp.data("tWindow");
    w.center().open();
}

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 09 Dec 2011, 01:40 PM
Hi Alvaro,

The provided code works correctly on my side. Do you have all scripts required by the Window registered on the page?

Feel free to send a runnable example for local inspection.

Best wishes,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Alvaro
Top achievements
Rank 1
answered on 12 Dec 2011, 09:11 AM
Ok, I needed the script "telerik.draganddrop.min.js".

Thanks!
0
Alvaro
Top achievements
Rank 1
answered on 12 Dec 2011, 09:28 AM
I have another problem ... When I try to close the window I do with the id of the windowwith the following function (it's a confirm window, when you press any button"Yes" "No" has to close the window):
function closeWindow(IdModalWindow) {
    var window = $("#" + IdModalWindow.toString()).data("tWindow");
    window.close();
}

The Id of the window is fine, but firebug displays a message that there is no ID. Can a dynamic Id problem?
0
Alvaro
Top achievements
Rank 1
answered on 12 Dec 2011, 11:28 AM
I have another problem ... When I try to close the window I do with the id of the windowwith the following function (it's a confirm window, when you press any button"Yes" "No" has to close the window):
function closeWindow(IdModalWindow) {
    var window = $("#" + IdModalWindow.toString()).data("tWindow");
    window.close();
}

The Id of the window is fine, but firebug displays a message that there is no ID. Can a dynamic Id problem?

EDIT: I solved the problem, I has passing bad parameters javascript function.
Tags
Window
Asked by
Alvaro
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Alvaro
Top achievements
Rank 1
Share this question
or