如何开发日期选择器之类的Extjs组件?

How to develop Extjs component like date Picker?

我是 ExtJs 6.0 框架开发人员。

我想开发一个类似date that when user click it, It open a window and this window have some textfields and other Extjs components的组件。我的问题是当我想将此组件用作网格单元格编辑器时。它不显示组件。换句话说,我想开发一个自定义选择器。

我该怎么做

您可以扩展 Ext.form.field.Picker 并实施 createPicker

An abstract class for fields that have a single trigger which opens a "picker" popup below the field, e.g. a combobox menu list or a date picker. It provides a base implementation for toggling the picker's visibility when the trigger is clicked, as well as keyboard navigation and some basic events. Sizing and alignment of the picker can be controlled via the matchFieldWidth and pickerAlign/pickerOffset config properties respectively.

You would not normally use this class directly, but instead use it as the parent class for a specific picker field implementation. Subclasses must implement the createPicker method to create a picker component appropriate for the field.

它看起来像:

Ext.define('Fiddle.view.FooPicker', {

    extend: 'Ext.form.field.Picker',

    xtype: 'foo-picker',

    createPicker: function(){

        return Ext.widget('container',{
            padding: 20,
            floating: true,
            items: [
                {
                    xtype: 'textfield'
                },
                {
                    xtype: 'box',
                    html: 'Foo'
                }
            ]
        })

    }

});

https://fiddle.sencha.com/#fiddle/1139