Advertisement
grdmunoz

Untitled

Feb 26th, 2014
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. ////////// controller
  3.  
  4. Ext.define('couchtest.controller.MyController', {
  5.     extend: 'Ext.app.Controller',
  6.  
  7.     config: {
  8.         control: {
  9.             ".staff-update-button": {
  10.                 tap: 'onupdatetap'
  11.             }
  12.         }
  13.     },
  14.  
  15.     onupdatetap: function(button, e, eOpts) {
  16.         // Ext.alert("got here");
  17.         console.log("got here");
  18.     },
  19.  
  20.     launch: function() {
  21.                 var staff_store_load = Ext.getStore("staff_store");
  22.         // staff_store_load.load();
  23.  
  24.         staff_store_load.load({
  25.             callback: function(records) {
  26.                 // the operation object contains all of the details of the load operation
  27.                 console.log(records);
  28.             },
  29.             scope: this
  30.         });
  31.     }
  32.  
  33. });
  34.  
  35.  
  36. ////////// view
  37.  
  38.  
  39. Ext.define('couchtest.view.MyGrid', {
  40.     extend: 'Ext.grid.Grid',
  41.  
  42.     requires: [
  43.         'Ext.grid.column.Template',
  44.         'Ext.XTemplate'
  45.     ],
  46.  
  47.     config: {
  48.         store: 'staff_store',
  49.         title: 'Staff',
  50.         columns: [
  51.             {
  52.                 xtype: 'column',
  53.                 width: 200,
  54.                 dataIndex: 'fn',
  55.                 text: 'first name'
  56.             },
  57.             {
  58.                 xtype: 'column',
  59.                 width: 200,
  60.                 dataIndex: 'ln',
  61.                 text: 'last name'
  62.             },
  63.             {
  64.                 xtype: 'templatecolumn',
  65.                 tpl: [
  66.                     '<tpl>',
  67.                     '<div class="x-button-normal x-button staff-update-button" id="ext-button-1" >',
  68.                     '   <span class="x-button-icon action" id="ext-element-11" style=""></span>',
  69.                     '</div>',
  70.                     '<tpl>'
  71.                 ],
  72.                 width: 300,
  73.                 text: 'edit'
  74.             }
  75.         ]
  76.     }
  77.  
  78. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement