Question

Need to disable input buttons for items within a Marionette collection view.

Normally I'd just do:

TheView.$el.find('input').prop('disabled', true);

That should disabled all input elements within the view.

The problem I am having is that other parts of the application are updating that view, as a result anything new that comes into the view is not disabled.

What is a good pattern for dealing with this situation?

Was it helpful?

Solution

INHO its not very good to work with ItemView elements from collection view - its better to use custom event or move disable logick to item view.

In case you have other modules updating the view - if i were you i would move disable term in ItemView template - in this case any update will check this term and render input correctlly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top