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. Image for the cookie policy date

GetValues

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.

7 Replies

VK Vinoth Kumar Sundara Moorthy Syncfusion Team 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 



FB Fillipe Barbosa 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.


VK Vinoth Kumar Sundara Moorthy Syncfusion Team 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 



FB Fillipe Barbosa 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


VK Vinoth Kumar Sundara Moorthy Syncfusion Team 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 



FB Fillipe Barbosa August 16, 2019 09:58 PM UTC

Hi,

Thanks for now.I'll wait the release.

Fillipe Barbosa.


VK Vinoth Kumar Sundara Moorthy Syncfusion Team 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 


Loader.
Up arrow icon