Hi all - I wonder does "noNotify" argument of MVCObject.bindTo() method works correctly?
The maps api v3 reference said: (http://goo.gl/LkcPh) ------------------ >bindTo(key:string, target:MVCObject, targetKey?:string, noNotify?:boolean) Binds a View to a Model. >notify(key:string) Notify all observers of a change on this property. This notifies both objects that are bound to the object's property as well as the object that it is bound to. ------------------ And a previous post about MVCObject said: (http://goo.gl/uR0l2) ------------------ >We do - calling > model.notify("enabled") >is equivalent to calling > google.maps.event.trigger(model, "enabled_changed") >ie. MVCObject uses events for notification. ------------------ So I recognize if I set the value "true" to noNotify argument the MVCObject would not fire the "(key)_changed" event, but it works. <test code> -------------------- var mvcObject1 = new google.maps.MVCObject(); mvcObject1.set("visible", true); var mvcObject2 = new google.maps.MVCObject(); mvcObject2.bindTo("visible", mvcObject1, "visible", true); //noNotify = true google.maps.event.addListener(mvcObject2, "visible_changed", function(){ // I believe this alert never display alert("visible_changed"); }); var chkbox = document.getElementById("chkbox"); google.maps.event.addDomListener(chkbox, "click", function(){ mvcObject1.set("visible", chkbox.checked); }); -------------------- Do I have wrong understand, or bug? Please tell me. - Masashi -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
