Ej2 Grid: How to open Custom Dialog Template from Custom toolbar click

Hello,

I have a grid with custom dialog template. 

How to open custom dialog template (Add), from custom toolbar?



How to open custom dialog template (Edit), from custom toolbar? And showing notification if no row is selected



Thank you in advance

Best regards,

Ismail


3 Replies 1 reply marked as answer

RR Rajapandi Ravi Syncfusion Team October 1, 2021 12:02 PM UTC

Hi ISMAIL, 
  
Greetings from Syncfusion support 
  
From your update, we could see that you like to open your dialog Template (Add/Edit dialog) by using your custom toolbar button. You can open the Add/Edit dialog by calling the respective action method in the toolbarClick event of Grid.  
  
In this event, when you are clicking on your customAdd button we have invoked the addRecord() method of Grid to open the Add dialog. And when you are clicking on your customEdit button we have invoked the startEdit() method to open the Edit dialog. At the time of calling the startEdit() if no record is selected in Grid, it will indicate the warning popup automatically. Please refer the below code example and sample for more information. 
  
  
toolbarClick: function (args: any) { //toolbar click event of Grid 
                if (args.item.id === 'Add') { 
                    this.addRecord(); 
                } 
                if(args.item.id === 'Edit') { 
                    this.startEdit(); 
                } 
            }, 
  
  
  
  
  
Regards,
Rajapandi R 


Marked as answer

IH ISMAIL HAMZAH replied to Rajapandi Ravi October 2, 2021 04:53 AM UTC

Hello Rajapandi,


Thank you for your answer. Its work.


Best regards,

Ismail



RR Rajapandi Ravi Syncfusion Team October 4, 2021 06:55 AM UTC

Hi ISMAIL 

Thanks for the update. 

We are happy to hear that the provided solution resolved your reported issue. 

Please get back to us if you need further assistance. 

Rajapandi R 



Loader.
Up arrow icon