Setting Column Values to an array in my view model - using MVVM

5 posts, 0 answers
  1. Jay
    Jay avatar
    48 posts
    Member since:
    Dec 2011

    Posted 22 May 2017 Link to this post

    Hi, we are using MVVM as much as possible in all of our KendoUI Implementations.  We've run into what seems to be a limitation of the Grid control.  The MVVM support for the column values field does not appear to support view model binding.  I am not able to reference arrays or data sources in the view model while creating the view. Here's a link to my jsFiddle that illustrates the issue.

    If you remove "values: dsStatus" from the HTLM code for the status column, the grid instantiates just fine.  With it in there, an error is raised that dsStatus could not be found.  Any help with this that does not require me abandoning the MVVM pattern and instantiating the grid via javascript would be greatly appreciated.

  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    2062 posts

    Posted 24 May 2017 Link to this post

    Hello Jay,

    I am afraid that such syntax is not valid and the data-columns should be defined as plain JSON object. The values can be set to a global object as shown in the http://dojo.telerik.com/OVILE example, but they can not be part of the view model. 

    Regards,
    Boyan Dimitrov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Jay
    Jay avatar
    48 posts
    Member since:
    Dec 2011

    Posted 24 May 2017 in reply to Boyan Dimitrov Link to this post

    Thanks for your reply.  That will work as a work around.  However, it's quite odd that everything else in the KendoUI MVVM implementation binds against the view model.  As you know, it's generally considered poor practice to rely on global variables in your applications and yet that's our only option in this case.  It seems that this is an oversight and should be addressed at some point?

    How would I go about making the suggestion formally?

  4. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 26 May 2017 Link to this post

    Hi Jay,

    You could create a feature request in our public portal, where other developers can vote for it and increase its priority:

    Best Regards,
    Konstantin Dikov
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Jay
    Jay avatar
    48 posts
    Member since:
    Dec 2011

    Posted 26 May 2017 in reply to Konstantin Dikov Link to this post

    Will do, thanks!
Back to Top