powmedia / backbone-forms

Form framework for BackboneJS with nested forms, editable lists and validation
MIT License
2.17k stars 413 forks source link

Render function in the cildren of a list runs in list scope #434

Closed devel-pa closed 8 years ago

devel-pa commented 10 years ago

I hope it's an issue on my side, but let's describe it: When rendering a list, the item render and the render of the object inside it the "this" keyword represents the list;

exussum12 commented 10 years ago

Javascript has a weird variable scope if your coming from other languages

http://javascriptplayground.com/blog/2012/04/javascript-variable-scope-this/ should explain

devel-pa commented 10 years ago

Sry, I don't understand your answer. I'm from JS and BB. I signaled an issue. THIS in render method should be the current object, not the list.

exussum12 commented 10 years ago

can you put some up on http://jsfiddle.net/ showing what you mean

devel-pa commented 10 years ago

I can try. In fact I will check with one of your examples, first.

devel-pa commented 9 years ago

Sry, I've tried to reproduce the behavior without success outside my application. I'll research more and in case I can obtain something valid I'll give you the code. Thanks

glenpike commented 8 years ago

Closing as thread is old. Please feel free to re-open if you found problem / solution.