How to get name in change event from Multiselect Dropdown?

Hi Syncfusion support,

I'm trying the following sample:

<template>
<ejs-multiselect id='multiselect' :dataSource='sportsData' :fields='fields' popupHeight="250px" popupWidth="250px" placeholder="Find a game" :change="MultiselectChange"></ejs-multiselect>
</template>
<script>
.
.
.
data: function () {
          return {
              sportsData: [
                  { Id: 'game1', Game: 'Badminton' },
                  { Id: 'game2', Game: 'Football' },
                  { Id: 'game3', Game: 'Tennis' }
              ],
              fields: { text: 'Game', value: 'Id' },
          };
        },
      methods: {
        MultiselectChange: function(args) {
          debugger;
        },
      },
.
.
.
</script>

In the MultiselectChange method, I can't seem to get the Game text, only able to find the Game Id. So is there anyway to get the text value from the parameter of onChange event of Multiselect Dropdown?


7 Replies

BC Berly Christopher Syncfusion Team December 13, 2021 05:51 PM UTC

Hi Erwin, 
  
Greetings from Syncfusion support. 
  
We can get the name in the selected event argument as mentioned in the below code example. 
  
  <ejs-multiselect id='multiselect' :dataSource='sportsData' :fields='fields' popupHeight="250px" popupWidth="250px" placeholder="Find a game" :select="MultiselectChange"></ejs-multiselect> 
 
  
  
Screenshot: 
  
 
  
Regards, 
Berly B.C 



ER Erwin December 14, 2021 10:40 AM UTC

Hi Berly,


Thanks for the reply. This is what I get from my end




Some additional details:
- I'm using Vue 3, from your screenshot I assume you're using Vue 2
- I'm using syncfusion/ej2-vue-dropdowns version 19.3.56

Do you mind test it using Vue 3? Sorry for the hassle. Thanks in advance.

Regards,
Erwin



BC Berly Christopher Syncfusion Team December 14, 2021 04:48 PM UTC

Hi Erwin, 
  
You have defined the change event for the MultiSelect component. As we mentioned earlier, you can get the item details from the select event  as mentioned in the below code example. 
  
<ejs-multiselect id='multiselect' :dataSource='sportsData' :fields='fields' popupHeight="250px" popupWidth="250px" placeholder="Find a game" :select="MultiselectChange"></ejs-multiselect>  
 
  
  
Regards, 
Berly B.C 



ER Erwin December 20, 2021 02:02 AM UTC

Ah ok sorry for not paying attention. I will definitely try it out! Thanks for the help.

Regards,
Erwin



BC Berly Christopher Syncfusion Team December 20, 2021 07:31 AM UTC

Hi Erwin, 
  
We will wait until hear from you. 
  
Regards, 
Berly B.C 



ER Erwin replied to Berly Christopher December 30, 2021 08:23 AM UTC

Hi sorry for the late reply, it works with the select event, thanks for the help!



BC Berly Christopher Syncfusion Team December 31, 2021 04:59 AM UTC

Hi Erwin, 
  
We are glad to know that the issue is resolved in your end. Please let us know if you need further assistance on this. 
  
Regards, 
Berly B.C 


Loader.
Up arrow icon