dimanche 7 décembre 2014

Use Ext.picker.slot in custom component ?

Hi,

Is it possible to use a "Ext.picker.slot" inside a custom component?

This class is marked as "private" and it seems we shouldn't rely on its existence...

However, this is exactly what I need to build my custom component:

a special month/year picker like this:

picker.png


Additionally, when I add it to the custom picker, I have several problems:



  • the "x-picker-slot" class is not present, so css are not applied

  • when I scroll the picker slot, I get the following error:

    "Uncaught TypeError: Cannot read property 'dom' of undefined"


Here is the code I used:


Code:



Ext.define('Ext.MyMonthPad',{
extend: 'Ext.Panel',
xtype: 'mymonthpad',


config: {

layout: 'hbox',

top: 0,
zindex: 1000,
width: '16em',

// Value
value: new Date(),
pDateMin: new Date(),
pDateMax: Ext.Date.add( new Date(), Ext.Date.MONTH, 240 ),


modal: true,
hideOnMaskTap: true,
hidden: true,

items: [
{
xtype: 'segmentedbutton',
allowMultiple: false,
flex: 4,
defaults: {
xtype: 'button',
width: '25%',
style: 'float: left;'
},
items: [
{ text: 'Jan' },
{ text: 'Feb' },
{ text: 'Mar' },
{ text: 'Apr' },
{ text: 'May' },
{ text: 'Jun' },
{ text: 'Jul' },
{ text: 'Aug' },
{ text: 'Sep' },
{ text: 'Oct' },
{ text: 'Nov' },
{ text: 'Dec' }
]
},
{
xtype: 'pickerslot',
flex: 2,
name: 'year',
store: {
fields: [ 'text', 'value' ],
data: vYears
}
}
]
}

...


});





Use Ext.picker.slot in custom component ?

Aucun commentaire:

Enregistrer un commentaire