jQuery UI Widgets › Forums › General Discussions › Angular › Bug with jqwidgets.ComboBoxOptions and Size type
This topic contains 4 replies, has 2 voices, and was last updated by Ivo Zhulev 8 years, 11 months ago.
-
Author
-
Hello,
I’ve found a bug on comboboxes and at least the properties
widthandheight.These properties are defined like this in
jqwidgets.ComboBoxOptions:height?: Size; width?: Size;So, in my application, I set combobox options like this:
const datafields = [ { name: "id", type: "number" }, { name: "name", type: "string" } ] const options = { autoDropDownHeight: true, checkboxes: false, datafields: datafields, displayMember: "name", height: { size: 22 }, valueMember: "id", width: { size: "100%" } }; this.myComboBox.createComponent(options);There’s no compilation error but the display is like
widthandheightwere set tozero.
I tested to compile withtypescript 2.3.3,angular 4.4.4andangular-cli 1.4.5
AND withtypescript 2.4.2,angular 5.0.0andangular-cli 1.5.0
AND with bothjqwidgets-framework 4.6.3andjqwidgets-framework 5.4.0.
The result is the same: comboboxes appears likewidthandheightwhere set tozero.On a old release, I saw that
widthandheightwere defined like this:height?: Number | String; width?: Number | String;So, I tried to set directly the value of
widthandheightlike this:height: 22, width: "100%"When I compile with
typescript 2.3.3,angular 4.4.4andangular-cli 1.4.5, there’s no compile error and the display is correct.
But when I compile withtypescript 2.4.2,angular 5.0.0andangular-cli 1.5.0, it complains thatwidthandheightmust be aSizeobject.I tested with
jqwidgets-framework 4.6.3and withjqwidgets-framework 5.4.0and the result is identical.It seems that the combobox component does not take the
Sizetype in account. And now, with recent realease of typescript and angular, I can’t make a “dirty code” to make it work.Can you take a look to this please ?
Because, I cannot edit anymore my post, the code for setting options is this one:
const options = { autoDropDownHeight: true, checkboxes: false, displayMember: "name", height: { size: 22 }, valueMember: "id", width: { size: "100%" } }; this.myComboBox.createComponent(options);Hi adrenalinedj,
Thanks for the feedback.
From the next release, the type ofheightandwidthwill bestring | number.Best Regards,
IvojQWidgets Team
http://www.jqwidgets.com/To add some information about the bug, I think it comes from this code:
createComponent(options?: any): void { if (options) { $.extend(options, this.manageAttributes()); } else { options = this.manageAttributes(); } this.host = $(this.elementRef.nativeElement.firstChild); this.__wireEvents__(); this.widgetObject = jqwidgets.createInstance(this.host, 'jqxComboBox', options); this.__updateRect__(); }If
optionsare set, it is merged with the ones returned bythis.manageAttributes().
It is passed directly tojqxComboBoxwithout convertSizeto anumberor astringwhich are the types supported by the “classic JS framework”.Hi adrenalinedj,
Thanks again for the feedback!
Best Regards,
IvojQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.