Guest User

Untitled

a guest
May 26th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. dojo.provide('app.views.master.ProdukPanel');
  2.  
  3. dojo.require('dijit.layout.ContentPane');
  4. dojo.require('dijit.layout.BorderContainer');
  5. dojo.require('dojox.grid.DataGrid');
  6. dojo.require('dojox.form.Manager');
  7. dojo.require('dijit.form.ValidationTextBox');
  8.  
  9. dojo.require('app.views.master.form.ProdukForm');
  10. dojo.require('app.views.master.grid.TableProduk'); //Tambahkan
  11. dojo.require('dijit.form.Form');
  12.  
  13. dojo.declare('app.views.master.ProdukPanel', null, {
  14.     produkTable: null,
  15.     form: null,
  16.     mainPanel: null,
  17.    
  18.     constructor: function(id, titlePanel) {
  19.         this.initComponents(id, titlePanel);
  20.     },
  21.  
  22.     initComponents: function(id, titlePanel) {
  23.    this.produkTable = new app.views.master.grid.TableProduk().getTableProduk(); //tambahkan
  24.        
  25.         this.form = new app.views.master.form.ProdukForm({
  26.             id: 'formProdukPanel',
  27.             idProdukName: 'txtNamaProduk',
  28.             idOnSubmit: 'onSubmitProdukForm',
  29.             idOnReset: 'onResetProdukForm'
  30.         });
  31.        
  32.         var contentPane = new dijit.layout.ContentPane({
  33.             region: 'center',
  34.             content: this.form
  35.         });
  36.        
  37.         var tab1 = new dijit.layout.TabContainer({
  38.             id: 'tab1',
  39.             region: 'center'
  40.         });
  41.        
  42.         var contentPane2 = new dijit.layout.ContentPane({
  43.             region: 'bottom',
  44.             content: tab1,
  45.             title: 'test',
  46.             style: 'width: 100%; height; 70%;'
  47.         });
  48.        
  49.         var buton = new dijit.form.Button({});
  50.         var component = '<button dojoType="dijit.form.Button">Add</button>';
  51.             component += '<button dojoType="dijit.form.Button">Edit</button>';
  52.             component += '<button dojoType="dijit.form.Button">Delete</button>';
  53.            
  54.         var contentPane3 = new dijit.layout.ContentPane({
  55.             region: 'center',
  56.             content: component,
  57.             title: 'Produk',
  58.             style: 'width: 100%; height; 10%;'
  59.         });
  60.         // we must call this function
  61.         contentPane.startup();
  62.         contentPane2.startup();
  63.         contentPane3.startup();
  64.        
  65.         this.mainPanel = new dijit.layout.BorderContainer({
  66.             id: id,
  67.             title: titlePanel,
  68.             closable: true,
  69.             design:'sidebar',
  70.             gutters:true,
  71.             liveSplitters:true,
  72.             style: 'height: 100%;width: 100%;'
  73.         });
  74.         tab1.addChild(contentPane3);
  75.         this.mainPanel.addChild(contentPane);
  76.         this.mainPanel.addChild(contentPane2);
  77.        
  78.         /*this.mainPanel.addChild(new dijit.layout.ContentPane({
  79.             region: 'bottom',
  80.             splitter: true,
  81.             content: this.produkTable.domNode,
  82.             style: 'height: 30%;width: 20%;'
  83.         }));*/ // uncomment disini
  84.     },
  85.    
  86.     getMainPanel: function() {
  87.         return this.mainPanel;
  88.     }
  89. });
  90.  
  91.  
  92. Keterangan : penjelasan Ada Di akhir baris
Add Comment
Please, Sign In to add comment