Using UI hash key in an events hash
Asked Answered
C

1

7

I am using marionette version 1.2.3 and backbone version 1.1.0

Here is my UI and events hash:

ui:{
    title : '#modelTypeTitle'
},
events:
{
    'change @ui.title' : 'validateTitle'
},

This seems to match what the documentation says: "You can also use the ui hash values from within events and trigger keys using the '@ui.elementName'"

To clarify I want to know why what I am trying above does not work. but the following works fine:

events:
{
    'change #modelTypeTitle' : 'validateTitle'
},
Corrosion answered 18/12, 2013 at 14:30 Comment(4)
What is your question exactly?Jungian
Why the above doesnt work and/or what will workCorrosion
What is your Marionette version?Weinberger
I revised my post to include versions of librariesCorrosion
W
9

Okay, problem solved after you showed version.

This feature, parsing @ui. syntax within the events and triggers hash, is recently added in 1.4.0 in early December. See changelog: https://github.com/marionettejs/backbone.marionette/blob/master/changelog.md

Just update your Marionette version to the latest stable(1.4.1 currently) and problem should be solved.

*I just noticed this new feature thanks to your question. I don't feel comfortable at this point before, now solved. Another evidence of helping others could also help the man himself. :)

Weinberger answered 18/12, 2013 at 16:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.