# Color Chooser Illustrates ViewModel Hierarchy Questions

**URL:** <https://forums.bitovi.com/t/color-chooser-illustrates-viewmodel-hierarchy-questions/938>\
**Category:** CanJS\
**Created:** [July 27, 2018, 7:46pm UTC](https://forums.bitovi.com/t/color-chooser-illustrates-viewmodel-hierarchy-questions/938 "2018-07-27T19:46:05Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![code-read](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/code-read/32/111_2.png) [@code-read](https://forums.bitovi.com/u/code-read)\
**Post date:** [July 29, 2018, 9:41pm UTC](https://forums.bitovi.com/t/color-chooser-illustrates-viewmodel-hierarchy-questions/938/5 "2018-07-29T21:41:25Z")

</div>

@justinbmeyer, thank you for [your comments](https://forums.bitovi.com/t/color-chooser-illustrates-viewmodel-hierarchy-questions/938/2?u=code-read)! My remarks on them:

1. When I try to configure the several VM’s under a common ‘parent’, I seem to lose the ability to derive the grid sizes from CSS as in [https://github.com/CODE-REaD/CanJS-ColorChooser/blob/master/index.html#L242](https://github.com/CODE-REaD/CanJS-ColorChooser/blob/master/index.html#L242) and [https://github.com/CODE-REaD/CanJS-ColorChooser/blob/master/index.html#L321](https://github.com/CODE-REaD/CanJS-ColorChooser/blob/master/index.html#L321) because I can no longer call window.getComputedStyle() since the target of that call is contained in the parent VM.

2. What I mean by “indexes” is, I’m storing each cell’s RGB values in its element ID and then parsing that to find its RGB value (see [https://github.com/CODE-REaD/CanJS-ColorChooser/blob/master/index.html#L292](https://github.com/CODE-REaD/CanJS-ColorChooser/blob/master/index.html#L292)). Then to change things in a single cell I have to send its x,y location to the VM (because the VM is working at the element’s “parent” level). If I could manage properties with an individual cell’s ViewModel, I would be able to store and retrieve these values directly as VM properties.

I would love to be enlightened on any of this.😄

---

_[View the full topic](https://forums.bitovi.com/t/color-chooser-illustrates-viewmodel-hierarchy-questions/938)._
