Jul 13, 2012, 11:45 PM
Tabpanel and Gridpanel problem
Hello Members.
I am new to this site and i am starting to work with Ext.net witch i find very usefull for making richfull websites.
My question is this..
I have a methode that generates a Tabpanel and a Gridpanel.
when i "add" the gridpanel to the tabpanel and renders it gridpanel adds a seperate tab with a title on it... does anybody know why its does that..
if i make the same thing in javascript this does not accure at all.
my code behinde looks like this..
Methode witch generates it all:
First image is a tab made by the server side, second is made via javascript.
I am new to this site and i am starting to work with Ext.net witch i find very usefull for making richfull websites.
My question is this..
I have a methode that generates a Tabpanel and a Gridpanel.
when i "add" the gridpanel to the tabpanel and renders it gridpanel adds a seperate tab with a title on it... does anybody know why its does that..
if i make the same thing in javascript this does not accure at all.
my code behinde looks like this..
Methode witch generates it all:
public static ext.DirectResponse CreateMe(string url, String container)
{
ext.Store store = BuildStore(url);
ext.GridPanel g = BuildGrid();
ext.TabPanel tab = BuildTab(container);
g.Store.Add(store);
store.DataBind();
tab.Items.Add(g);
ext.TabPanel mainTab = (ext.TabPanel)ext.X.GetCmp(container);
mainTab.Items.Add(tab);
tab.Render();
tab.DoLayout();
mainTab.SetActiveTab(tab);
return new ext.DirectResponse();
}
BuildTab Methode:public static ext.TabPanel BuildTab(String container)
{
ext.TabPanel mainTab = (ext.TabPanel)ext.X.GetCmp(container);
ext.TabPanel tab = new ext.TabPanel()
{
ID = "tab"+(mainTab.Items.Count+1),
Title = "ServerTab" + (mainTab.Items.Count + 1),
Closable = true
};
return tab;
}
BuildGrid Methode:public static ext.GridPanel BuildGrid()
{
ext.GridPanel gp = new ext.GridPanel()
{
ID = "gridTest",
Title = "Grid by Server",
Closable = false,
AutoWidth = true,
AutoHeight = false,
ColumnModel =
{
Columns =
{
new ext.Column()
{
ColumnID = "id",
Header = "ID",
DataIndex = "id",
Sortable = true
},
new ext.Column()
{
Header = "Name",
DataIndex = "name",
Sortable = true
},
new ext.Column()
{
Header = "Address",
DataIndex = "address",
Sortable = true
},
new ext.Column()
{
Header = "Zip",
DataIndex = "zip",
Sortable = true
},
new ext.Column()
{
Header = "Phone",
DataIndex = "phone",
Sortable = true
}
}
},
SelectionModel =
{
new ext.RowSelectionModel()
},
View =
{
new ext.GridView()
{
ForceFit = true,
}
},
Frame = true
};
return gp;
}
BuildStore Methode:private static ext.Store BuildStore(string url)
{
ext.Store store = new Ext.Net.Store()
{
ID = "storeCus",
IDMode = Ext.Net.IDMode.Explicit,
Proxy =
{
new Ext.Net.HttpProxy()
{
Method = Ext.Net.HttpMethod.GET,
Json=true,
Url= url
}
},
Reader =
{
new Ext.Net.JsonReader()
{
IDProperty="id",
Root = "items",
TotalProperty="totalCount",
Fields =
{
new ext.RecordField()
{
Name="id", Mapping="id"
},
new ext.RecordField()
{
Name="name", Mapping="Name"
},
new ext.RecordField()
{
Name="address", Mapping="Address"
},
new ext.RecordField()
{
Name="zip", Mapping="Zipcode"
},
new ext.RecordField()
{
Name="phone", Mapping="Phone"
}
}
}
}
};
return store;
}
Any good suggestions on what might cause this..First image is a tab made by the server side, second is made via javascript.
Last edited by Akpenob; Jul 13, 2012 at 11:50 PM.