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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Enable or disable a daterimpicker in grid

Thread ID:

Created:

Updated:

Platform:

Replies:

128847 Feb 13,2017 12:20 AM UTC Feb 14,2017 01:21 PM UTC ASP.NET Core 3
loading
Tags: Grid
franco perduca
Asked On February 13, 2017 12:20 AM UTC

Hi
How is possibile via javascript to enable or disable a datetimepicker  in column in a grid ?
Thank you for your support
Franco

Jayaprakash Kamaraj [Syncfusion]
Replied On February 13, 2017 10:38 AM UTC

Hi Franco, 

Thank you for contacting Syncfusion support. 

We have achieved your requirement using actioncomplete event of ejGrid. In this we can disable/enable dateTimePicker using enable/disable method of ejDateTimePicker. Please refer to the below help document,  code example and sample. 





 
<ej-grid id="GridContainer" 
         allow-resize-to-fit="true" 
         allow-sorting="true" 
         allow-text-wrap="true" 
         allow-paging="true" 
         is-responsive="true" 
         datasource="ViewBag.data" action-complete="actioncomplete" 
         enable-responsive-row="true"> 
    ……………… 
 
       <e-column field="CustomerID" header-text="CustomerID" /> 
        <e-column field="EmployeeID" header-text="EmployeeID" /> 
        <e-column field="OrderDate" header-text="OrderDate" type="datetime" edit-type="DateTimePicker" /> 
    </e-columns> 
</ej-grid> 
 
 
<script type="text/javascript"> 
    function actioncomplete(args) { 
         
        if (args.requestType == "beginedit") { 
            if (args.rowData.EmployeeID == 2) 
                $("#GridContainerOrderDate").ejDateTimePicker("disable"); // here we have disbaled dataTimePicker 
            else 
                $("#GridContainerOrderDate").ejDateTimePicker("enable"); // here we have enabled dataTimePicker 
        } 
    } 
</script> 

If we have misunderstood your requirement, then please share more details about your requirement it will help us to provide the prompt solution                                                                              


Regards, 

Jayaprakash K. 


franco perduca
Replied On February 13, 2017 07:57 PM UTC

Thank you it works!!!!

ps there same mistake in you doc

https://help.syncfusion.com/api/js/ejgrid#events:actioncomplete
the param is args.rowData not args.row 

correct ?

Thank you

Jayaprakash Kamaraj [Syncfusion]
Replied On February 14, 2017 01:21 PM UTC

Hi Franco 
 
In actionComplete event we will get args.row and args.rowData. 
 
args.row => Returns the current edited row. 
 
args.rowData = >  returns the Record object (JSON). 
 
We have modified our UG documentation for the particular event(actionComplete) and it will be published shortly. We will let you once it is refreshed online. 
Regards,  
  
Jayaprakash K.   


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;