How do you implement a simple dropdown colum on EJ2 Grid

I have this code from the examples but it doesn't work. The triangle for the dropdown is displayed but there is no list
I am using PHP

Can anyone help me

<div class="container">
    <div id="Grid"></div>    
</div>
<script>
    $(document).ready(function(){

        var data = new ej.data.DataManager({
            url"http://xxxxxxx.xxxxxx/data.php",
            adaptornew ej.data.WebApiAdaptor(),
            crossDomaintrue
        });

        ej.grids.Grid.Inject(ej.grids.Edit);
        var grid = new ej.grids.Grid({
            dataSourcedata,
            editSettings: { 
                allowEditingtrue
                allowAddingtrue
                allowDeletingtrue
            }, 
            pageSettings: { pageCount3 },            
            allowPagingtrue,
            columns: [
                { field"ID"headerText"ID"width140textAlign"Right"isPrimaryKeytruevisiblefalse }, 
                { field"Menu"headerText"Menu"width140textAlign"Right" }, 
                { field"Item"headerText"Item"width140textAlign"Right"allowEditingfalse }, 
                { field"Link"headerText"Link"width140textAlign"Right" }, 
                { field"MenuGroup"headerText"MenuGroup"width140textAlign"Right"editType"dropdownedit"edit: { params: { value'Germany' } } }, 
                { field"MenuOrder"headerText"MenuOrder"width140textAlign"Right" }, 
                { field"Seperator"headerText"Seperator"width140textAlign"Right" }, 
                { field"Security"headerText"Security"width140textAlign"Right" }, 
                { field"Attr"headerText"Attr"width140textAlign"Right" }
            ],
            actionBeginfunction(args) {
                //alert("Begin");
            },
            actionCompletefunction(args) {
                if (args.requestType === 'save') {
                    var url="include/admin-ajax.php"
                    formData = new FormData;
                    
                    formData.append('details'JSON.stringify(args.data));
                    formData.append('action''update-menus');    
    
                    $.ajax({
                        urlurl,
                        type'POST',
                        dataformData,
                        processDatafalse,
                        contentTypefalse,
                        successfunction(response){                              
                            result = JSON.parse(response);
                            alert(result.message);
                        },
                        errorfunction(err) {                              
                            alert(err.responseText);
                        }
                    });  


                }
                               
            },
        });

        grid.appendTo('#Grid');

    });
</script>





1 Reply 1 reply marked as answer

PG Praveenkumar Gajendiran Syncfusion Team November 25, 2020 02:28 PM UTC

Hi David,

Greetings from Syncfusion support.

By default in EJ2 Grid, if you define the columns.editType as drowdownedit, it will render the dropdownlist as editor component for that particular column with corresponding field values as dropdown dataSource.

We checked your provided code example, in that we found you are using columns.edit.params feature. We would like to inform you that columns.edit.params feature is used to customize or override the behavior of the editor component. The dropdownlist will show the defined columns.edit.params.value should be in the dropdownlist dataSource or else it will not show the list.  

So, can please explain your exact requirement?

 

Regards
Praveenkumar G 


Marked as answer
Loader.
Up arrow icon