bind new datasource on dropdown change event - ejs schedule event component

I am trying to implement a dropdown on the change method inside the event modal of the ejs-schedule. I have added the change event into the first dropdown and the method is also called but the data source of the second dropdown is not updating.

Can anyone faced this issue or implement it like this then please suggest the solution?

TIA


1 Reply 1 reply marked as answer

HB Hareesh Balasubramanian Syncfusion Team May 12, 2021 09:44 AM UTC

Hi Avadh, 

Greetings from Syncfusion Support..! 

We have validated your shared query at our end and suspect that your requirement is to perform cascading DropDownList is a series of DropDownList, where the datasource of one DropDownList depends upon another’s value. And for the same, we have prepared a sample using the poupOpen event of our Scheduler, which can be viewed from the following link. 


var drowDownList = new DropDownList({ 
          dataSource: [ 
            { StateName: 'New York'CountryId: '1'StateId: '101' }, 
            { StateName: 'Queensland'CountryId: '2'StateId: '104' }, 
            { StateName: 'Tasmania 'CountryId: '2'StateId: '105' }, 
            { StateName: 'Victoria'CountryId: '2'StateId: '106' }, 
            { StateName: 'Virginia 'CountryId: '1'StateId: '102' }, 
            { StateName: 'Washington'CountryId: '1'StateId: '103' } 
          ], 
          change: function() { 
            var cityObj = (args.element.querySelector('#city'as any) 
              .ej2_instances[0]; 
            var stateObj = (args.element.querySelector('#state'as any) 
              .ej2_instances[0]; 
            cityObj.enabled = true; 
            var tempQuery1 = new Query().where( 
              'StateId', 
              'equal', 
              stateObj.value 
            ); 
            cityObj.query = tempQuery1; 
            cityObj.text = null; 
            cityObj.dataBind(); 
          }, 
          fields: { value: 'StateId'text: 'StateName' }, 
          value: args.State, 
          floatLabelType: 'Always', 
          placeholder: 'Select a State' 
        }); 
        drowDownList.appendTo(inputEle); 
        inputEle.setAttribute('name''State'); 
      } 


Kindly try the above solution and get back to us if you need any further assistance. 

We will be happy to assist you..! 

Regards, 
Hareesh 


Marked as answer
Loader.
Up arrow icon