Hello,
I have a grid that is bound to a form similar to the “Your First App” Tutorial.
However i need the dates selected in the form to appear in YYYY-MM-DD | 2017-05-10 format.
Currently when I submit the form to the grid the format becomes the following:
Thu Apr 20 2017 00:00:00 GMT+1000 (AUS Eastern Standard Time)
My Form is generated from the following XML File:
<?xml version="1.0"?>
<items>
<item type="settings" inputWidth="220" position="label-left" labelWidth="110"/>
<item type="input" label="Units" name="Qty" offsetLeft="15"/>
<item type="input" label="Tool Code" name="ToolCode" offsetLeft="15"/>
<item type="input" label="Notes" name="Notes" offsetLeft="15" rows="5"/>
<item type="calendar" label="Date of Issue" name="Date" offsetLeft="15"/>
<item type="input" label="Signature" name="Signature" offsetLeft="15"/>
<item type="button" value="Submit" offsetTop="15" offsetLeft="230"/>
</items>
And is added to the page by the following:
InputForm = layout.cells("c").attachForm();
InputForm.loadStruct("data/form.xml");
InputForm.setCalendarDateFormat("Date", "%Y-%m-%d", "%Y-%m-%d");
InputForm.bind(toolRegister);
InputForm.attachEvent("onButtonClick", function(name){
InputForm.save();
});
var dpg= new dataProcessor ("data/toolsCustom.php");
dpg.init(toolRegister);
The Grid is initialised with the following:
var toolRegister = layout.cells("b").attachGrid();
toolRegister.setHeader("ID,Emp Code,Tool/Equipment,Units,Tool Code,Notes,Date of Issue,Signature"); //sets the headers of columns
toolRegister.setColumnIds("ID,Employee,Tool,Qty,ToolCode,Notes,Date,Signature"); //sets the columns' ids
toolRegister.setInitWidths("80,100,300,100,100,350,150,200"); //sets the initial widths of columns
toolRegister.setColAlign("left,left,left,left,left,left,left,left"); //sets the alignment of columns
toolRegister.setColTypes("ro,ro,ro,ro,ro,ro,ro,ro"); //sets the types of columns
toolRegister.setColSorting("int,str,str,int,str,na,date,na"); //sets the sorting types of columns
toolRegister.attachHeader(",,#text_filter,#text_filter,#text_filter,#text_filter,#text_filter,#text_filter");
toolRegister.setDateFormat("%Y-%m-%d","%Y-%m-%d");
toolRegister.load("data/toolsCustom.php");
toolRegister.init();
Any help would be much appreciated.