PDA

View Full Version : How to import user extensions (e.g. Ext.ux ) into project



danielleng
26 Dec 2011, 5:08 PM
Hey everyone, I seem to be having a problem importing Ext.ux.grid.FiltersFeature into my project. I have added all the required source code into my project, with the following directory structure in my UX directory:


src - ux - grid - filter - BooleanFilter.js
- DateFilter.js
- ListFilter.js
- NumericFilter.js
- StringFilter.js
- Filter.js

- menu - ListMenu.js
- RangeMenu.js

- FiltersFeature.js


And in app.js i added the following:


Ext.Loader.setConfig({enabled: true});
Ext.Loader.setPath('Ext.ux', '../ux');

Ext.require([
....
....
Ext.ux.grid.FiltersFeature;
]);

I can't get my app to run... however when I change the require to "Ext.ux.grid.*", my app runs properly but am unable to get the filters to show in my grid.
I've searched the forums but couldn't find the topic that explains the correct way to import user extensions with ExtJS 4.0.7. Hoping someone could enlighten me. Thanks in advance.

mitchellsimoens
26 Dec 2011, 5:44 PM
You need to have a path setup to resolve Ext.ux to a folder:


Ext.Loader.setConfig({
enabled : true,
paths : {
'Ext.ux' : '/path/to/ux'
}
});

danielleng
27 Dec 2011, 12:34 AM
Thanks a ton. That works perfectly.


Ext.Loader.setConfig({
enabled : true,
paths : {
'Ext.ux' : 'extjs/src/ux'
}
});

I did not specify the path to 'Ext.ux' correctly ... that's why it wasn't working!