Quantcast
Channel: JavaScriptMVC Forum
Browsing all 3491 articles
Browse latest View live

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 Article


Creating 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 Article


Re : 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 Article

Re : 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 Article

Image may be NSFW.
Clik here to view.

Re : 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 Article


Re : 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 Article

Re : 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 Article

Re : 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 Article


Re : 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 Article


Re : 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 Article

Re : 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 Article

Re : 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 Article

Re : 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 Article


can.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 Article

Mustache {{#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 Article


Cannot 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 Article

In 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 Article


How 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 Article

Re : 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 Article

can.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
Browsing all 3491 articles
Browse latest View live