-
[CLOSED] Custom Control
Hi,
as per a UI requirement, i need to implement a DateField custom control that will allow selection of Date, month and year from three different adjacent dropdown. But developer should be able to get and set the date value to the control like customCtrl.value = date;
Can you please give me a some clue to get started.
Thanks in advance.
-
Hi,
Two thoughts:
1) Is it not possible to use the existing DateField or DatePicker as that offers a lot more flexibility and usability benefits compared to 3 separate dropdown fields? https://examples3.ext.net/#/search/datefield
2) If you do need to do it this way, perhaps extending a FieldContainer would be the way to go so you can reuse this combination elsewhere on your forms as needed? https://examples3.ext.net/#/Form/Fie...iner/Overview/ - also see Ext JS documentation: https://docs.sencha.com/extjs/5.1/5....FieldContainer
For a custom FieldContainer, you may be better off creating the subclass as an Ext JS subclass of FieldContainer with appropriate Value related fields to then send the right date parts to your relevant dropdowns, and then on the Ext.NET side, create a subclass the renders your JavaScript subclass.
For more information on how to get started on that I answered a similar post about a year ago here with some other links to other forums topics that help:
http://forums.ext.net/showthread.php...uilder-classes
Although I am not trying to plug my book, chapter 9 on custom controls could be quite helpful as well, if you have it?
Hope that helps?