I'm in the midst of writing a single page application with routes. The way the application functions is:
- DataSource with list of items is bound to a Kendo Grid
- User clicks an item on the Grid and is taken to a new route which contains the ID of the item the user selected. Example: www.mydomain.com/#itemID=1
- This ID is used in a DataSource to refresh the item the user chose. This is also done in case the user bookmarks the specific route. In such an event the Grid can be bypassed.
The binding of the Grid works great and I'm able to capture the ID of the chosen item and redirect to my new route. I'm also able to create a new datasource with the ID of the item selected and return data from the server.
Here's where I'm stuck. I'm trying to bind the returned record to HTML controls using an MVVM pattern, but it seems the Kendo binding context assumes that DataSource is a collection (where in my case it's a single record). What is the correct approach for this? Is there a way to bind controls in a DIV to a single record in a DataSource?
Here's where I'm stuck. I'm trying to bind the returned record to HTML controls using an MVVM pattern, but it seems the Kendo binding context assumes that DataSource is a collection (where in my case it's a single record). What is the correct approach for this? Is there a way to bind controls in a DIV to a single record in a DataSource?