Hi!
I'm new here, and also new to ExtJs.
I tried to upgrade my webpage with Ext, and I figured, that I make a viewport, a menu at north, info at west, and the main contains at the center. I made everything, but I put a tabpanel at center, and I want that if I click a menu entry at the top, then the selected page load into a new tab at the center. It works well if I use simple html, or pure php without session and without mysql, but I want to use mysql and session also, so I need your help.
The js code on the main page:
PHP Code:
Ext.onReady(function()
{
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
var tabs = new Ext.TabPanel({
region: 'center',
margins: '0 5 5 0',
activeTab: 0,
enableTabScroll:true,
defaults: {autoScroll:true},
items: [{
contentEl: 'fooldal',
title: 'F?oldal',
closable: false,
autoScroll: true
}]
})
var viewport = new Ext.Viewport({
layout: 'border',
items: [
// create instance immediately
new Ext.BoxComponent({
region: 'north',
height: 48,
contentEl: 'menu'
}), {
region: 'west',
id: 'west-panel',
title: '',
split: false,
width: 205,
minSize: 175,
maxSize: 400,
collapsible: true,
margins: '0 0 5 5',
contentEl: 'west'
},tabs
]
});
/** Add Tab *******************/
function addTab(name,tab_url){
tabs.add({
title: name,
iconCls: 'tabs',
closable:true,
autoLoad: {url:tab_url, scripts: true},
listeners:{
vate : function(panel){
panel.getUpdater().refresh();
}
}
}).show();
}
Ext.get('sajat_beo').on('click',function(){addTab('Saját beosztás','./pages/info2.php');});
});
And the info2.php:
PHP Code:
<div>
<?php
session_start();
echo $_SESSION["db"];
$query="SELECT * FROM mozik";
$eredm=mysql_query($query,$_SESSION["db"]);
while($rekord=mysql_fetch_array($eredm))
{
echo $rekord["mnev"]."<br/>";
}
?>
</div>