PDA

View Full Version : ExtJS 4.2.1 grid empty text position needs to be fixed on horizontal scroll



nckenn
12 Aug 2014, 7:15 PM
am working on a extjs application in which i am using the grid , When the store returns no data i need to display the empty text .

Problem

1. Empty text position needs to be fixed when i scroll the horizontal bar of the grid.

Ext.create('Ext.data.Store', {
storeId:'simpsonsStore',
fields:['name', 'email', 'phone'],
data:{'items':[
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});


Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Phone', dataIndex: 'phone' }
],
height: 200,
width: 400,
viewConfig:{
emptyText:'No Data or Record Found',
deferEmptyText: false
},
renderTo: Ext.getBody()
});

Any help would be greatly appreciated.

Gary Schlosberg
14 Aug 2014, 8:33 AM
You could use CSS to fix the position.
https://fiddle.sencha.com/#fiddle/8te