jQuery UI Widgets › Forums › Angular › Bug with jqwidgets.ComboBoxOptions and Size type
This topic contains 4 replies, has 2 voices, and was last updated by Ivo Zhulev 5 years, 6 months ago.
-
Author
-
Hello,
I’ve found a bug on comboboxes and at least the properties
width
andheight
.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
width
andheight
were set tozero
.
I tested to compile withtypescript 2.3.3
,angular 4.4.4
andangular-cli 1.4.5
AND withtypescript 2.4.2
,angular 5.0.0
andangular-cli 1.5.0
AND with bothjqwidgets-framework 4.6.3
andjqwidgets-framework 5.4.0
.
The result is the same: comboboxes appears likewidth
andheight
where set tozero
.On a old release, I saw that
width
andheight
were defined like this:height?: Number | String; width?: Number | String;
So, I tried to set directly the value of
width
andheight
like this:height: 22, width: "100%"
When I compile with
typescript 2.3.3
,angular 4.4.4
andangular-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.0
andangular-cli 1.5.0
, it complains thatwidth
andheight
must be aSize
object.I tested with
jqwidgets-framework 4.6.3
and withjqwidgets-framework 5.4.0
and the result is identical.It seems that the combobox component does not take the
Size
type 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 ?
- This topic was modified 5 years, 6 months ago by adrenalinedj.
- This topic was modified 5 years, 6 months ago by adrenalinedj.
- This topic was modified 5 years, 6 months ago by adrenalinedj.
- This topic was modified 5 years, 6 months ago by adrenalinedj.
- This topic was modified 5 years, 6 months ago by adrenalinedj.
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 ofheight
andwidth
will 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
options
are set, it is merged with the ones returned bythis.manageAttributes()
.
It is passed directly tojqxComboBox
without convertSize
to anumber
or astring
which 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.