hello everybody, i have problem when trying to binding data from datastore or grid to form calender its not work and give the following errors:
d is null
strToDate(a=div.item_label_left, b="")dhtmlx.js (line 868)
setValue(a=div.item_label_left, b="")dhtmlx.js (line 869)
doWithItem(a=“P_CREATE_DATE”, b=“setValue”, c="", d=undefined, i=undefined, j=undefined)dhtmlx.js (line 772)
getItemValue(a=“P_CREATE_DATE”, b="")dhtmlx.js (line 777)
setFormData(a=Object { id=“1”, P_ID=“1”, P_STATUS=“2”})dhtmlx.js (line 852)
_bind_update_common(target=dhtmlXForm /undefined/, rule=undefined, data=Object { id=“1”, P_ID=“1”, P_STATUS=“2”})datastore.js (line 1110)
_bind_update(target=dhtmlXForm /undefined/, rule=undefined)datastore.js (line 1204)
getBindData(key=“1326044737467”, update=true)datastore.js (line 1097)
_update_binds()datastore.js (line 1105)
dhtmlxEventable()dhtmlx.js (line 42)
dhtmlxEventable(a=“ev_onaftercursorchange”, c=[“1”])dhtmlx.js (line 42)
setCursor(id=“1”)datastore.js (line 1198)
$init()datastore.js (line 1182)
dhtmlxEventable()dhtmlx.js (line 42)
dhtmlxEventable(a=“ev_onselectchange”, c=[“1”])dhtmlx.js (line 42)
(?)(id=“1”)datastore.js (line 1461)
dhtmlxEventable()dhtmlx.js (line 42)
dhtmlxEventable(a=“ev_onselectstatechanged”, c=[“1”, null])dhtmlx.js (line 42)
doClick(a=td., b=true, d=0, h=undefined)dhtmlx.js (line 934)
_doClick(a=click clientX=462, clientY=216)dhtmlx.js (line 930)
onscroll(a=click clientX=462, clientY=216)
I have the same problem when the calendar field is blank but I have no solution to save a null date, sorry. If you have a tip to save a null date I’m interested.
I solved my problem of “d is null” when the date field is empty.
In my form I changed the type of item “calendar” to type “input”.
var formData = [
{type: "input", serverDateFormat: "% d /% m /% Y", dateFormat: "% d /% m /% Y", name: "dateEtat", label: "Date etat", labelWidth: "125 "labelHeight:" 21 ", inputWidth:" 125 ", inputHeight:" 21 ", labelLeft:" 140 ", labelTop:" 15 ", inputLeft:" 140 ", inputTop:" 36 ", position:" absolute "} ];
and attaching to the field “input” name “dateEtat” a calendar object in the following way:
myForm = layout.cells("b").attachForm(formData);
//---binding the grid to the dataStore. Loading data from the dataStore to the grid---
myGrid.sync(convention);
//--- binding the form to the grid. Presenting record's details in the form ---
myForm.bind(myGrid);
/ / - Retrieve the object of the form myForm INPUT dateEtat
var maDateEtat = myForm.getInput("dateEtat");
/ / - Change the id generic dhtmlx given by a personal ID
maDateEtat.id="IDdateEtat";
/ / - Create the schedule and association field INPUT
myCalendar = new dhtmlXCalendarObject("IDdateEtat");
/ / - Change the date format returned by the calendar
myCalendar.setDateFormat("%d/%m/%Y");
Last modification to save the selected date !
/ / - Resets the focus to the area after INPUT selection in the calendar (if the selected value is not taken into account when saving data (myForm.save () ;).
var myEvent = myCalendar.attachEvent("onChange", function (){
/ / Event handler code
myForm.setItemFocus ("dateEtat");
})
var myEvent = myCalendar.attachEvent("onClick", function (){
/ / Event handler code
myForm.setItemFocus ("dateEtat");
})