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.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author

  • adrenalinedj
    Participant

    Hello,

    I’ve found a bug on comboboxes and at least the properties width and height.

    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 and height were set to zero.
    I tested to compile with typescript 2.3.3, angular 4.4.4 and angular-cli 1.4.5
    AND with typescript 2.4.2, angular 5.0.0 and angular-cli 1.5.0
    AND with both jqwidgets-framework 4.6.3 and jqwidgets-framework 5.4.0.
    The result is the same: comboboxes appears like width and height where set to zero.

    On a old release, I saw that width and height were defined like this:

    height?: Number | String;
    width?: Number | String;

    So, I tried to set directly the value of width and height like this:

    height: 22,
    width: "100%"

    When I compile with typescript 2.3.3, angular 4.4.4 and angular-cli 1.4.5, there’s no compile error and the display is correct.
    But when I compile with typescript 2.4.2, angular 5.0.0 and angular-cli 1.5.0, it complains that width and height must be a Size object.

    I tested with jqwidgets-framework 4.6.3 and with jqwidgets-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.

    adrenalinedj
    Participant

    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);

    Ivo Zhulev
    Participant

    Hi adrenalinedj,

    Thanks for the feedback.
    From the next release, the type of height and width will be string | number.

    Best Regards,
    Ivo

    jQWidgets Team
    http://www.jqwidgets.com/


    adrenalinedj
    Participant

    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 by this.manageAttributes().
    It is passed directly to jqxComboBox without convert Size to a number or a string which are the types supported by the “classic JS framework”.


    Ivo Zhulev
    Participant

    Hi adrenalinedj,

    Thanks again for the feedback!

    Best Regards,
    Ivo

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.