How can i get the multi-selectbox selected text value ?
value can but I need the selected text-value.
codeList = respdata;
var listObj = new ej.dropdowns.MultiSelect({
dataSource: codeList,
// maps the appropriate column to fields property
fields: { text: 'name', value: 'id' },
// set placeholder to MultiSelect input element
placeholder: "-선택-",
mode: "CheckBox",
width: "130px",
// select: onMultiSelectChange, // Bind the change event handler
showDropDownIcon: true,
});
listObj.appendTo('#rejectType');
listObj.change = function (args) {
// args.value를 사용하여 선택된 항목들의 값을 가져옴
var selectedItems = args.text; // Get the selected items
var selectedItemsText = selectedItems.map(function (item) {
return item.name; // Get the text value of each selected item using 'name' field
});
var textarea = document.getElementById('rejectReason'); // Get the textarea element
textarea.value = selectedItemsText.join('');
};
thank you.