// setInterval(function(){ // var d=new Date(); // var t=d.toLocaleTimeString(); // Ext.getCmp('lb.time').setValue(t); // },1000) function do_logout() { Ext.Ajax.request({ url: BASE_URL + 'user/ext_logout', method: 'POST', success: function(xhr) { window.location = BASE_URL + 'user/login'; } }); } function get_content(objek) { var centerRegion = Ext.getCmp("centerRegion"); centerRegion.removeAll(); centerRegion.add(objek); centerRegion.doLayout(); } //function do_home() { // Ext.Ajax.request({ // url: BASE_URL + 'user/index', // method: 'POST', // success: function(xhr) { // window.location = BASE_URL + 'user/index'; // } // }); //} var task = new Ext.util.DelayedTask(function() { tab_center = new Ext.Panel({ xtype: 'container', region: 'center', layout: 'fit', id: 'centerRegion', split: true, autoEl: {}, items: [] }); menuTreeLoader = new Ext.tree.TreeLoader({ dataUrl: BASE_URL + 'c_mutama/getTree', baseParams: { id: "1", OTOR: USERNAME }, listeners: { 'load': function() { Ext.MessageBox.hide(); } } }); tree = new Ext.tree.TreePanel({ id: 'menu-tree', region: 'west', title: 'Menu', iconCls: 'silk-sitemap', split: true, width: 200, //height: 200, minSize: 175, maxSize: 400, collapsible: true, margins: '0 0 5 5', loader: menuTreeLoader, rootVisible: false, lines: false, autoScroll: true, root: new Ext.tree.AsyncTreeNode({ expanded: false }), listeners: { 'click': function(n) { //var sn=this.selModel.selNode||{}; var kd_menu; //,url; if (n.leaf) { kd_menu = n.attributes.kode; //url=n.attributes.url; //alert(kd_menu); control_page(kd_menu); } }, 'afterlayout': function() { // Ext.MessageBox.hide(); } } }); layout_main = new Ext.Viewport({ layout: 'border', renderTo: Ext.getBody(), defaults: { collapsible: true, split: true, frame: false, bodyStyle: 'padding: 0px 0px 0px 1px' }, items: [{ collapsible: false, region:'north', height:32, border:false, split:false, margins:'0 0 0 0', items:[new Ext.Toolbar({ height: 30, items: [ { xtype:'label', style: 'font-weight: bold;text-align: right;', text: 'SIAK UNIVERSITAS LANGLANGBUANA', },'->', { text: 'Dashboard', id: 'st_dsh', iconCls: 'silk-dash', handler: function() { // dashboard(ROLE_ID); } }, '|', { text: 'Status Logout', id: 'sts_logout_id', iconCls: 'silk-user' }, '|', { text: 'Logout', id: 'id_pengguna_', handler: do_logout }] })] }, // { // collapsible: false, // xtype: 'panel', // height: 30, // border: false, // region: 'south', // items: [] // }, tree,{ collapsible: false, region: 'center', layout: 'card', activeItem: 0, items:[tab_center]} // { // collapsible: false, // id: 'content-panel', // bodyStyle: 'padding:0px', // region: 'center', // layout: 'card', // margins: '0 0 0 0', // activeItem: 0, // border: true, // //width: 1000, // // tbar: tbCenter, // items: [tab_center] // } ] }); //===================================================================================== layout_main.show(); Ext.getCmp("sts_logout_id").setText("Pengguna: " + NM_KLP); Ext.getCmp("id_pengguna_").setText("Logout (" + USERNAME + ")"); }); task.delay(2000);