Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 17th, 2012  |  syntax: None  |  size: 1.99 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. sencha touch list-component
  2. Ext.regModel('Complementarias', {
  3. fields: ['MiniAct', 'Actividad', 'Fecha', 'Mes']
  4. });
  5.  
  6. var store = new Ext.data.JsonStore({
  7. model  : 'Complementarias',
  8. sorters: 'MiniAct',
  9. getGroupString : function(record) {
  10.     return record.get('MiniAct')[0];
  11. },
  12. data: [
  13.     {MiniAct: '1', Actividad: '2', Mes: '3', Fecha: '4' }
  14. ]
  15. });
  16.  
  17. baApp.detailPanel = new Ext.Panel({
  18.         id: 'detailpanel',
  19.         itemTpl: 'testa',
  20.         html: '',
  21.         dockedItems: [
  22.             {
  23.                 xtype: 'toolbar',
  24.                 title: "Extensión",
  25.                 ui: "light",
  26.                 items: [{
  27.                     text: 'atrás',
  28.                     ui: 'back',
  29.                     handler: function() {
  30.                         Extension.setActiveItem('indexlist', {type:'slide',     direction:'right'});
  31.                     }
  32.                 }]
  33.             }
  34.         ]
  35.     });
  36.  
  37. baApp.listPanel = new Ext.List({
  38. id: 'indexlist',
  39. itemTpl : '<div id="extension"><h1>{MiniAct}</h2><br><h2>{Fecha}</h2></div>',
  40. grouped : true,
  41. store: store,
  42. onItemDisclosure: true,
  43. listeners:{
  44.             itemtap: function(view, index, item, e){
  45.             baApp.detailPanel.update(view.data);
  46.             Extension.setActiveItem('detailpanel', {type:'slide', direction:'left'});
  47.         }
  48.     }
  49. });
  50.  
  51. Extension = new Ext.Panel({
  52. layout: 'card',
  53. iconCls: 'chat3',
  54. title:"Extensión",
  55. defaults: {
  56.     scroll: 'vertical'
  57. },
  58. items: [baApp.listPanel, baApp.detailPanel]
  59. });
  60.  
  61.  
  62.  
  63.  
  64. baApp.views.Viewport = Ext.extend(Ext.TabPanel, {
  65. fullscreen: true,
  66. style: "background-color: white;",
  67. tabBar: {
  68.     dock: 'bottom',
  69.     sortable: true,
  70.     layout: {
  71.     pack: 'center'
  72.     }
  73. },
  74. items: [
  75. {xtype: 'inicio'},
  76. {xtype: 'planes'},
  77. Extension,
  78. {xtype: 'plano'},
  79. {xtype: 'directorio'}
  80. ]
  81.  
  82. });
  83.        
  84. listeners: {
  85.     itemtap: function( view, index, item, e ) {
  86.         var rec = view.getStore().getAt(index);
  87.         baApp.detailPanel.update(rec.data);
  88.         Extension.setActiveItem('detailpanel', {type:'slide', direction:'left'});
  89.     }
  90. }