Hi,
I've been trying for a few days now, looking in the entire forum (almost), and can't find how to do this simply. Hope you can help me on this!
I want to have a custom DateChoose for the DateItems, so that it can be dragable (to move it) and that when the calendar icon is clicked, the DateChooser appears where I tell it to (not in the middle of the icon as it is right now).
The idea that I found a couple of times, is to use a class that extends TextItem and add an icon with the click handler to show the custom DateChooser at the right place. This basically works.
The problem is that my field is now a TextItem, so I have to manually do all the job in order to parse values, set values, get values, make sure they are Date, check the format, etc.
I started doing that, and it works more or less in a DynamicForm.
But when I use this custom textitem in a grid in order to edit date values, nothing works. Can't access the icon to get the coordinates to place the DateChooser (myField.getIconPageRect(event.getIcon())), can't access the formItem to get it's coordinate, cant use the myField.getValue or super.getValue in order to set the field's value in the DateChooser. I don't really know where to find the value in question (it must be in the record of the grid...).
If I try to add my own DateChooser with an IconClickHandler on a DateItem, the original one remains, and I can't disable it.
Do you know a (simple) way to customize the DateItem in order to just use our own extension of the DateChooser? Something like: setDateChooser would be the really great and/or a way to cancel the current DateChooser from appearing.
Thank you very much for any help!
I've been trying for a few days now, looking in the entire forum (almost), and can't find how to do this simply. Hope you can help me on this!
I want to have a custom DateChoose for the DateItems, so that it can be dragable (to move it) and that when the calendar icon is clicked, the DateChooser appears where I tell it to (not in the middle of the icon as it is right now).
The idea that I found a couple of times, is to use a class that extends TextItem and add an icon with the click handler to show the custom DateChooser at the right place. This basically works.
The problem is that my field is now a TextItem, so I have to manually do all the job in order to parse values, set values, get values, make sure they are Date, check the format, etc.
I started doing that, and it works more or less in a DynamicForm.
But when I use this custom textitem in a grid in order to edit date values, nothing works. Can't access the icon to get the coordinates to place the DateChooser (myField.getIconPageRect(event.getIcon())), can't access the formItem to get it's coordinate, cant use the myField.getValue or super.getValue in order to set the field's value in the DateChooser. I don't really know where to find the value in question (it must be in the record of the grid...).
If I try to add my own DateChooser with an IconClickHandler on a DateItem, the original one remains, and I can't disable it.
Do you know a (simple) way to customize the DateItem in order to just use our own extension of the DateChooser? Something like: setDateChooser would be the really great and/or a way to cancel the current DateChooser from appearing.
Thank you very much for any help!
Comment