Sunday, July 17, 2016

How to disable DatePicker using Jscript

My friend had a requirement disable a DatePicker, He has tried several options

image

But this property only disable DatePicker textbox. User can change date using calendar dropdown.

There is a property CanEdit. Developer can use CanEdit property to disable.

image

image

 

1. Sample Code :

image

2. With Readonly property

image

var content : Object = controller.RenderEngine.Content;
// TODO Add your code here
var wapudt =  ScriptUtil.FindChild(content, "WAPUDT");
wapudt.IsReadOnly = true;

3. With CanEdit,CanSelect property

var content : Object = controller.RenderEngine.Content;
// TODO Add your code here
var wapudt =  ScriptUtil.FindChild(content, "WAPUDT");
wapudt.CanEdit = false;
wapudt.CanSelect = false;

 

Technorati Tags: ,,,,