PDA

View Full Version : How to use different Store for a single table.?



jerald
20 Nov 2012, 3:59 AM
Hi,

i have 16 columns in a table. But my design of the page is in panel it contain three tabs.
one tab contain 4 columns, 2nd tab contain 5 columns and 3rd tab contain 7 columns.This 16 columns are in same table there not column also.

before this i have created pages are base on form in single page that depends on only single table only,but this is different.

Now creating desktop App.

this desktop.js

function Travel(src) {
var desktop = myDesktopApp.desktop.app.getDesktop();
var win = desktop.getWindow('Travel');
if (!win) {
win = desktop.createWindow({
id : 'Travel',
title : src.text,
width : 640,
height : 480,
items : [
Ext.create('Ext.grid.Panel', {
border : false,
id:'travelmaster_grid_id',
store : travelStore,
columns : travelColumns,
tbar : travelbar,
height : 450,
viewConfig : {
stripeRows : true,
layout : 'fit'
},
bbar : Ext.create('Ext.PagingToolbar', {
store : travelStore,
displayInfo : true,
displayMsg : 'Displaying {0} - {1} of {2}',
emptyMsg : "No data to display"
})
}) ],

iconCls : 'bogus',
animCollapse : false,
constrainHeader : true
});
}
win.show();
return win;
};




and the domain fields are define in Travel.js
But in the above code i don't want columns i need tabs.
What i need to do.?
Please help me Out.

mitchellsimoens
22 Nov 2012, 6:15 AM
So you want a tabpanel with 4 grids as child items all using the same store? Not a problem as long as you are using the same dataset in the store. Each grid can show different columns.

jerald
22 Nov 2012, 9:40 PM
thanks for thereply mitchellsimoens (http://www.sencha.com/forum/member.php?22216-mitchellsimoens) ,

Ext.create('Ext.grid.Panel', {
border : false,
id:'travelmaster_grid_id',
store : travelStore,
columns : travelColumns,
tbar : travelbar


here i'm using "column"

i need to add a three tabs then what should i use.

mitchellsimoens
23 Nov 2012, 6:34 AM
The grid does not support tabs, you would have to have multiple grids within a tab panel.

jerald
27 Nov 2012, 2:33 AM
Hi,

ok thanks


Ext.create('Ext.grid.Panel', {
border : false,
id:'travelmaster_grid_id',
store : travelStore,
columns : travelColumns,
tbar : travelbar


In Grid using columns i can define column in different js file i can refer. like above code.

same like i need to define for tabPanel is it possible.?