2

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?

Chris Dutrow
  • 48,402
  • 65
  • 188
  • 258

1 Answers1

1

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.

Evgeniy
  • 2,915
  • 3
  • 21
  • 35