PDA

View Full Version : [CLOSED][PR3] Ext.grid.View - emptyText not always rendered



Seboss
15 Mar 2011, 7:23 AM
I found a situation where emptyText is not displayed.
Code being always better than word:


Ext.onReady(function() {
var grid1 = Ext.create("Ext.grid.GridPanel", {
title: "Grid panel",
renderTo: "grid1",
height: 300,
width: 300,
viewConfig: {
emptyText: "Empty text....",
deferEmptyText: false
},
store: Ext.create("Ext.data.Store", {
fields: [
"value"
],
proxy: {
type: "memory",
reader: "array"
}
}),
items: [{
headers: [{
text: "Header",
dataIndex: "value",
flex: 1
}]
}]
});

var grid2 = Ext.create("Ext.grid.GridPanel", {
title: "Grid panel",
renderTo: "grid2",
height: 300,
width: 300,
viewConfig: {
emptyText: "Empty text....",
deferEmptyText: false
},
store: Ext.create("Ext.data.Store", {
fields: [
"value",
],
proxy: {
type: "memory",
reader: "array"
}
}),
headers: [{
text: "Header",
dataIndex: "value",
flex: 1
}]
});
});


In the first grid, headers are declared in the "items" property and grid view "displayText" is not displayed.
In the second, headers are declared directly as a property of the grid and "displayText" is displayed as expected.

evant
16 Mar 2011, 12:01 AM
The headers should go directly on the grid, not under items.