Question

I want to use long notation of item type instead of xtype. Can I use

{
  title: 'Home',
  iconCls: 'home',
  type: 'Ext.dataview.DataView',
  tabBarPosition: 'bottom',
  store: homeMenuStore,
  itemTpl: homeMenuTpl,
  flex: 1
}

instead of

{
  title: 'Home',
  iconCls: 'home',
  xtype: 'dataview',
  tabBarPosition: 'bottom',
  store: homeMenuStore,
  itemTpl: homeMenuTpl,
  flex: 1
}
Was it helpful?

Solution

What you are looking for is xclass:

{
    xclass: 'Ext.dataview.DataView',
    ...
}

OTHER TIPS

If you prefer to use long notation you would do like this:

Ext.create('Ext.DataView', {
    title: 'Home',
    iconCls: 'home',
    tabBarPosition: 'bottom',
    store: homeMenuStore,
    itemTpl: homeMenuTpl,
    flex: 1
});

or you can create your own class and extend DataView:

Ext.define('myOwnDataview', {
    extend: 'Ext.DataView',
    config: {
         title: 'Home',
         iconCls: 'home',
         tabBarPosition: 'bottom',
         store: homeMenuStore,
         itemTpl: homeMenuTpl,
         flex: 1 
    }
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top