|
Index.cshtml
<script>
var vegetableData = [
{ id: 'vegetable1', vegetable: 'Cabbage', category: 'Leafy and Salad' },
{ id: 'vegetable2', vegetable: 'Spinach', category: 'Leafy and Salad' },
{ id: 'vegetable3', vegetable: 'Wheat grass', category: 'Leafy and Salad' },
{ id: 'vegetable4', vegetable: 'Yarrow', category: 'Leafy and Salad' },
{ id: 'vegetable5', vegetable: 'Pumpkin', category: 'Leafy and Salad' },
{ id: 'vegetable6', vegetable: 'Chickpea', category: 'Beans' },
{ id: 'vegetable7', vegetable: 'Green bean', category: 'Beans' },
{ id: 'vegetable8', vegetable: 'Horse gram', category: 'Beans' },
{ id: 'vegetable9', vegetable: 'Garlic', category: 'Bulb and Stem' },
{ id: 'vegetable10', vegetable: 'Nopal', category: 'Bulb and Stem' },
{ id: 'vegetable11', vegetable: 'Onion', category: 'Bulb and Stem' }
];
function querycellInfo(args) {
if (args.column.headerText === "Ship City") {
var listObj = new ej.dropdowns.MultiSelect({
dataSource: vegetableData,
allowFiltering: true,
enableGroupCheckBox: true,
mode: 'CheckBox',
fields: { text: 'vegetable', value: 'id', groupBy: 'category' },
enableSelectionOrder: false,
// set placeholder to MultiSelect input element
placeholder: "Select games",
filterBarPlaceholder: "Search vegetables",
showSelectAll: true,
});
listObj.appendTo(args.cell.querySelector('#select'));
}
}
</script>
|