Content template with JSON data - how to?

6 posts, 3 answers
  1. Paola
    Paola avatar
    11 posts
    Member since:
    Mar 2015

    Posted 17 Jun 2015 Link to this post

    Hi,

    I need to show a Window with a template as its content; the data will be JSON.

    In other words, I need almost the same code showed in http://docs.telerik.com/kendo-ui/api/javascript/ui/window#configuration-content.template but using the ASP.NET MVC server wrappers. 
    I've searched the documentation, the demos and the forum but without any luck.

    Can you help me with some code, please?

    Thank you.

  2. Answer
    Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 22 Jun 2015 Link to this post

    Hi Paola,

    Currently the MVC wrapper of the Window widget doesn't support the "content.template" option - however you can initialize the widget using JavaScript when you need the option. 

    <div id="dialog">
        <p><strong>This example will not work, unless you define a valid JSON service URL for `content.url`.</p>
        <p>The expected JSON response is:
            <pre>
     
            { username: "...my username here..." }
     
            </pre>
        </strong></p>   
    </div>
     
    <script>
        $("#dialog").kendoWindow({
            content: {
                url: "@(Url.Action("Index", "Home"))",
                dataType: "json",
                iframe: false,
                template: "User name: #= data.username #"
            }
        });
    </script>

    Also you can share your idea at Kendo UI UserVoice to allow other users vote for it. Most voted ideas are included in next Kendo UI releases.

    Regards,
    Vladimir Iliev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Paola
    Paola avatar
    11 posts
    Member since:
    Mar 2015

    Posted 24 Jun 2015 Link to this post

    Thanks for the reply.
    However I am not satisfied because I think UserVoice should be used mainly to propose new functions and widgets and not to collect votes to convince you to implement functions that, in my opinion, should be normal for the server-side wrappers to have.

    I'm quite disappointed that they do not allow you to have the full functionality of the JavaScript counterpart: after all, you pay for them.

  5. Answer
    Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 26 Jun 2015 Link to this post

    Hello Paola,

    You are right. This is an already known problem (logged internally). We have raised its priority so that it gets fixed soon. For an immediate workaround, use the approach provided by my colleague.

    Regards,
    Alex Gyoshev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Paola
    Paola avatar
    11 posts
    Member since:
    Mar 2015

    Posted 14 Dec 2015 Link to this post

    Hi,

    any news about it?

    Best regards.

  7. Answer
    Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 16 Dec 2015 Link to this post

    Hello Paola,

    This functionality is scheduled for the Q1 release in January. You can try it out in the beta release that will be released next week.

    Regards,
    Alex Gyoshev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET MVC is VS 2017 Ready