Source and template binding

2 posts, 1 answers
  1. Answer
    Scott
    Scott avatar
    27 posts
    Member since:
    Oct 2007

    Posted 09 Jul 2013 Link to this post

    Dear Sirs,

    My question has to do with the sample referenced below.
    http://demos.kendoui.com/web/mvvm/source.html
    In that example an observable array is created with the following code:
    products: [
    { name: "Hampton Sofa", price: 989.99, unitsInStock: 39 },
    { name: "Perry Sofa", price: 559.99, unitsInStock: 17 },
    { name: "Donovan Sofa", price: 719.99, unitsInStock: 29 },
    { name: "Markus Sofa", price: 839.99, unitsInStock: 3 }
    ]
    I have been working on a similar example where I create a template and then bound the template to
    an observable object using data that I created similar to the above.  That code worked fine.  When I
    tried to create the data from a remote data source using a kendo data source the binding failed. I have looked at the demo where you bind a drop down list to a remote data source
    http://demos.kendoui.com/web/mvvm/remote-binding.html
    Questions:
    1.  Is there an example of how to take  a source and template and bind it to an observable using data from a data source?
    2.  How do you create an observable array from a data source?

    Scott



  2. Scott
    Scott avatar
    27 posts
    Member since:
    Oct 2007

    Posted 09 Jul 2013 Link to this post

    I believe I have found my problem.  I found on one of the post that you need to use data-role( in my example data-role="listview") if you are going to bind data from a data source.  When I made this change it worked.   
Back to Top