Hello everyone, I would like to override the close() function of a modalView. What I need is to do something first before it closes.
Here is what I am trying to do:
var modalView = $("#modalview-menu").data("kendoMobileModalView");
modalView.close = function () {
// do something...
...
// then close it.
}
Thanks!
Here is what I am trying to do:
var modalView = $("#modalview-menu").data("kendoMobileModalView");
modalView.close = function () {
// do something...
...
// then close it.
}
Thanks!
4 Answers, 1 is accepted
0
Hi Relvis,
In the next major release, which is scheduled for end of March, we plan to introduce init, open and close events for the Modal View widget.
Meanwhile you can use the following approach:
Please note that depending on the implementation, changing the widgets' API may lead to unexpected side effects which is why we do not support such custom solutions.
Regards,
Alexander Valchev
the Telerik team
In the next major release, which is scheduled for end of March, we plan to introduce init, open and close events for the Modal View widget.
Meanwhile you can use the following approach:
var
modalview = $(
"#modalview-login"
).data(
"kendoMobileModalView"
);
var
closeOrigin = modalview.close;
modalview.close =
function
() {
//do stuff
closeOrigin.call(m);
}
Please note that depending on the implementation, changing the widgets' API may lead to unexpected side effects which is why we do not support such custom solutions.
Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Anton
Top achievements
Rank 1
answered on 28 Feb 2013, 05:43 AM
Hi Alexander -
In your sample code, what is the 'm' in closeOrigin.call(m)?
I tried doing this for the show() method of kendoMobileLoader but I'm getting an error when I call the original show().
0
Hello Anton,
Please accept my apology for the inconvenience caused.
The 'm' is the modalview. The correct code is:
Regards,
Alexander Valchev
the Telerik team
Please accept my apology for the inconvenience caused.
The 'm' is the modalview. The correct code is:
var
modalview = $(
"#modalview-login"
).data(
"kendoMobileModalView"
);
var
closeOrigin = modalview.close;
modalview.close =
function
() {
//do stuff
closeOrigin.call(modalview);
}
Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Anton
Top achievements
Rank 1
answered on 01 Mar 2013, 07:19 AM
Thanks Alexander! No inconvenience caused at all. I wonder why I hadn't thought of using 'modalview' in place of the 'm'.
Anyway, it's all working now! Thanks a bunch!
Anyway, it's all working now! Thanks a bunch!