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

EJ2 Data Grid Multiselect in a cell

Thread ID:

Created:

Updated:

Platform:

Replies:

145274 Jun 14,2019 04:01 PM UTC Jun 17,2019 12:42 PM UTC JavaScript - EJ 2 1
loading
Tags: Grid
Didier Urban
Asked On June 14, 2019 04:01 PM UTC

Hi.

I have an array of users, and I want to display them in a multi-select component in a grid cell but I can't find out how.

Thanks everyone for helping.


Hariharan J V [Syncfusion]
Replied On June 17, 2019 12:42 PM UTC

Hi Didier, 

Thanks for contacting Syncfusion support. 

We have validated your query and suspect that you want to display the multi-select dropdown in the Grid. You can achieve your requirement using `editTemplate` feature of the Grid. We have prepared a sample for your reference. Please refer the below code example, Documentation and sample for your reference. 

load: function () { 
    this.columns[2].edit = { 
        create: function () { 
            elem = document.createElement('input'); 
            return elem; 
        }, 
        read: function () { 
            return multiSelectObj.value; 
        }, 
        write: function (args) { 
            multiSelectObj = new ej.dropdowns.MultiSelect({ 
                dataSource: jsonCities, 
                fields: { 
                    value: "Id", 
                    text: "Label" 
                }, 
                mode: 'CheckBox', 
                showSelectAll: true, 
                value: Array.isArray(args.rowData["ShipCity"])? args.rowData["ShipCity"] : [args.rowData["ShipCity"]], 
                enabled: (!this.parent.columns[2].allowEditing)? false : true, 
                placeholder: 'Select holder' 
            }); 
            multiSelectObj.appendTo(elem); 
        } 
    }; 
}, 
}); 



If this is not your exact query, Please get back to us for further assistance. 

Regards, 
Hariharan 


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