We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GetValues

Thread ID:

Created:

Updated:

Platform:

Replies:

146477 Aug 5,2019 05:35 PM UTC Aug 19,2019 07:28 AM UTC ASP.NET MVC - EJ 2 7
loading
Tags: MultiSelectDropdown
Fillipe Barbosa
Asked On August 5, 2019 05:35 PM UTC

Hi,
I wanna use the control with Ajax calls, but, I didn`t find any documentation about how can I get the values of control using Javascript.
Thanks for help.

Vinoth Kumar Sundara Moorthy [Syncfusion]
Replied On August 6, 2019 05:29 PM UTC

Hi Fillipe, 
 
Thank you for contacting Syncfusion support. 
 
Before we proceed on this we would like to know your user case scenario for using ajax call for MultiSelectDropdown component. Could you please get back to us with requested information? Based on that we will analyze and provide you better solution quickly. 
 
Regards, 
Vinoth Kumar S 


Fillipe Barbosa
Replied On August 6, 2019 06:45 PM UTC

Hi,

I had a MultiSelectDropdown to select classroom of students, like "1st grade", "2nd grade".
Based on this selections, I gonna send notification for the students in the groups.
MultiSelectDropdown was a easy way that I found instead use a grid control.

Thanks.

Vinoth Kumar Sundara Moorthy [Syncfusion]
Replied On August 7, 2019 01:54 PM UTC

Hi Fillipe, 
 
Good day to you. 
 
We would like to know that your requirement “” and it can be achieved by getting selected value using Multiselect instance as in the below code example, 
 
CSHTML 
@Html.EJS().MultiSelect("default").DataSource((IEnumerable<object>)ViewBag.data).Render() 
@Html.EJS().Button("Btn").Content("Send").Render() 
 
<script> 
    document.getElementById('Btn').onclick = function () { 
        var obj = document.getElementById('default').ej2_instances[0], value = JSON.stringify({ text: obj.text }); 
        const Http = new XMLHttpRequest(); 
        const url = '@Url.Action("About")'; 
        Http.open("POST", url); 
        Http.setRequestHeader('Content-Type', 'application/json'); 
        Http.send(value); 
    }; 
</script> 
   
CS 
public ActionResult Index() 
{ 
    ViewBag.data = new string[] { "Badminton", "Basketball", "Cricket", "Football", "Golf", "Gymnastics", "Hockey", "Tennis" }; 
    return View(); 
} 
 
[HttpPost] 
public ActionResult About(string text) 
{ 
    //Get the value in text      
    return View(); 
} 
 
Could you please check the above details and get back to us if you need any further details on this? 
 
Regards, 
Vinoth Kumar S 


Fillipe Barbosa
Replied On August 8, 2019 03:31 AM UTC

Thanks Vinoth,

It's working now!!!

But when the preselected values are send by model, I'm using a MultiSelectFor(m=> m.DAluno), it's show the datatype of array values, like the attachement.

Thanks for now.

Attachment: chrome_AHlQZd0v7Y_4373d1d1.zip

Vinoth Kumar Sundara Moorthy [Syncfusion]
Replied On August 13, 2019 04:47 PM UTC

Hi Fillipe, 
 
Good day to you. 
 
We have confirmed this as bug in our end. We will fix the issue and the fix is include in our Essential Studio 2019 Volume 3 main release. You can now track the status of your request, review the proposed resolution timeline, and contact us for any further inquiries through the below link, 
 
 
Regards, 
Vinoth Kumar S 


Fillipe Barbosa
Replied On August 16, 2019 09:58 PM UTC

Hi,

Thanks for now.I'll wait the release.

Fillipe Barbosa.

Vinoth Kumar Sundara Moorthy [Syncfusion]
Replied On August 19, 2019 07:28 AM UTC

Hi Fillipe, 
 
As promised, we will inform you once the Essential Studio 2019 Volume 3 main release is rolled out and appreciate your patience until then.  
 
Regards, 
Vinoth Kumar S 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon