modify the dialog from the edit mode of Grid

Hi, 

I try this example (https://ej2.syncfusion.com/vue/documentation/grid/edit/#dialoginline-template)
How can I change the properties of dialog(such as its width, color, etc.) from the edit mode is this code.
Thanks 

Franky 

5 Replies 1 reply marked as answer

BS Balaji Sekar Syncfusion Team November 19, 2020 03:33 PM UTC

Hi Franky, 
 
Greetings from the Syncfusion support. 
 
Query: How can I change the properties of dialog(such as its width, color, etc.) from the edit mode 
 
Based on your query we want to override dialog popup CSS properties while dialoginline template editing. To achieved your requirement using actionComplete with “beginEdit” requestType and we can access the dialog component instance in this event since you can achieve your requirement using following code example. 
 
Please refer the below code example for more information. 
[App.Vue] 

methods: { 
    actionComplete(args) { 
        if (args.requestType === 'beginEdit') { 
              args.dialog.width = 300; 
             args.dialog.headerContent.style.background = “grey”; 
       
   
  } 
 
 
Please get back to us, if you need further assistance. 
 
Regards, 
Balaji Sekar 


Marked as answer

FL Franky Lee November 24, 2020 07:55 AM UTC

Hi,

Thank you for your reply.
I have one more question.
In this sample (https://ej2.syncfusion.com/vue/documentation/grid/edit/#dialoginline-template),
how can I get the data from the dialoginline-template(or Vue.component) and show in the parent template?
Thanks a lot.

Franky


PK Prasanna Kumar Viswanathan Syncfusion Team November 26, 2020 07:30 AM UTC

Hi Franky, 
 
Thanks for the update. 
 
Based on your query you have mentioned that you need to get the data from the dialog-inline template. Before we proceed with your query we need the following details, 
 
1. In this you have mentioned that you need to show the data in parent template. Please share the screenshot and code example of parent template. 
 
2. Share the complete Grid rendering code. 
 
3. Share the screenshot or video demonstration of your requirement. 
 
Regards, 
Prasanna Kumar N.S.V 



FL Franky Lee November 27, 2020 06:40 AM UTC

Hi,

Thanks for your reply.
There is my code based on this example.
Because there are many checkbox item in my dialog, I use the "Y" to replace the true from the checkbox.
When I start to edit the existing data in the grid, the value of checkbox doesn't correspond to the selected row.
I used this action:

    actionComplete(args) {
      if (args.requestType === "beginEdit") {
        args.form[4].checked = args.rowData.MG005 === "Y" ? true : false;
        console.log(args);
      },
is there any error in this code?

Thanks 
Franky

Attachment: dialogexample_51734a1a.zip


BS Balaji Sekar Syncfusion Team November 30, 2020 02:32 PM UTC

Hi Frankly, 
 
Thanks for your update. 
 
We have analyzed the provided code example and we can see MG005 field has checkbox component’s label in disable state while editing. 
 
By default, we can perform the edit operation in the Grid field and also access the corresponding field value while editing. If you customize editing input component/template in edit mode using dialog template option  
 
Please ensure that you want to override the Grid’s dataSource value in mentioned checkbox type field or you need to change checkbox label value in display purpose alone while editing. If we misunderstood your requirement, please share explain your exact requirement to us that will help to validate further. 
 
Regards, 
Balaji Sekar 


Loader.
Up arrow icon