Advertisement
fahmihilmansyah

ext combo

May 1st, 2014
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Ext.define('TUL.view.Unit' ,{
  2.    
  3.     extend: 'Ext.window.Window',
  4.     alias: 'widget.unittul',
  5.     title: 'All Users',
  6.     title: '..::: Selamat Datang  :::..',
  7.     layout: 'fit',
  8.     height: '55%',
  9.     width: '35%',
  10.     closable: true,
  11.     autoShow: true,
  12.     initComponent: function() {
  13.          this.items = [
  14.             {
  15.                         xtype: 'panel',
  16.                         title: 'Search the Ext Forums',
  17.                         width: 600,
  18.                         bodyPadding: 10,
  19.                         layout: 'anchor',
  20.                         items:[{
  21.                             xtype: 'combo',
  22.                             store : 'Unit',
  23.                             displayField: 'title',
  24.                             emptyText:'Cari Unit',
  25.                             minChars: 1,
  26.                             value :'',
  27.                             typeAhead: false,
  28.                             hideLabel: true,
  29.                             hideTrigger:true,  
  30.                             anchor: '100%',
  31.                             name :'cari',
  32.                             listConfig: {
  33.                                 loadingText: 'Searching...',
  34.                                 emptyText: '<b>Unit</b> yang anda cari tidak ada.',
  35.                                 // Custom rendering template for each item
  36.  
  37.                 /*
  38.                  //Ini kenapa datanya gak ke load
  39.                  //padahal di response udah tampil*/
  40.                                 getInnerTpl: function() {
  41.                                     return  '<div class="search-item">' +
  42.                                             '<h3><span>{strkode_dealer}<br />by {strnama_dealer}</span>{strnama_dealer}</h3>' +
  43.                                             '<h3>ID Unit : {intid_unit}</3><br>' +
  44.                                             '<h4>Nama Unit : {strnama_unit}</h4></div>';
  45.                                 }
  46.                
  47.                
  48.                             },
  49.                             pageSize: 10,
  50.                             // override default onSelect to do redirect
  51.                             listeners: {
  52.                                 select: function(combo, selection) {
  53.                                     var post = selection[0];
  54.                     alert(post.get('strnama_unit'));                                    
  55.                                 }
  56.                             }
  57.                         }]
  58.             }
  59.         ];
  60.         this.buttons = [
  61.             {
  62.                 text: 'Save',
  63.                 action: 'save'
  64.             },
  65.             {
  66.                 text: 'Cancel',
  67.                 scope: this,
  68.                 handler: this.close
  69.             }
  70.         ];
  71.         this.callParent(arguments);
  72.     }
  73. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement