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

How to submit all selected objects in Dual Listbox

Thread ID:

Created:

Updated:

Platform:

Replies:

144908 May 28,2019 11:11 AM UTC May 30,2019 07:14 AM UTC ASP.NET MVC - EJ 2 3
loading
Tags: ListBox
Koen
Asked On May 28, 2019 11:11 AM UTC

Dear,

I have made a form based on the example on https://ej2.syncfusion.com/aspnetmvc/ListBox/DualListBox#/material

I use the left listbox (called Group A in the example) as a list of available options and the right listbox (group B) as the list of selected options.
When submitting my form, only the objects that are highlighted (selected) in Group B are being submitted with the formdata; only these selected items appear in the hidden field (e-hidden-select).

I want some way to select all the items in Group B before I submit the form, how can I do this? 

I tried somehow to select these items with some function to add the "e-selected" class the the UL items in the listbox, but that does not make them appear in the e-hidden-select list...

Thanks in advance,
Koen

Christopher Issac Sunder K [Syncfusion]
Replied On May 29, 2019 09:33 AM UTC

Hi Koen, 
 
Greetings from Syncfusion support. 
 
We have checked your reported requirement “To select all options in the listbox” and we would like to let you know that your requirement can be achievable by using selectAll method as like in the below code example. 
 
Code Example: 
@Html.EJS().Button("btn").Content("To SelectAll Items").Render() 
 
document.getElementById("btn").addEventListener('click', function () { 
        var listbox2 = ej.base.getComponent(document.querySelector('#listbox2'), 'listbox'); 
        listbox2.selectAll(); 
    }) 
 
For your convenience, we have prepared the sample based on your requirement in a button click event. Please find the link below. 
 
 
Could you please check the above sample and get back to us, if you need any further assistance on this. 

Thanks,
Christo 


Koen
Replied On May 29, 2019 10:12 AM UTC

Thanks, it's working! I have to make myself comfortable with the syncfusion functions instead of trying to use JS/Jquery to get it done.


Vinoth Kumar Sundara Moorthy [Syncfusion]
Replied On May 30, 2019 07:14 AM UTC

Hi Keon,  
  
We are glad to know that your requirement is fulfilled with provided solution. Please get back to us if you need any further assistance on Syncfusion Components.  
  
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