Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bind('list.length') - make length event bubble #112

Closed
wants to merge 1 commit into from

Conversation

iamnoah
Copy link
Contributor

@iamnoah iamnoah commented Sep 27, 2012

See http://jsbin.com/ikewoy/4/edit

Trying to bind the length of a nested list does not work because length does not bubble. I don't know why length is special, but this patch makes it behave like any other attribute.

@justinbmeyer
Copy link
Contributor

Length is kinda a special event, mostly used to listen to add and remove without having to bind to both. Can you let me know how listening to this on a nested list makes your life easier? If you do, we'll pull it. Thanks!

@iamnoah
Copy link
Contributor Author

iamnoah commented Oct 30, 2012

We use it for templated binding in our controls for one:

"{model} items.length": function() {
   this.element.find('.itemCount').html(...);
}

@dispatchrabbi
Copy link
Contributor

You should be able to accomplish that just using:

"{items} length": function() {
    this.element.find('.itemCount').html(...);
}

If you can find a case where this kind of solution doesn't help you, rig up a test case and we'll take it from there.

@daffl
Copy link
Contributor

daffl commented Apr 16, 2013

This unfortunately doesn't seem to solve #267. Will investigate more in that issue but closing this PR.

@daffl daffl closed this Apr 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants