EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: rezzonico on February 01, 2018, 08:43:42 AM



Title: datagrid - change editor dinamically
Post by: rezzonico on February 01, 2018, 08:43:42 AM
Hi all,

in a datagrid I need to change the editor dinamically.

Here is my code:
http://195.144.40.170/jeasyui/AAA2/index.html

Please, select a row and change the value in the column "Editor Type".
Then select the same row.
You will see that the editor of the column "Value" has been changed according to the selected value.
It works but in the console.log I see an error.

Any help to solve this problem is appreciated.

Regards.
Miche


Title: Re: datagrid - change editor dinamically
Post by: stworthy on February 01, 2018, 07:07:19 PM
Please try this code instead.
Code:
{field:'Type',title:'Editor Type',width:100,formatter:formatType,
   editor: {
      type: 'combobox',
      options: {
         onChange: function() {
          if(editIndex){
          setTimeout(function(){
          endEditing();
          },0)
          }
         },
...


Title: Re: datagrid - change editor dinamically
Post by: rezzonico on February 02, 2018, 03:27:02 AM
It works !

Thanks
Miche