ModalView and query parameters

5 posts, 0 answers
  1. Alex Smith
    Alex Smith avatar
    17 posts
    Member since:
    Dec 2009

    Posted 05 Nov 2013 Link to this post

    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?

  2. Petyo
    Admin
    Petyo avatar
    2438 posts

    Posted 07 Nov 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Craig
    Craig avatar
    43 posts
    Member since:
    Aug 2013

    Posted 07 Nov 2013 Link to this post

    Petyo, Example Please!
  5. Petyo
    Admin
    Petyo avatar
    2438 posts

    Posted 08 Nov 2013 Link to this post

    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!
  6. Mick
    Mick avatar
    1 posts
    Member since:
    May 2012

    Posted 26 Jun 2014 in reply to Petyo Link to this post

    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.
Back to Top
Kendo UI is VS 2017 Ready