jQWidgets Forums

jQuery UI Widgets Forums Angular Cannot set property 'source' of undefined

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  Ivo Zhulev 7 years, 7 months ago.

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

  • GregoryHouseMD
    Participant

    I’m using Angular 4 and because I only need the ComboBox component, I added the needed JavaScript files in the vendor.ts file:

    import './jqxWidgets/jqxcore.js';
    import './jqxWidgets/jqxbuttons.js';
    import './jqxWidgets/jqxscrollbar.js';
    import './jqxWidgets/jqxlistbox.js';
    import './jqxWidgets/jqxcombobox.js';

    And only added the jqwidgets.d.ts and angular_jqxcombobox.ts file. I couldn’t compile my app because I had this error Element implicitly has an 'any' type because type 'jqxComboBoxComponent' has no index signature. so I had to add [key: string]: any; to the component.

    Also in the manageAttributes function I had to change const options = {} to let options: { [key: string]: any }; because of the same reasons.

    Do any of the changes I made have anything to do with this or am I missing something? This is the console error:

    `TypeError: Cannot set property ‘source’ of undefined
    at jqxComboBoxComponent.manageAttributes (angular_jqxcombobox.ts:181)
    at jqxComboBoxComponent.createComponent (angular_jqxcombobox.ts:203)
    at jqxComboBoxComponent.ngOnInit (angular_jqxcombobox.ts:134)
    at checkAndUpdateDirectiveInline (core.es5.js:10843)
    at checkAndUpdateNodeInline (core.es5.js:12339)
    at checkAndUpdateNode (core.es5.js:12278)
    at debugCheckAndUpdateNode (core.es5.js:13139)
    at debugCheckDirectivesFn (core.es5.js:13080)`


    GregoryHouseMD
    Participant

    I installed the framework from npm, I changed the noImplicityAny setting to false, imported jqx-all and I got it to work. What imports am I missing, because I don’t want to include a 3mb script (I’m only using the combo box)?

    Cannot set property 'source' of undefined #95767

    Ivo Zhulev
    Participant

    Hi GregoryHouseMD,

    As you can see from our angular combobox demos: http://www.jqwidgets.com/angular/angular-combobox/index.htm,
    for the combobox, you need jqxcore.js, jqxbuttons.js, jqxscrollbar.js, jqxlistbox.js, jqxcombobox.js.

    Best Regards,
    Ivo

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

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

You must be logged in to reply to this topic.