Skip to content
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

Modifications over dom #26

Open
Charly-T opened this issue May 31, 2016 · 0 comments
Open

Modifications over dom #26

Charly-T opened this issue May 31, 2016 · 0 comments

Comments

@Charly-T
Copy link

Charly-T commented May 31, 2016

I work with multiple forms, and i use to disable and hide a lot of fields.
Would be nice to be able to access the dom via model, so the code could be much more cleaner.

My (maybe imposible) idea, is to access like
myModel.firstField.el.prop('disabled', true)
If 'el' returns the jQuery element of the dom linked to the field. Maybe
$(myModel.firstField.el).prop('disabled, true)
If jQuery is nasty inside the bind.js

By now, I've changed it to
this.el = function (target) { if(typeof settings.mapping[target] === o) { return jQuery(settings.mapping[target].dom); } else { return jQuery(settings.mapping[target]); } };
What results in
myModel.el('firstField').prop('disabled', true)
But im not really happy with it... in fact, it hurts... Also, the __export function, returns 'el' as a property... but I cannot dig into the code that easy...
If this is not useful for all, at least, how to do it right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant