5

In Sencha Architect I want to extend the Ext.form.field.Picker to create a custom component. But the Ext.form.field.Picker is not in the available toolbox elements. Can I do it somehow?

I try to override the trigger field, and change the:

extend: 'Ext.form.field.Trigger'

to

extend: 'Ext.form.field.Picker'

but it does nothing.

Daniel Hedberg
  • 5,677
  • 4
  • 36
  • 61
HyGy
  • 121
  • 3
  • 10
  • Refer following link, you may get some idea. http://stackoverflow.com/questions/6092112/ext-ux-form-field-datetime-questions – extjs user Apr 10 '13 at 15:06
  • 2
    Create new 'class' which allows you to specify the extends attribute, unfortunately then not the 'picker' attributes. or write your own by creating a js 'resource' and put it in your resources/ux folder. Then you can call it eg: Common.ux.picker.MyPicker goes into resources/ux/picker/MyPicker.js then hit the + (plus) next to loader on the 'application' node and add an item to the array {'MyApp:'.','Global':'resources'} and then the app will find your extension. – Dawesi Dec 06 '13 at 06:18
  • If I understand correctly you are trying to build a component based on `Ext.form.field.Picker`. From the docs `Ext.form.field.Picker` is an abstract class and should not be used directly. Subclasses must implement the createPicker method to create a picker component appropriate for the field. Combobox, Date, Time etc. extend from this class. So you can use these to build your component. – dev Jun 04 '14 at 08:48

1 Answers1

0

In your Sencha Architect (preferably version 3.1) click on the plus sign (top right corner) inside the Project Inspector, select Class and View.

You will get a new empty class being extended from Ext.Base. Change the extend property to Ext.form.field.Picker and you should get a popup asking "Would you like to transform this Class to a Ext.form.field.Picker, to enable full configuration and behavior". Click yes and you should be good to go.

Guilherme Lopes
  • 4,688
  • 1
  • 19
  • 42