[ TypeScript ] Adding a pre-populated dropdownlist when editing a grid row

Hi there,

I have tried to refer back to my essential JS 1 versions of applications for reference, however I am struggling to find how I can achieve the following in the new EJ2 grid component:

var paramTypesDropdown = [{ value: 'checkbox', text: 'checkbox' }, { value: 'string', text: 'string' }, { value: 'date', text: 'date' }, { value: 'datetime', text: 'datetime' }, { value: 'number', text: 'number' }, { value: 'decimal', text: 'decimal' }, { value: 'dropdown', text: 'dropdown' }, { value: 'dropdown-multiselect', text: 'dropdown-multiselect' }];

 $('#taskmanagementtaskparamsgrid').ejGrid({

            dataSource: data.items,

            // Sets the EDIT/ADD dropdownlist for multi choice fields

            actionComplete: function(args) {

                if (args.requestType == 'add') {

                    // Set the dropdown types

                  $('#taskmanagementtaskparamsgridparameterType').ejDropDownList({

                        dataSource: paramTypesDropdown,

                        selectedIndex: 1

               }

          // rest of code removed for brevity...

});


So as you can see, on the actionComplete (which I can now do in EJ2 thanks to a previous post), I refer to the grid and column name (JQuery selector back then) and assign a dropdownlist component with a pre-selected list.  This only needs to be shown in edit/add mode as I have seen examples of using a template.  Ideally I don't want to use the template option in this case.

Is there any way to render another EJ2 component in the grid column as above?

Many thanks in advance!




2 Replies

DS David Sheardown December 21, 2017 05:37 PM UTC

My apologies,

Because obviously the new version of EJ2/TypeScript is a little different, I think I have a slightly longer learning curve!

I found this:


which of course handles/performs what I need to do!

I thought I would reply to help others if they happen to come across this :)


PS Pavithra Subramaniyam Syncfusion Team December 22, 2017 09:56 AM UTC

Hi David, 

Thanks for your update. 

We are glad to hear that your problem has been solved. 

Please contact us if you have any queries. 

Regards, 
Pavithra S.

Loader.
Up arrow icon