PDA

View Full Version : Need some help



Tascha
21 Jul 2009, 3:48 AM
Hello guys!

I need your help.
I currently work with ExtJS for first time.
So, excuse me for bad description and bad english :">

I want to use ExtJS with my SQL-database, but I have some problems with it.

I write the query, from two specific tables. And I wrote with Javascript a function which I can use to extract the IP-address out of the addressbar.



var GET = new Array();
if(location.search.length > 0) {
var get_param_str = location.search.substring(1, location.search.length);
var get_params = get_param_str.split("&");
for(i = 0; i < get_params.length; i++) {
var key_value = get_params[i].split("=");
if(key_value.length == 2) {
var key = key_value[0];
var value = key_value[1];
GET[key] = value;
}
}
}
alert(GET['ip']+ GET['view']);
It works fine.

the tabpanel displays my devices(that is written in the table of the database) in different tabs in a table(grid).

Now, how can I tell Ext, that:

If the IP-number is 123.456.12.34
then show the tab.
If the number is 777.666.555.44
then show a different tab and the other tab is closed.

I have to link the showing advice (the tabs) with the ip-number written in addressbar.

By now I'm totally confused:-/

Please help!!

greetings

Tascha

p.s.: If someone doesn't understand me, please write

andycramb
21 Jul 2009, 4:36 AM
Use the setActiveTab method on the tab object.
If you read the docs API for TabPanel you will see this method and other methods.

function setTabBasedOnIp(){
if(ip == ip number){
urTabPanel.setActiveTab(1);
}
else if(ip == other ip number){
urTabPanel.setActiveTab(2);
}
}

Tascha
21 Jul 2009, 4:57 AM
Thanks for your help!:)