Hi Abu,
I am tried to figure out how to change the default date of a DatePicker.
I have tried "DefaultDate" option but no effects.
Here is the bare code:
$col = array();
$col["title"] = "FWUP";
$col["name"] = "follow_up_date";
$col["width"] = "20";
$col["align"] = "center";
$col["editable"] = true; // this column is editable
$col["editoptions"] = array("size"=>20); // with default display of textbox with size 20
$col["editrules"] = array("required"=>false, "edithidden"=>true); // and is required
# format as date
$col["formatter"] = "date";
# opts array can have these options: http://api.jqueryui.com/datepicker/
$col["formatoptions"] = array("srcformat"=>'Y-m-d',"newformat"=>'d.m.y', "opts" => array("changeYear" => true, "dateFormat"=>'yy-mm-dd', "minDate"=>"16-04-01"));
$cols[] = $col;
Thanks
You can set default value of field using defaultValue option:
$col["editoptions"] = array("size"=>20, "defaultValue" => date("m.d.Y"));
The date format should match with datepicker new format.
Complete column settings here:
$col = array();
$col["title"] = "Date";
$col["name"] = "invdate";
$col["width"] = "150";
$col["editable"] = true; // this column is editable
$col["editoptions"] = array("size"=>20, "defaultValue" => date("d.m.Y")); // with default display of textbox with size 20
$col["editrules"] = array("required"=>true, "edithidden"=>true); // and is required
# format as date
$col["formatter"] = "date";
# opts array can have these options: http://api.jqueryui.com/datepicker/
$col["formatoptions"] = array("srcformat"=>'Y-m-d',"newformat"=>'d.m.Y', "opts" => array("changeYear" => true, "dateFormat"=>'dd.mm.yy', "minDate"=>"10.05.16"));