Re : can.Component external events
You probably want to use two way binding between component scopes.parent-container scope should have selected attribute:can.Component({ tag: parent-container template: '...
View ArticleCreating Reusable Components
Some background. My app is a collection of many single page apps using routing to determine which app to load. It is using Steal. And I like to keep my models, controls and views each in their own...
View ArticleRe : can.Component external events
Thanks this helps a bit more.When rendering the top component, the child components are created and the 'selected' attribute is set accordingly.Still I am not sure how this helps. How can the child...
View ArticleRe : can.Component external events
"selected" (and "id") actually contains a value that is shared between all the playing components.As you update selected attribute in node-list (using attr('selected', newVal) it triggers change event....
View ArticleRe : Creating Reusable Components
Huh, what you are doing seems completely weird You just define a component once in you app, and then insert it where ever you want and fill it with needed content.steal('can', function(can){...
View ArticleRe : Creating Reusable Components
Thanks Alex.Is this the Bitovi recommended way?And while my method seems weird, is it the unaccepted way?I just thought it would be nice (and easy) to say "insert one of these content panel components...
View ArticleRe : can.Component external events
The updating of the 'id' in the child components works, that is not the problem. But if I cannot know when it is updated I cannot use the updated id to fetch the record corresponding to that 'id'. I...
View ArticleRe : can.Component external events
in note-editor you want to use attribute change event handler this way:events: { '{scope} id': function(scope, ev, id){ //id contains updated value }}
View ArticleRe : Creating Reusable Components
If you call ContentPanel({}) more than once in your app <content-panel> will be defined as last run result.If your planning to call it once, if I understand your intention correctly you are...
View ArticleRe : can.Component external events
Here is a fiddle example that doesn't work: http://jsfiddle.net/basicguy/wU59L/3/When you click on the textarea the child id should be updated (in the widget element and in its template) and...
View ArticleRe : can.Component external events
Your code was strong. I created this simple example to show two-way binding http://jsfiddle.net/wU59L/4/BTW using id attribute is not very good idea (as it is reserved attribute for HTML elements) use...
View ArticleRe : can.Component inserted event fires twice on the same element
Are you instantiating component inside can.Control code? I had to workaround it. When I replaced all my controls with components I get rid of it.I failed to repeat it fiddle or test =( Didn't try...
View ArticleRe : can.Component external events
You see I have decided to use CanJS as the major "glue" in a bigger frontend project and getting this to work was essential. YAW. That is a right derision.
View Articlecan.List does not initialize computes
can.List inherits from can.Map, but lacks compute attributes. This can be worked around by calling this._setupComputes within init or setup, but should be part of the super.
View ArticleMustache {{#each tag}} and {{#tag}} are inconsistent
In the below example, when using {{#each items}} instead of {{#items}}, the dom will render with the results spliced in place instead of completely replacing. With 20 items initially showing, and 5...
View ArticleCannot pass models as attributes into components
When passing models into components as attributes, the scope returns a can.Map instead of a can.Model.
View ArticleIn can 2.0.3, namespacing events does not work
Transitioning from can 2.0 to can 2.03, namespacing events fails. Previously, you could do something like can.bind('change.123', can.proxy(this.onChange, this));
View ArticleHow does event unbinding work in CanJS?
I've noticed that for the most part, all the examples on CanJs.com dance around binding to objects within controller initialization. It appears as though there is automated handling of binding...
View ArticleRe : can.Component inserted event fires twice on the same element
Yes I am. And I am not about to get rid of all my controls at this moment.Any idea why that would cause this?
View Articlecan.Component Helper Functions
If have a block in my mustache template like this and instead of printing the content within, it is displaying the return value of "true" when it is truthy of the "isActive" helper function on the...
View Article