PDA

View Full Version : Loading data on grid



Sneha004
9 Feb 2012, 5:40 AM
Hi,

I am working on tabpanel.
When I Click on different tabs 2nd time ,the data in grid is not loading.

Plz, response as soon as possible.

Thanks

chramer
9 Feb 2012, 6:57 AM
post some code!

friend
9 Feb 2012, 6:59 AM
It's really hard to say what the problem might be without a code sample.

Thx.

Sneha004
9 Feb 2012, 8:32 PM
{
xtype : 'gridpanel',
id : 'driverGridId',
width : '100%',
height : 300,
enableColumnHide : false,
sortableColumns : true,
autoScroll : true,
plugins : [Ext.create('Ext.ux.grid.GridHeaderFilters')],
viewConfig : {
id : 'ds',
trackOver : false,
stripeRows : true
},
columns : [{
xtype : 'actioncolumn',
header : 'Action',
width : 50,
dataIndex : 'action',
items : [{
icon : 'images/Arrow_right.png'
}]
}, {
header : 'First Name',
width : 100,
dataIndex : 'firstName',
filter : {
xtype : 'textfield',
emptyText : 'filter',
filterName : 'firstName'
}
}, {
header : 'Last Name',
width : 100,
dataIndex : 'lastName',
filter : {
xtype : 'textfield',
emptyText : 'filter',
filterName : 'lastName'
}
}, {
header : 'Driver ID',
width : 100,
dataIndex : 'driverId',
filter : {
xtype : 'textfield',
emptyText : 'filter',
filterName : 'driverId'
}
}, {
header : 'Duty Status',
width : 100,
dataIndex : 'dutyStatus',
filter : {
xtype : 'combobox',
id : 'test',
width : 98,
emptyText : 'filter',
displayField : 'optionName',
filterName : 'dutyStatus',
enableKeyEvents : true,
shadow : false,
store : Ext.create('Ext.data.Store', {
fields : ['optionName'],
data : [{
optionName : 'Off duty'
}, {
optionName : 'Sleeper'
}, {
optionName : 'Driving'
}, {
optionName : 'On duty'
}, {
optionName : 'Offduty driving'
}]
})
}
}, {
header : 'Available Driving',
width : 100,
dataIndex : 'availableDriving'
}, {
header : 'Driving Left',
width : 100,
dataIndex : 'drivingLeft'
}, {
header : 'On Duty Left',
width : 100,
dataIndex : 'onDutyLeft'
}, {
header : 'Cumulative On Duty',
width : 120,
//height: 60,
dataIndex : 'cumOnDuty'

}, {
header : 'Vehicle ID',
width : 100,
dataIndex : 'vehicleId'
}],
store : 'driver.DriverDetails'
}


This is my grid .I am loading data into grid from json file.
First time when application is running, the data is loaded successfully.
But when I navigate to other tabs then I click on this tab, the data is not showing.
Plz give some solution
Can we use onReady() function here?

Thnx