PDA

View Full Version : store not loading



Brahose
14 May 2009, 8:44 AM
Hello all, I have a data.Store which I am using to populate an EditorGrid. I have done this before, but for some reason this will not work! My grid hangs during the loadMasking, and will not even call the url I specified (I have a breakpoint at the entry).



initWindow: function(){
this.store = new Ext.data.Store({
url: 'adminHandler.ashx', //this call to adminHandler will grab all the records
reader: new Ext.data.JsonReader({
root: 'cols',
fields:
[//{{header: '{0}', width: {1}, sortable: {2}, dataIndex:'{3}', hidden: {4}, groupable: {5}, enabled: {6}, order: {7}, gt: '', lt: '', eq: ''
{name: 'dataIndex'},
{name: 'header'},
{name: 'width'},
{name: 'sortable'},
{name: 'groupable'},
{name: 'hidden'},
{name: 'gt'},
{name: 'lt'},
{name: 'eq'},
{name: 'order'},
{name: 'enabled'}
]
})
});
this.details = new Ext.Panel({
margins: '2 2 2 2',
width: 200,
collapsible: true,
split: true,
region: 'east',
title: 'Column Properties',
items: new Ext.grid.PropertyGrid({
autoHeight: true,
autoExpandColumn: true,
width:'auto',
source: {
'(name)': '',
'header': '',
'width': 80,
'hidden': false,
'Groupable': true,
'Sortable': true,
'gt': '',
'lt': '',
'eq': ''
}
})
});
this.columns = new Ext.Panel({
margins: '3 3 3 3',
labelWidth: 120,
width: 375,
border:false,
split: true,
layout: 'fit',
region: 'center',
items: new Ext.grid.EditorGridPanel({
store: this.store,
autoLoad: true,
loadMask: true,
defaultSortable: false,
cm: new Ext.grid.ColumnModel(
[{
id:'columnName',
header:'Column Name',
width: 150,
dataIndex: 'name'
},{
id:'header',
header:'Column Header',
width: 150,
dataIndex: 'header'
},
checkColumn
]),
plugins:checkColumn,
title: 'Available Columns'
})
});
this.users = new Ext.Panel({
title: 'Your users',
collapsible: true,
split: true,
region: 'west',
margins: '1 1 3 3',
width: 200
});
}
Please let me know if you see anything that may be causing the store's load not to execute.

Thanks,
Brian

P.S. I just started using ExtJs this month, and absolutely love it! Great work!!

EDIT: oops, this is a 2.2 question, please move to 2.x help if you would like.

evant
14 May 2009, 8:51 AM
You're setting autoLoad on the grid, you should be setting that property on the store.

Brahose
14 May 2009, 9:05 AM
Thanks for the catch, I am still learning the details of the API.

The grid has stopped 'hanging' when the window opens, but it still doesn't even call my URL.

Thanks,
Brian

Brahose
14 May 2009, 11:11 AM
I was able to solve the issue. I was getting a 404 after I moved this js file in a sub folder and wasn't updating location in the url.

I feel really dumb...