Advertisement
Guest User

Events on fields

a guest
May 25th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var shows = Ext.create('Ext.data.Store', {
  2.     fields: ['id','show'],
  3.     data: [
  4.         {id: 0, show: 'Battlestar Galactica'},
  5.         {id: 1, show: 'Doctor Who'},
  6.         {id: 2, show: 'Farscape'},
  7.         {id: 3, show: 'Firefly'},
  8.         {id: 4, show: 'Star Trek'},
  9.         {id: 5, show: 'Star Wars: Christmas Special'}
  10.     ]
  11. });
  12.  
  13. Ext.create('Ext.form.Panel', {
  14.     renderTo: Ext.getBody(),
  15.     title: 'Sci-Fi Television',
  16.     height: 200,
  17.     width: 500,
  18.     items: [{
  19.         xtype: 'tagfield',
  20.         fieldLabel: 'Select a Show',
  21.         store: shows,
  22.         displayField: 'show',
  23.         valueField: 'id',
  24.         queryMode: 'local',
  25.         filterPickList: true,
  26.         listeners: {
  27.             change: {
  28.                 fn: function(){ console.log('Fiddle Change!')}
  29.             },
  30.             expand: {
  31.                 fn: function(){ console.log('Fiddle expand!')}
  32.             },
  33.             collapse: {
  34.                 fn: function(){ console.log('Fiddle collapse!')}
  35.             }
  36.         }
  37.     }]
  38. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement