I am developing a project with the “htmlxSuite 2012 Rel.1 (DHTMLX 3.5) Professional edition build 120731” version and have a problem with retrieving values stored in PHP date type fields, a Sql Server 2008 DB.
I have the following js and css included (no error location):
In FormData, if I use the following statement to define the field ("$ FechaRecepcion" is the variable that receives the PHP):
{
type "calendar"
dateFormat: "% d /% m /% Y"
value: "'$ FechaRecepcion..'"
name: "FechaRecepcion"
label: "FechaRecepcion"
serverDateFormat: "% Y /% m /% d",
skin: "dhx_skyblue"
enableTime: true,
calendarPosition "right"
},
It gives me the error ...:
Uncaught TypeError: undefined is not a function
1 Uncaught TypeError: undefined is not a function dhtmlxcalendar.js: 829
1 _strToDatedhtmlxcalendar.js: 829
2 dhtmlXForm.items.calendar.setValuedhtmlxform_item_calendar.js: 65
3 doWithItemdhtmlxform.js 512
4 setItemValuedhtmlxform.js: 649
5 (anonymous function) estudios.php: 449
6.-1.7.1.js jQuery.extend.eachjquery: 653
7 (anonymous function) estudios.php: 448
8.-1.7.1.js firejquery: 1047
Self.fireWithjquery-1.7.1.js 9: 1165
10.-1.7.1.js donejquery: 7400
11. callback
The format of "FechaRecepcion" in SQL Server is "07/17/2014 14: 10: 34.530" (type "datetime").
If I put the statement:
{type: "input", label: "FechaRecepcion", name: "FechaRecepcion", value: "'.. $ FechaRecepcion'"}
In the box ... Text "object Object" appears.
I have no problem to record a date (works OK). The problem is only to recover the data saved.
Thanks in advance for your help.
Best Regards,
Jaime Rodriguez
Forcing the value:
{
type “calendar”
dateFormat: “% d /% m /% Y”
value “07/17/2014”
name: “FechaRecepcion”
label: “FechaRecepcion”
serverDateFormat: “% Y /% m /% d”,
skin: “dhx_skyblue”
enableTime: true,
calendarPosition “right”
},
also gives me error the following values:
(…) Value “07/17/2014 14: 10: 34.530” (…)
(…) Value “07/17/2014” (…)
/[b]/ formatting the date type fields: -----------------------------------------
$ fecha_aux = $ r [“FechaRecepcion”];
// the format in which it is stored in the sql server is “07/17/2014 14: 10: 34.530”
$ r [“FechaRecepcion”] = $ fecha_aux-> format (‘Y / m / d’);
------------------------------------------------ // ------------------------- [/b]
$ array_final = array (‘result’ => 1, ‘data’ => $ r);
miss json_encode ($ array_final);
}
// ** In javascript: ************************************
(…) {
type “calendar”
dateFormat: “% d /% m /% Y”
value: “’$ FechaRecepcion…’”
name: “FechaRecepcion”
label: “FechaRecepcion”
serverDateFormat: “% Y /% m /% d”,
skin: “dhx_skyblue”
enableTime: true,
calendarPosition “right”
}, (…)
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan