PDA

View Full Version : Query Result not showing the word "Return" in grid



swaitch
8 Dec 2009, 5:17 PM
I have a search window that queries a database and returns those results back to a grid inside a panel. I can run a search and the results are displayed in the grid on any word but "return" When I look at the return in firebug the correct results are there. Is there something in Ext that might not like the word return?

Here is my grid code:

var panel;
var store = new Ext.data.Store({
id: 'theStore',
url: 'action/queries.php',
method: 'POST',
baseParams:{task: "getFiles", dir_id: directory},
reader: new Ext.data.JsonReader({
root: 'rows',
totalProperty: 'results',
id:'file_id',
fields: [
'file_id',
'dir_id',
'file_name',
'file_text'
]
}),
remoteSort: true
});

var cm = new Ext.grid.ColumnModel([
{header: 'File ID', dataIndex: 'file_id', sortable:true, width: 0, resizable: false, hidden: true},
{header: 'Directory ID', dataIndex: 'dir_id', sortable:true, width: 35, hidden: true},
{header: 'File Name', dataIndex: 'file_name', sortable:true, width: 75},
{header: 'File Text', dataIndex: 'file_text', sortable:true, width: 250}
]); // End Column Model

var grid = new Ext.grid.GridPanel({
id: 'grid',
autoHeight:true,
autoScroll: true,
store: store,
columLines: true,
ddGroup: 'TreeDD',
enableDragDrop:true,
cm: cm,
sm: new Ext.grid.RowSelectionModel({singleSelect: true}),
gridContextMenu: true,
loadMask: true,
viewConfig: {
forceFit:true,
enableRowBody:true
},
listeners: {
'celldblclick': function(grid, rowIndex, columnIndex, e){
var fileid = grid.store.getAt(rowIndex).get("file_id");
loadHtml(fileid);
}
},
tbar:[{
text: 'Close',
icon: 'includes/images/close.png',
cls:'x-btn-text-icon',
tooltip: 'Close Search Results',
listeners: {
'click': function(){
grid.hide();
}
}

}],
bbar: new Ext.PagingToolbar({
pageSize: 30,
bodyStyle: 'margin-bottom:25px;',
store: store,
displayInfo: true,
displayMsg: 'Displaying {0} - {1} of {2}'
})
});

grid.show();
store.load({params:{start:0,limit:30}});

Ext.override(Ext.grid.GridView, {
syncFocusEl : Ext.emptyFn
});

and the search form:

buttons: [{
text: 'Search',
listeners: {
'click': function(){
panel.add(grid);
panel.doLayout();
store.baseParams = {
task:'getFiles',
query: searchDocs.getValue(),
dir_id:directory
}
store.reload();
}
}
}

Go easy on me, I'm still learning. Again, every other search query works but not when I try the word "return" or "Return".
The first image shows what the results should look like, the second image shows nothing in the grid when I search for "return". Thanks ahead of time.