Prevent Dialog template to show when condition didn't meet

Hello, I need help.. I have a condition where when user hit add button toolbar on grid, it should prevent the modal to pop up when the condition didn't meet.

The partial view is not rendered, but there is still pop up like this


this is my code shown below



Thanks


5 Replies 1 reply marked as answer

BR Bernadus Rangga Kresna Waskita July 19, 2022 09:42 AM UTC

and hey I need the modal pop up to become wizard modal, if you can show me how to pop up a modal costume template dialog on the toolbar click, so i can show wizard modal from another cshtml file.. im so lost, thanks



RR Rajapandi Ravi Syncfusion Team July 22, 2022 12:11 PM UTC

Hi Bernadus,


Greetings from Syncfusion support


Currently we are validating your query with your shared information, and we will update you the details on or before 26th July 2022. Until then we appreciate your patience.


Regards,

Rajapandi R



RR Rajapandi Ravi Syncfusion Team July 26, 2022 01:32 PM UTC

Hi Bernadus,


Thanks for your patience


We have checked your shared information and we could see that you like to prevent opening the dialog when the condition doesn’t meet, you can prevent opening the dialog by setting args.cancel as true. Please refer the below code example for more information.


 

<script>

    function begin(args) { //actionBegin event of Grid

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

            if ('if the condition doesnt meet you can prevent the dialog') {

                args.cancel = true; //prevent open the dialog

            }

            else {

                //perform your action here

            }

        }

    }

</script>

 


API: https://ej2.syncfusion.com/documentation/api/grid/#actionbegin


Regards,

Rajapandi R


Marked as answer

BR Bernadus Rangga Kresna Waskita July 27, 2022 03:57 AM UTC

thankyouu ill try it :)



RR Rajapandi Ravi Syncfusion Team July 28, 2022 04:13 AM UTC

Hi Bernadus,


Most welcome.


Regards,

Rajapandi R


Loader.
Up arrow icon