jQuery UI Widgets › Forums › Form › How to use getComponentByName in jqxForm?
This topic contains 5 replies, has 2 voices, and was last updated by Hristo 4 years, 4 months ago.
-
Author
-
Hello everyone,
I created a jqxForm with some jqxDropDownList controls, I’m trying to access the control using getComponentByName method but the returned object is undefined. Do you have practical examples with getComponentByName? I would like to access the controls to make sure I can play with them within the form (you know, add some custom behavior with jQuery events).I have an example here: https://jseditor.io/?key=javascript-app-ver-118
And same example here: https://codepen.io/lhernand/pen/JjXqMrGBTW, in CodePen I’m able to see the Form object in console (F12), but in JSEditor I’m getting a “Failed to execute ‘postMessage’ on ‘Window’: HTMLDivElement object could not be cloned” which is not really useful.
I’m using https://jqwidgets.com/public/jqwidgets/jqx-all.js (which has jQWidgets v10.1.5), so I’m wondering if the getComponentByName method has been properly implemented in that version.
Thank you a lot!
Hello luis.hernandez,
You should set the
name
field for the desired component.
Please, take a look at this example:
http://jsfiddle.net/vn9fbro7/
I hope this will help.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.comThanks a lot Hristo, it’s working fine now.
Could you please update the documentation? Because Name is not an option inside Template, what currently says is:
bind – Sets a template’s member Name.
Thanks!Hello luis.hernandez,
Thank you for this feedback.
I will create a work item for this.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.comHi Hristo,
Could you please also create a work item to add examples to the documentation? Because currently it has no live examples (hyperlinks).
We spent some time with my colleague trying to make hideComponent method to work, due to lack of examples, and finally we realized it’s not working properly (I created another post about that https://www.jqwidgets.com/community/topic/how-to-use-hidecomponent-in-jqxform/)BTW, thanks for the jqxForm control, it’s very handy to create forms on the fly and it’s jqx controls compatible. I have a suggestion, if you can implement a group property, so the idea is to hide/show them all at once by group name (I was thinking of replicating the behavior when you show or hide a DIV with multiple controls inside depending on some actions).
Thanks!
Hello Luis,
Thank you for these details.
We will discuss it.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.