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

Set input element ID from Parent id #44

Open
erollmaxhuni opened this issue Jun 12, 2017 · 0 comments
Open

Set input element ID from Parent id #44

erollmaxhuni opened this issue Jun 12, 2017 · 0 comments

Comments

@erollmaxhuni
Copy link

What i did one of my examples when i was trying which is best part to set ID on child element was to inherit a part from parent element

id=(concat "date-picker-" elementId)
{{input type="text" class=mdClass name=name value=dateText key-up="keyUp" required=required disabled=disabled focus-out="focusOut" id=(concat "date-picker-input-" elementId) autocomplete="off"}}

Then in component.js access directly to component with ID

inputID: null,

function changes :

didInsertElement() { this._super(...arguments); let self = this; let elementID = "#date-picker-"+self.elementId; set(self, 'inputID',elementID); jquery(elementID).on('contextmenu', function() { return false; }); jquery(elementID).on('invalid', function(e) { e.preventDefault(); self.set('isDirty', true); });}

downArrowClick() { this.$(get(this,'elementID')).focusin(); }

I will try to make pull-request to send directly what i mean.

Thank you.

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