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

Enable or disable a daterimpicker in grid

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

3 Replies

JK Jayaprakash Kamaraj Syncfusion Team 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" 
         datasource="ViewBag.data" action-complete="actioncomplete" 
       <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" /> 
<script type="text/javascript"> 
    function actioncomplete(args) { 
        if (args.requestType == "beginedit") { 
            if (args.rowData.EmployeeID == 2) 
                $("#GridContainerOrderDate").ejDateTimePicker("disable"); // here we have disbaled dataTimePicker 
                $("#GridContainerOrderDate").ejDateTimePicker("enable"); // here we have enabled dataTimePicker 

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


Jayaprakash K. 

FP franco perduca February 13, 2017 07:57 PM UTC

Thank you it works!!!!

ps there same mistake in you doc

the param is args.rowData not args.row 

correct ?

Thank you

JK Jayaprakash Kamaraj Syncfusion Team 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. 
Jayaprakash K.   

Live Chat Icon For mobile
Up arrow icon