ExtJS 5 Selectable Date + Time components Datetimefield

Source: Internet
Author: User

We all know that ExtJS has a date component Datefield, but until the ExtJS 5.0 version of the date component can only select the date, can not select the time (specific to time, minutes, seconds), and the actual work will often have the need for date and time to select the demand, we can only expand their own, There are some extensions of ready-made components on the Web, either early versions, ExtJs5.0 versions, or inadequate testing, and no code to use. So I can only do it by myself. First look at the finished:

Let's talk about the idea first:

We need a component like this, first we have to have a can set the time, minutes, seconds of the component, we named Timepickerfield, and then instantiate this Timepickerfield to DatePicker, Of course we can not directly in the DatePicker source to change, so we need to inherit the datepicker extension of another component, named DateTimePicker , and the final Datetimefield to be implemented is to use this datetimepicker, and Datetimefield need to inherit Ext.form.field.Date to do the expansion.

From the above ideas we can know that to complete such an extension component, at least three files are required:

1, Timepickerfield.js

2, Datetimepicker.js

3, Datetimefield.js

The above is the general expansion of ideas and extension components of the inheritance relationship, need to obtain the full source, please click here .

ExtJS 5 Selectable Date + Time components Datetimefield

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.