jQuery UI Widgets › Forums › Grid › jqxDateTimeInput (''dd.MMM.yyyy' format) in GridElement bug
Tagged: Cell, cellsformat, columntype, custom, datetimeinput, editor, format, formatString, grid, jqxdatetimeinput, jqxgrid
This topic contains 8 replies, has 2 voices, and was last updated by ioana 9 years, 7 months ago.
-
Author
-
Hi jqWidgets team,
I am using the jqxDateTimeInput as editor for a custom cell in Grid.
The formatString is “dd.MMM.yyyy”.When the cell is selected (for example 25.Jan.2013) the value in editor changes to “25.01.2013”. This is a feature as I see to ease the edit. The problem is after the value has changed (“26.01.2013”) without using the picker, and the cell looses focus, the value in the cell is “26.01.2013” and not “26.Jan.2013” as I would expect. The behavior is yet correct (and different) if the picker is used.
See fiddle: https://jsfiddle.net/ioana_v/8y0L87gs/15/Can you please help me with this?
Thank you,
IoanaHi Ioana,
I have made some changes to your fiddle (adding datafields definition and changing the columntype from ‘custom’ to ‘datetimeinput’) and it works fine now. You can check the modified version here: https://jsfiddle.net/Dimitar_jQWidgets/9mzzqopz/.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar,
I can not use columntype ‘datetimeinput’, there is a reason why I use ‘custom’.
So I need a solution for ‘custom’ columnType. This seem to be a bug.Regards,
IoanaHi Ioana,
There is no bug with this feature. Here is another modification of your example, showing how to implement
columntype: 'custom'
: http://jsfiddle.net/Dimitar_jQWidgets/9mzzqopz/5/.Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar,
thank you.
I need to determine the cellsFormat, so I need a function (like for cellsrenderer). Can you please let me know what are the parameters for this function?
For example for cellsrenderer are: row, columnfield, value, defaulthtml, columnproperties.Regards,
IoanaHi Ioana,
I am not sure what function you are referring to. The cellsformat property has to be set to a string value. Please clarify your requirement.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar,
What I need is: instead of setting the cellsformat: “dd.MMM.yyyy”, I need a function that will return this value, depending on the cell. Each cell can be different in my implementation, and each cell can have a different cellsformat. The format is defined in a JSON structure.
When I create the Grid, I need to check the json value for “format”, depending on the row and column.
Something like:cellsformat:retrieveCellFormat .... var retrieveCellFormat= function (row, columnfield, ..........) { if (row===1 && columnfield==='col1') { return 'dd.MM/yyy'; } else { return 'dd/MMM.yyyy'; } }
Hi Ioana,
This can be achieved in cellsrenderer with the help of the data adapter method formatDate (read more about it here: http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxdataadapter/jquery-data-adapter.htm).
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar,
thank you, I will try to figure out how to implement it.
Regards,
Ioana -
AuthorPosts
You must be logged in to reply to this topic.