I have date field with date range picker:
$col = array();
$col[“title”] = “Date”;
$col[“name”] = “invdate”;
$col[“width”] = “25”;
$col[“formatter”] = “date”; // makes field required???
$col[“formatoptions”] = array(“srcformat”=>’Y-m-d’,”newformat”=>’Y-m-d’);
$col[“editable”] = true; // this column is editable
$col[“sortable”] = true;
$col[“searchoptions”][“opts”] = array(“initialText”=>”Paieškos periodas”);
$col[“editrules”] = array(“required”=>false, “edithidden”=>true);
$cols[] = $col;
When adding new row I got error message when Date field has no value:
Couldn’t execute query. Column ‘invdate’ cannot be null – INSERT INTO invheader (`client_id`,`seller`,`buyer`,`invoice_number`,`invdate`,`due_date`,`amount`,`tax`,`total`,`sell_purch`,`status`,`note`) VALUES (‘1′,”,”,”,NULL,NULL,”,”,”,’ ‘,’ ‘,”)
$col[“formatter”] = “date”;
line makes field required, because if I comment this line, no error message with empty Date field. But no date picker on the field. If I edit row value and delete date from this field, no error message.
How to fix it?
Hi,
I’m unable to generate this issue here. I’ve sent you latest build to test with.
If you still face this issue with new build as well, please send me your grid code and database dump to generate exact case here.