jvolt
30 May 2010, 7:46 AM
Imagine a window with a grid that uses a store.
When I use Ext Designer to draw it, six files are created in the same directory of the *. xds.
Question number one. What to do with the files "xds_" that does not interest me?
Well, in my project I use a folder called "js" for all *. js. So the best practice would be:
1. Save my files "*. xds" in the folder js (But just mix the files "xds_", which I do not need because the structure of the project is already done. But I would not have a folder containing just files of type js) = (
2. Save my files in another location and keep copying them every time I re-export them (very annoying too).
Question number 2. includeOrder and how to pass parameters to the main window of the store to load the grid properly.
The file "xds_includeorder" says to include the files in the following order:
<script type="text/javascript" src="Department.ui.js"> </ script>
<script type="text/javascript" src="Department.js"> </ script>
<script type="text/javascript" src="storeDepartments.js"> </ script>
I can just change the file "Department.js," how could I change it to receive some parameter and pass it to the store?
I already tried to add a constructor but it did not work, returns the following error: h.directCfg is undefined.
The original code:
Department = Ext.extend(DepartmentUi, {
initComponent: function() {
Department.superclass.initComponent.call(this);
}
});
My code:
Department = Ext.extend(DepartmentUi, {
constructor: function(cfg) {
cfg = cfg || {};
//or something as this.keytoloadthestore = cfg.keytoloadthestore
Department.superclass.constructor.call(this, Ext.apply(this, cfg));
},
initComponent: function() {
//then something as this.items.itemAt(0).store.reload({paramns: {'keytoload': this.keytoloadthestore}})
Department.superclass.initComponent.call(this);
}
});
I'm learning it and writing a new post on my blog to teach others the best way to use Ext Designer to gain produtivity.
Thanks! =]
When I use Ext Designer to draw it, six files are created in the same directory of the *. xds.
Question number one. What to do with the files "xds_" that does not interest me?
Well, in my project I use a folder called "js" for all *. js. So the best practice would be:
1. Save my files "*. xds" in the folder js (But just mix the files "xds_", which I do not need because the structure of the project is already done. But I would not have a folder containing just files of type js) = (
2. Save my files in another location and keep copying them every time I re-export them (very annoying too).
Question number 2. includeOrder and how to pass parameters to the main window of the store to load the grid properly.
The file "xds_includeorder" says to include the files in the following order:
<script type="text/javascript" src="Department.ui.js"> </ script>
<script type="text/javascript" src="Department.js"> </ script>
<script type="text/javascript" src="storeDepartments.js"> </ script>
I can just change the file "Department.js," how could I change it to receive some parameter and pass it to the store?
I already tried to add a constructor but it did not work, returns the following error: h.directCfg is undefined.
The original code:
Department = Ext.extend(DepartmentUi, {
initComponent: function() {
Department.superclass.initComponent.call(this);
}
});
My code:
Department = Ext.extend(DepartmentUi, {
constructor: function(cfg) {
cfg = cfg || {};
//or something as this.keytoloadthestore = cfg.keytoloadthestore
Department.superclass.constructor.call(this, Ext.apply(this, cfg));
},
initComponent: function() {
//then something as this.items.itemAt(0).store.reload({paramns: {'keytoload': this.keytoloadthestore}})
Department.superclass.initComponent.call(this);
}
});
I'm learning it and writing a new post on my blog to teach others the best way to use Ext Designer to gain produtivity.
Thanks! =]