Advertisement
MX37S

UsuariosServicesGrid.js

Aug 9th, 2021
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Ext.ux.ServiceStore = Ext.extend(Ext.data.JsonStore, {
  2.     constructor: function(config){
  3.         Ext.ux.ServiceStore.superclass.constructor.call(this, Ext.apply({
  4.             root: 'data',
  5.             totalProperty: 'total',
  6.             fields: [
  7.                'id','userName', 'tpo_Nro_Documento', 'nombre', 'apellido','email'
  8.             ],
  9.             url: './usuarios-list.html',
  10.             sortInfo: {field: 'apellido', direction:'ASC'},
  11.             remoteSort: true
  12.         }, config));
  13.     }
  14. });
  15. Ext.reg('servicestore', Ext.ux.ServiceStore);
  16.  
  17. Ext.ux.UsuariosServicesGrid = Ext.extend(Ext.grid.GridPanel, {
  18.     initComponent:function() {
  19.         var config = {
  20.             border: false,
  21.             frame:true,
  22.             autoScroll: true,
  23.             loadMask: true,
  24.             stripeRows: true,
  25.             layout: 'fit',
  26.             viewConfig: {forceFit:true},
  27.             store: new Ext.ux.ServiceStore(),
  28.             sm: new Ext.grid.RowSelectionModel({singleSelect: true}),
  29.             columns:[{
  30.                 header: "Usuario",
  31.                 dataIndex: 'userName',
  32.                 sortable: true,
  33.                 width: 150
  34.             },{
  35.                 header: "Apellido",
  36.                 dataIndex: 'apellido',
  37.                 width: 200,
  38.                 sortable: true
  39.             },{
  40.                 header: "Nombre",
  41.                 dataIndex: 'nombre',
  42.                 sortable: true,
  43.                 width: 150
  44.             },{
  45.                 header: "Documento",
  46.                 dataIndex: 'tpo_Nro_Documento',
  47.                 sortable: true,
  48.                 align: 'center',
  49.                 width: 150
  50.             },{
  51.                 header: "E-mail",
  52.                 dataIndex: 'email',
  53.                 sortable: true,
  54.                 groupable: true,
  55.                 align: 'center',
  56.                 width: 200
  57.             }],
  58.             plugins: [new Ext.ux.grid.GridFilters({
  59.                 encode: true,
  60.                 updateBuffer: 2000,
  61.                 filters: [{
  62.                         dataIndex: 'apellido',
  63.                         type: 'string'
  64.                     },{
  65.                         dataIndex: 'nombre',
  66.                         type: 'string'
  67.                     },{
  68.                         dataIndex: 'userName',
  69.                         type: 'string'
  70.                     },{
  71.                         dataIndex: 'email',
  72.                         type: 'string'
  73.                     }]
  74.                 })
  75.             ],
  76.             tbar:[{
  77.                 text:'Aprobar',
  78.                 tooltip:'Aprueba usuario de autogestión',
  79.                 iconCls:'accept',
  80.                 scope: this,
  81.                 handler: this.aprobar
  82.             },{
  83.                 text:'Desaprobar',
  84.                 tooltip:'Desaprueba usuario de autogestión',
  85.                 iconCls:'delete',
  86.                 scope: this,
  87.                 handler: this.desaprobar
  88.             }]
  89.         }; // eo config object
  90.        
  91.         // apply config
  92.         Ext.apply(this, Ext.apply(this.initialConfig, config));
  93.  
  94.        
  95.         this.bbar = new Ext.PagingToolbar({
  96.             pageSize: 15,
  97.             store: this.store,
  98.             plugins: this.plugins,
  99.             displayInfo: true,
  100.             displayMsg: 'Mostrando registros {0} - {1} de {2}',
  101.             emptyMsg: "No existen elementos a mostrar"
  102.         });
  103.        
  104.         Ext.ux.UsuariosServicesGrid.superclass.initComponent.apply(this, arguments);
  105.     } // eo function initComponent
  106.  
  107. });
  108. Ext.reg('usuariosservicesgrid', Ext.ux.UsuariosServicesGrid);
  109.  
  110. Ext.ux.BaseComboBox = Ext.extend(Ext.form.ComboBox, {
  111.     initComponent:function() {
  112.         var config = {
  113.                 displayField:'label'
  114.                 ,valueField: 'value'
  115.             ,emptyText:'Selecione un Item...'
  116.             ,    width: 200
  117.             ,forceSelection: true
  118.             ,triggerAction: 'all'
  119.             ,queryDelay: 100
  120.             ,typeAhead: true
  121.             ,editable: true
  122.             ,mode: 'remote'
  123.            
  124.         }; // eo config object
  125.    
  126.         // apply config
  127.         Ext.apply(this, Ext.apply(this.initialConfig, config));
  128.    
  129.         Ext.ux.BaseComboBox.superclass.initComponent.apply(this, arguments);
  130.     } // eo function initComponent
  131.  
  132. });
  133.  
  134. /*
  135. Ext.ux.RolesComboBox = Ext.extend(Ext.ux.BaseComboBox, {
  136.     store: new Ext.data.JsonStore({
  137.         root: 'data',
  138.         fields: ['value', 'label'],
  139.         url: './buscarRoles.html'
  140.         })
  141.  
  142. });
  143. Ext.reg('rolescombo', Ext.ux.RolesComboBox);   
  144.  
  145. Ext.ux.ClientesComboBox = Ext.extend(Ext.ux.BaseComboBox, {
  146.     store: new Ext.data.JsonStore({
  147.     root: 'data',
  148.     fields: ['value', 'label'],
  149.     url: './buscarClientes.html
  150.     })
  151.  
  152. });
  153.  
  154. Ext.reg('clientescombo', Ext.ux.ClientesComboBox);
  155.  
  156. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement