We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

MCV Grid : Access buttons in InlineFormTemplate

Hello,

How to access the save button to InlineFormTemplate (MCV Grid) in order to disable it, in case I doubleclick on row. This allows me to visualize the data of the fields without modification, or there is another solution to see these data in template form
without saving.

and thank you.


5 Replies

SA Saravanan Arunachalam Syncfusion Team October 5, 2017 09:04 AM UTC

Hi Laid, 
Thanks for contacting Syncfusion’s support. 
We understood from your query, you need to disable or remove the save button from the inline template form and we have achieved it by using ActionComplete event of Grid control. In that event, we can either disable or remove the save button as like in the below code example. 
@(Html.EJ().Grid<object>("Editing") 
         . . . 
        .ClientSideEvents(eve => { eve.ActionComplete("complete"); }) 
) 
function complete(args) { 
        if ((args.requestType == "beginedit" || args.requestType == "add")) { 
 
            //Disable the save button from the inline form template 
            $("#InlineEditForm_" + this._id + "_Save").addClass("e-disable"); 
            //If you want to remove the save button from the inline form template 
            $("#InlineEditForm_" + this._id + "_Save").remove(); 
        } 
    } 
 
Regards, 
Saravanan A. 



LA LAID October 5, 2017 02:30 PM UTC

Thank you for your assistance,

Another thing I want to know is how to know that the event beginedit is triggered by RecordDoubleClick Event

if ((args.requestType == "beginedit" || args.requestType == "add")) { 

  if (event triggered by RecordDoubleClick ?? ) 
{
            //Disable the save button from the inline form template 
            $("#InlineEditForm_" + this._id + "_Save").addClass("e-disable"); 
            //If you want to remove the save button from the inline form template 
            $("#InlineEditForm_" + this._id + "_Save").remove();
        }
        }

and thank you for your help.


SA Saravanan Arunachalam Syncfusion Team October 6, 2017 05:14 AM UTC

  
Hi Laid, 
We understood from your query, you need to identify the ActionComplete event with requestType “beginedit” is triggered by the RecordDoubleClick event and we can achieved this requirement by using RecordDoubleClick event of Grid control and please refer to the below code example and api reference link. 
@(Html.EJ().Grid<object>("Editing")  
         . . .  
        .ClientSideEvents(eve => { eve.ActionComplete(“complete”).RecordDoubleClick("onRecordDblClick"); })  
)  
var isRecordDblClick = false; 
function complete(args) {  
        if ((args.requestType == "beginedit" && isRecordDblClick) || args.requestType == "add") {  
  
            isRecordDblClick = false;  
            . . . 
        }  
    }  
function onRecordDblClick (args) {  
         isRecordDblClick = true; 
} 
 
Regards, 
Saravanan A. 
 



LA LAID October 6, 2017 01:11 PM UTC

It works.

I used "e-hide" instead of "e-disable".

Thank you very much for your help & assistance.




SA Saravanan Arunachalam Syncfusion Team October 9, 2017 05:42 AM UTC

Hi Laid,  
Thanks for your update.            
We are happy that the provided information helped you. 
Regards, 
Saravanan A. 


Loader.
Up arrow icon