Help on bind form and datepicker

I made a simple snippet http://webix.com/snippet/a26957e3
Why the date in European format, {id:“1”, title: “Start date”, date:“30-01-1991”}, becomes a strange date in datepicker (06/14/1935)?

The default format (webix.i18n.parseFormat) is %Y-%m-%d. It can be changed if it is needed:

http://webix.com/snippet/c3c68c2e

Thank you Maria. I suppose it is a global solution, will affects all the widgets in the script, right? Is there a local solution?

will affects all the widgets in the script, right?

Yes. But incoming date format should be consistent in all views. Don’t you think so ?

All views expect that the date values will be loaded in the webix.i18n.parseFormat format. The format is different in your demo. So, you need to correct something:

  • either load data in a correct format
  • or transform datatable values using data scheme
  • or change parseFormat that corresponds date format in your datasource

http://webix.com/snippet/ce9cb5ab

Yes, you are right, but I’m working on a single web application which interfaces differents types of database (MsSql, MySQL, Oracle) at the same time. I do everything dinamically at run-time (CRUD interface) so I have to create forms elements and datatable columns on the fly reading the database system tables. This latter snippet is more suitable for my need. Thank you.

Now you can comprise the other question I have posted (about $init function in the scheme property).

This snippet does exactly what I do loading the json value, but I can’t set the $init function.

Doh. Right now I have realized that I can’t use sheme in serverside data loading logic. Forgive me for your wasted time.

Any suggestion to put obj.date = formatStr(obj.date); somewhere when loading data serverside ?

Hi,

scheme $init is called when data items are parsed. And it will be applied if you load data from an external datasource.