This is a migrated thread and some comments may be shown as answers.

Bug with multiple VM's on single page, grid creating multiple div's for k-grid-content

0 Answers 48 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Alvaro
Top achievements
Rank 1
Alvaro asked on 28 May 2012, 07:16 AM
Hi, 

I have an app that is divided into several parts...to make it simple, let's just consider a menu and a main area. 

My menu is created on my main layout file. So I have a kendo.bind(document.body,mainVM) on this page.

My main area has another kendo.bind(document.body,areaVM) 

Usually I have a grid on my main area, and because I want to format it nicely, I call the grid.kendoGrid() function on it. 

This makes the MVVM go crazy, because it can't track anymore which elements are bound to which vm (mainVM or areaVM). 

My grid also goes crazy, as it creates two divs for content, making the layout really bizarre. 

I have created a jsfiddle that reproduces the scenario described above. http://jsfiddle.net/aoliveira/WTuYX/2/

I do know that I could fix that by just scoping my kendo.bind call to the given area, but I would like to have at least my mainVM be boud to document.body and have my areaVM boud to some area div...but that seems to create problems also.

So the questions are :

1 - Will there be any way for kendo mvvm to track what is bound to what ?
2 - Is using bind on document.body completely wrong ?


Thanks, 

Alvaro Oliveira.





No answers yet. Maybe you can help?

Tags
MVVM
Asked by
Alvaro
Top achievements
Rank 1
Share this question
or