View Full Version : what is a better listener?

18 Feb 2012, 7:06 AM
Hi All,

Just wondering, if anybody out there knows a good answer.
I have a complex page , having many tabs and every tab has its own model extending from the base model.
The base model also has an number that needs to get updated every time any of the numbers on the individual tabs change.

What is a better listener, adding a model listener for value change on the model or adding a listener to the HTML element? and why ....because both of the approaches work.

If I put a listener on the model I have to check the name for what got updated and then perform the operation , but if I put it directly on the element, I get away from it.Will a model bind help better if I auto-bind all elements to the model and then a change on the model will auto update all elements everywhere else without a layout() call?