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

ModalView and query parameters

4 Answers 95 Views
ModalView
This is a migrated thread and some comments may be shown as answers.
Alex Smith
Top achievements
Rank 1
Alex Smith asked on 05 Nov 2013, 10:50 PM
I know this is possible with your typical view, but perhaps this is not supported by modal views?

I am trying to open a modal view with a query param like:
<a data-rel="modalview" href="#myModalView?someParam=123" data-role="button">Open MV </a>
However when I click on the link/button I get this error:
Uncaught Error: Syntax error, unrecognized expression: #myModalView?someParam=123

Is this unsupported on Modal Views?

4 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 07 Nov 2013, 04:05 PM
Hi Alex,

Query string parameters are not supported for modalviews. However, you may add the additional information as a data attribute to the A element and access it in the modalview open event handler.

Regards,
Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Craig
Top achievements
Rank 1
answered on 07 Nov 2013, 07:08 PM
Petyo, Example Please!
0
Petyo
Telerik team
answered on 08 Nov 2013, 02:45 PM
Hi Craig,

the help topic which I linked to features an example of the open event handling. After you obtain the element, you can use jQuery attr in order to retrieve its attribute values.  

Regards,
Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Mick
Top achievements
Rank 2
answered on 26 Jun 2014, 11:44 PM
What worked best for me was setting a "data-action" attribute and "data-actionparameters" attribute a submit button residing on the modalview itself.  Those attributes can be set when the view is open and shown, and they can be consumed when the button is clicked prior to closing the modal view.  That way for example, a "login" modal view requiring a password could be used ahead or in the middle of very different application activities.
Tags
ModalView
Asked by
Alex Smith
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Craig
Top achievements
Rank 1
Mick
Top achievements
Rank 2
Share this question
or