frew
7 Apr 2009, 9:08 AM
Hello friends!
So I again updated to the latest svn and now I am having issues with my stores being shared throughout all of my grids. Again, this is very likely to be my bug, uncovered by the slightly different environment of Ext 3..
Here is a Working Showcase :-)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Aircraft Ducting Repair, Inc.</title>
<script type="text/javascript" src="js/lib/ext3/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="js/lib/ext3/ext-all-debug.js"></script>
<link rel="stylesheet" type="text/css" href="js/lib/ext3/resources/css/ext-all.css" />
<script type="text/javascript">
Ext.ns('ACDRI.ui');
ACDRI.ui.Grid = Ext.extend(Ext.grid.GridPanel, {
onRender: function(ct, position) {
ACDRI.ui.Grid.superclass.onRender.call(this, ct, position);
this.getStore().load();
},
initComponent: function() {
this.baseParams = this.baseParams || {};
var storeCfg = {
proxy: new Ext.data.HttpProxy({ url: this.url }),
reader: new Ext.data.JsonReader({
root: 'data',
totalProperty: 'total'
}, this.record),
remoteSort: true,
baseParams: this.baseParams
};
if (this.sortInfo) {
Ext.apply(storeCfg, {sortInfo: this.sortInfo});
}
var store = new Ext.data.Store(storeCfg);
var sm = new Ext.grid.CheckboxSelectionModel();
var config = {
store: store,
loadMask: true,
sm: sm,
baseParams: this.baseParams
};
Ext.apply(this, Ext.apply(this.initialConfig, config ));
ACDRI.ui.Grid.superclass.initComponent.apply(this, arguments);
}
});
</script>
<script type="text/javascript">
ACDRI.ui.WorkOrders = Ext.extend(ACDRI.ui.Grid, {
initComponent: function() {
this.url = 'bar';
this.sortInfo = {
field: 'repair_order_date_received',
direction: 'desc'
};
this.record = Ext.data.Record.create([
{name: 'id', type: 'string'}
]);
var config = {
title: 'Work Orders',
columns: [{
header: 'ID',
tooltip: 'ID used to identify the Work Order',
dataIndex: 'id',
hidden: true
}]};
Ext.apply(this, Ext.apply(this.initialConfig, config ));
ACDRI.ui.WorkOrders.superclass.initComponent.apply(this, arguments);
}
});
Ext.reg('workorders', ACDRI.ui.WorkOrders);
</script>
<script type="text/javascript">
ACDRI.ui.MoreDifferentWorkOrders = Ext.extend(ACDRI.ui.Grid, {
initComponent: function() {
this.sortInfo = {
field: 'repair_order_date_received',
direction: 'desc'
};
this.url = 'foo';
this.record = Ext.data.Record.create([
{name: 'id', type: 'string'}
]);
var config = {
title: 'Work Orders',
columns: [{
header: 'ID',
tooltip: 'ID used to identify the Work Order',
dataIndex: 'id',
hidden: true
}]};
Ext.apply(this, Ext.apply(this.initialConfig, config ));
ACDRI.ui.MoreDifferentWorkOrders.superclass.initComponent.apply(this, arguments);
}
});
Ext.reg('mdworkorders', ACDRI.ui.MoreDifferentWorkOrders);
</script>
<script type="text/javascript">
Ext.onReady(function() {
new Ext.Window({
items: {
xtype: 'workorders',
height: 400,
width: 400
}}).show();
new Ext.Window({
items: {
xtype: 'mdworkorders',
height: 400,
width: 400
}}).show();
});
</script>
</head>
<body>
<div id='main'></div>
</body>
</html>
Note that the url is the same for both, yet it should be different.
Thanks for any input at all!
So I again updated to the latest svn and now I am having issues with my stores being shared throughout all of my grids. Again, this is very likely to be my bug, uncovered by the slightly different environment of Ext 3..
Here is a Working Showcase :-)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Aircraft Ducting Repair, Inc.</title>
<script type="text/javascript" src="js/lib/ext3/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="js/lib/ext3/ext-all-debug.js"></script>
<link rel="stylesheet" type="text/css" href="js/lib/ext3/resources/css/ext-all.css" />
<script type="text/javascript">
Ext.ns('ACDRI.ui');
ACDRI.ui.Grid = Ext.extend(Ext.grid.GridPanel, {
onRender: function(ct, position) {
ACDRI.ui.Grid.superclass.onRender.call(this, ct, position);
this.getStore().load();
},
initComponent: function() {
this.baseParams = this.baseParams || {};
var storeCfg = {
proxy: new Ext.data.HttpProxy({ url: this.url }),
reader: new Ext.data.JsonReader({
root: 'data',
totalProperty: 'total'
}, this.record),
remoteSort: true,
baseParams: this.baseParams
};
if (this.sortInfo) {
Ext.apply(storeCfg, {sortInfo: this.sortInfo});
}
var store = new Ext.data.Store(storeCfg);
var sm = new Ext.grid.CheckboxSelectionModel();
var config = {
store: store,
loadMask: true,
sm: sm,
baseParams: this.baseParams
};
Ext.apply(this, Ext.apply(this.initialConfig, config ));
ACDRI.ui.Grid.superclass.initComponent.apply(this, arguments);
}
});
</script>
<script type="text/javascript">
ACDRI.ui.WorkOrders = Ext.extend(ACDRI.ui.Grid, {
initComponent: function() {
this.url = 'bar';
this.sortInfo = {
field: 'repair_order_date_received',
direction: 'desc'
};
this.record = Ext.data.Record.create([
{name: 'id', type: 'string'}
]);
var config = {
title: 'Work Orders',
columns: [{
header: 'ID',
tooltip: 'ID used to identify the Work Order',
dataIndex: 'id',
hidden: true
}]};
Ext.apply(this, Ext.apply(this.initialConfig, config ));
ACDRI.ui.WorkOrders.superclass.initComponent.apply(this, arguments);
}
});
Ext.reg('workorders', ACDRI.ui.WorkOrders);
</script>
<script type="text/javascript">
ACDRI.ui.MoreDifferentWorkOrders = Ext.extend(ACDRI.ui.Grid, {
initComponent: function() {
this.sortInfo = {
field: 'repair_order_date_received',
direction: 'desc'
};
this.url = 'foo';
this.record = Ext.data.Record.create([
{name: 'id', type: 'string'}
]);
var config = {
title: 'Work Orders',
columns: [{
header: 'ID',
tooltip: 'ID used to identify the Work Order',
dataIndex: 'id',
hidden: true
}]};
Ext.apply(this, Ext.apply(this.initialConfig, config ));
ACDRI.ui.MoreDifferentWorkOrders.superclass.initComponent.apply(this, arguments);
}
});
Ext.reg('mdworkorders', ACDRI.ui.MoreDifferentWorkOrders);
</script>
<script type="text/javascript">
Ext.onReady(function() {
new Ext.Window({
items: {
xtype: 'workorders',
height: 400,
width: 400
}}).show();
new Ext.Window({
items: {
xtype: 'mdworkorders',
height: 400,
width: 400
}}).show();
});
</script>
</head>
<body>
<div id='main'></div>
</body>
</html>
Note that the url is the same for both, yet it should be different.
Thanks for any input at all!