This question is locked. New answers and comments are not allowed.
Hi
I've been playing with the Window component. In a single View I need 2 modal windows: one will show an 'add new item' form, and the other one will display an 'edit item' form. Both should be opened from links. And problems started :)
1) If I create the 1st one server-side, and just use the open client API, then the 2nd never displays the overlay. In addition, the center() function, when called via the client API, is just a bit wrong. Calling .Center() in the server-side fluent interface works OK.
2) The 2nd one can't be created server-side, because its contents depend on the 'item' being clicked, and I don't see any client-API method equivalent to LoadContentFrom. I inspected the telerik.window.js code before posting.
So I decided to create both client-side on the fly, and here are the problems:
1) If I don't declare any server-side Window object, the $.telerik.window JS code is not loaded at all, so $.telerik.window doesn't exist.
2) If I declare a dummy hidden window in order to get the JS library loaded, the overlay problem still exists. I've noticed that the FIRST modal window works, but after closing it, the following will be non-modal.
I've been trying to solve this for some time now, anyone have idea before I quit and use another Dialog component from the dozens available online? :)
Here's my code anyway:
Edit: I'm using the 2010 Q2 2010 Beta extensions, of course. :) Apart from this everything else is *great*
Thanks, best regards.
I've been playing with the Window component. In a single View I need 2 modal windows: one will show an 'add new item' form, and the other one will display an 'edit item' form. Both should be opened from links. And problems started :)
1) If I create the 1st one server-side, and just use the open client API, then the 2nd never displays the overlay. In addition, the center() function, when called via the client API, is just a bit wrong. Calling .Center() in the server-side fluent interface works OK.
2) The 2nd one can't be created server-side, because its contents depend on the 'item' being clicked, and I don't see any client-API method equivalent to LoadContentFrom. I inspected the telerik.window.js code before posting.
So I decided to create both client-side on the fly, and here are the problems:
1) If I don't declare any server-side Window object, the $.telerik.window JS code is not loaded at all, so $.telerik.window doesn't exist.
2) If I declare a dummy hidden window in order to get the JS library loaded, the overlay problem still exists. I've noticed that the FIRST modal window works, but after closing it, the following will be non-modal.
I've been trying to solve this for some time now, anyone have idea before I quit and use another Dialog component from the dozens available online? :)
Here's my code anyway:
<script type=
"text/javascript"
>
//Called from a button link to add a new item
function
openAddForm(idfactura) {
var
windowElement = $.telerik.window.create({
name:
"AddItem"
,
title:
"AƱadir detalle"
,
contentUrl:
'/DetalleFacturas/Create/'
+ idfactura,
modal:
true
,
resizable:
false
,
draggable:
false
});
windowElement.data(
"tWindow"
).center();
return
false
;
}
//called from each of the items link to open the edit form
function
openEditItemForm(idfactura, iditem) {
var
windowElement = $.telerik.window.create({
name:
"EditItem"
,
title:
"Editar detalle"
,
contentUrl:
'/DetalleFacturas/Edit/'
+ idfactura +
'/'
+ iditem,
modal:
true
,
resizable:
false
,
draggable:
false
});
windowElement.data(
"tWindow"
).center();
return
false
;
}
</script>
Edit: I'm using the 2010 Q2 2010 Beta extensions, of course. :) Apart from this everything else is *great*
Thanks, best regards.