-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It is impossible to revert effect of $.fn.model(m) #101
Comments
Why do you need this? Typically, if I am swapping a model on an instance, it's through a controller. |
Do you mean something like
Or maybe
? |
I mean
|
null could remove all model instances (found in data.models) Buuuuuuuuuuuuuuuut ... I'd still like to know why you need this. |
We have an analog of select control. User may select any value of the list. We decided to bind selected value (instance of $.Model) to the select itself. And this worked quite well. However we met a case when we need to clear selection. So this ticket came to life. I can believe that this may be not intended usage of $.fn.model method but in our case it seemed to be the most appropriate. Correct me, if I'm not right. Also please notice that I not need to remove all model instances but only a specific one. |
The method $.fn.model(m) does two things:
Unfortunately there is no convenient way to undo this. So if we bound a model to element we can't unbind it (and replace with other model).
I think that there should be a method like$.fn.unbindModel(m) that will revert effect of the $ .fn.model(m).
The text was updated successfully, but these errors were encountered: