Published properties and 'kind: ...'

spacer Samarthwiz
edited March 2013 in Enyo 2
Hi,
So, if you have a component based on a kind that has properties would the outside code be able to access the base kind's properties without setting it as a published property?
Example:
enyo.kind({
name: 'Sam.List',
kind: 'enyo.List',
classes: 'onyx',
components: { [...] },
[...]
});
[...]
//Would I be able to set enyo.List's count property without setting the property as a published property
{kind: 'Sam.List', count: 12 [...] }
[...]
0 · Share on Twitter

Comments

  • spacer psarin
    Yes but since there are no getters/setters for non-published properties, you would have to use a direct reference to it. For example, this.$.myList.count. Or you can write your own function to return the value.
    0 · Share on Twitter
  • spacer mbessey
    edited March 2013
    Yes, this works like you'd expect. Otherwise, there'd be little point in creating a kind hierarchy. For example, all of the sub-kinds of Control support the "showing" property without any additional code.
    0 · Share on Twitter
  • spacer sugardave
    @psarin in this case, since the super-kind is an enyo.List, count is a published property and therefore can be used a la setCount/getCount
    0 · Share on Twitter
  • spacer psarin
    Good point. I guess I didn't look at code too closely and was just answering the "would the outside code be able to access the base kind's properties without setting it as a published property?" part.
    0 · Share on Twitter
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register
  • Categories
  • Recent Discussions
  • Best Of...

Categories

  • 2.2K All Categories
  • 11 Announcements
  • 20 Enyo 2.5
  • 1.2K Enyo 2
  • 202 Enyo 2.4
  • 11 Moonstone & Spotlight
  • 151 General
  • 270 Newbie Questions
  • 13 Enyo Jobs
  • 45 Showing Off
  • 80 Packaging Apps
  • 66 Application Development
  • 14 Open Source
  • 103 Enyo 1.0
  • 70 Ares
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.