jQWidgets Forums

jQuery UI Widgets Forums Scheduler Listen to selection change in resource dropdown in TS

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

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

  • Didier
    Participant

    Hello,

    I would like to be notified of value changes for the resource dropdownlist.

    I can get a reference to if thanks to this: $(fields.resource[0]).jqxDropDownList(‘getInstance’);

    I can see that there is a method called registerOnChange (fn) on the jqxDropDownListComponent but unfortunatly I get the following error when calling it with: this.planningTypeField.registerOnChange( e => {console.log(e)});

    ERROR TypeError: this.planningTypeField.registerOnChange is not a function

    Is there a way to be nofified when the resource dropdownlist’s value changes ?

    PS: for the sake of finding a solution I implemented a custom dropdownlist in the editdialog on which I can catch the change value event. However, when closing the dialog, the appointement element background color is not updated event though I defined the resource as such: appointmentDataFields: any =
    {
    from: “start”,
    to: “end”,
    id: “id”,
    description: “comment”,
    subject: “subject”,
    resourceId: “planningElType_id”,
    driver_id: “driver_id”,
    planningAction_id : “planningAction_id”,
    planningElType_id : “planningElType_id”,
    agentFrom_id : “agentFrom_id”,
    agentTo_id : “agentTo_id”
    };

    this.source =
    {
    dataType: “array”,
    dataFields: [
    { name: ‘id’, type: ‘string’ },
    { name: ‘comment’, type: ‘string’ },
    { name: ‘subject’, type: ‘string’ },
    { name: ‘driver_id’, type : ‘string’},
    { name: ‘start’, type: ‘date’ },
    { name: ‘end’, type: ‘date’ },
    { name: ‘planningAction_id’, type: ‘string’ },
    { name: ‘planningElType_id’, type: ‘string’ },
    { name: ‘agentFrom_id’, type: ‘string’ },
    { name: ‘agentTo_id’, type: ‘string’ },

    ],
    id: ‘id’,
    localData: this.generateAppointments()
    };

    this.resources =
    {
    colorScheme: “scheme05”,
    dataField: “planningElType_id”,
    source: new jqx.dataAdapter(this.source)
    };

    Thank you very much for your help.
    With best regards,
    Didier


    Martin
    Participant

    Hello Didier,

    I have updated the Example from your previous topic, so now it is bound to the resource dropdownlist change event, using:

    $(fields.resource[0]).on('change', (e) => { alert(e.args.item.label) });

    Best Regards,
    Martin

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


    Didier
    Participant

    Hello Martin,

    It is working perfectly ! Thanks a lot !

    With best regards,
    Didier

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

You must be logged in to reply to this topic.