PDA

View Full Version : Ext Designer export



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! =]

jvolt
30 May 2010, 6:26 PM
Got the answer to the question number 2 here:

http://www.extjs.com/forum/showthread.php?99295-3.2.1-DirectStore-and-Designer-directFn.directCfg-undefined&highlight=DirectCfg

(That was right, i guess the error was ONLY on Ext Designer Export) [:)]


I still need know about the xds_* files, about the question number one..

jarrednicholls
30 May 2010, 9:19 PM
If you use Linux or OS X, you can simply make a symbolic link to your exported js files in your js folder. If you use Windows...well...shame on you :-) In that case I would simply reference your exported files directly (putting them anywhere) until they are deemed "finished" and then you can move the finalized js files to your js folder. I would do whatever you need to do to avoid copying files on every export. Symbolic Links are the easiest thing that comes to mind, but if you don't have the ability to do that, then just have a split dev/prod environment and reference your xds exported files directly. Whatever it takes to avoid making a mountain out of a mole hill...

jvolt
31 May 2010, 4:24 AM
understood jarred.

Thanks! =]

jarrednicholls
31 May 2010, 6:43 AM
In the future we'll think about the life cycle in which the Designer is used typically. I understand that it's perfect for full-out design->export->use situation, but when you do a lot of design revisions its export model becomes a little clumsy. It's nothing that 30 seconds of "elbow grease" won't solve (whether that's copying/pasting files or code, or what have you), but I totally get wanting to make the export pretty seamless and to "fit in" to a project the way you'd like. So again, we'll think this through for future growth of the product.