PDA

View Full Version : [FIXED] Sencha Architect 2.1 build 588



huskerguy
22 Aug 2012, 5:26 AM
I upgraded my build and now one of my viewports no longer displays in Sencha Architect 2.1
I would like some help

Joe Fraser

Phil.Strong
22 Aug 2012, 8:09 AM
Sure, I'm happy to help

tell me more

huskerguy
22 Aug 2012, 10:20 AM
Phil, thank you so much.
I am a very newbie, I am making good progress though. I actually fixed a bug in the FiltersFeature plugin. My trial will expire in about 11 days, but I am very impressed so far. I will be buying very shortly. anyway, The generated code still runs in my STS project. I still use Architect to update the Ext4.1 js files. I just cannot fix the reviewViewport, because it doesn't appear. If you are an old pro at this I will send you the entire viewport. If have a simple viewport called UnderConstruction, that still works. I started the project with 2.0 then upgraded to 2.1 and updated the project to ExtJs 4.1 no problems, then I got greedy and took the latest suggest built

Joe

huskerguy
22 Aug 2012, 11:59 AM
ok, I found the offending code.
I was trying to add grouping and filters to the grid menu:

features: [
{
ftype: 'grouping',
groupByText: 'Group By This Column',
groupHeaderTpl: [
'\'Group Name: {name}\''
],
showGroupsText: 'Allow Grouping',
startCollapsed: true
},
{
ftype: 'filters',
autoReload: false,
local: false,
updateBuffer: 1000,
filters: [
{
type: 'list',
dataIndex: 'state',
labelField: 'stateAbbr',
store: 'StateListJsonStore'
},
{
type: 'string',
dataIndex: 'insuredName'
}
]
}
],

huskerguy
22 Aug 2012, 12:43 PM
Maybe the real question is how to I get the FiltersFeature user extention into sencha Architect.
Or is this possible. One work around given in a forum that works in my application, breaks the Architect.
The work around was.

4. copy and paste the feature configuration into the Filter or Quick Value Set field near the top of the
config panel and then click on the Add button, e.g.

huskerguy
22 Aug 2012, 1:21 PM
The current solution is to not try and put the FiltersFeature plugin into Sencha Architect. If I
don't do this I can cut and paste the filter configuration into the generated js file. The cut and pasted would be into the features []. If I do this everything is
ok and the viewport displays correctly.

I don't like this solution at all.

Joe

huskerguy
23 Aug 2012, 7:40 AM
here it is

Ext.define('MyApp.view.override.ReviewViewport', {
requires: [
'MyApp.view.ReviewViewport',
'Ext.ux.grid.FiltersFeature'
],
override: 'MyApp.view.ReviewViewport',
initComponent:function()
{
alert("got here");

var filtersFeature = Ext.create('Ext.ux.grid.FiltersFeature');
filtersFeature.auroReload = false;
filtersFeature.local = false;
filtersFeature.updateBuffer = 1000;
filtersFeature.encode = true;
// filtersFeature.view = this.override.getView();


// var stateFilter = {
// type: 'list',
// dataIndex: 'state',
// labelField: 'stateAbbr',
// store: 'StateListJsonStore'
// };

// var insuredNameFilter = {
// type: 'string',
// dataIndex: 'insuredName'
// };

// var stateFilter = Ext.create('Ext.ux.grid.filter.ListFilter');
// stateFilter.dataIndex = 'state';
// stateFilter.labelField = 'stateAbbr';
// stateFilter.store = 'StateListJsonStore';

// filtersFeature.addFilter(stateFilter);


var insuredNameFilter = Ext.create('Ext.ux.grid.filter.StringFilter');
insuredNameFilter.dataIndex = 'insuredName';

filtersFeature.filters = [insuredNameFilter];


// var filtersCfg = {
// ftype: 'filters',
// autoReload: false,
// local: false,
// updateBuffer: 1000,
// filters: [insuredNameFilter, stateFilter],
// encode: true
// };

var groupCfg = {
ftype: 'grouping',
groupByText: 'Group by this Column',
groupHeaderTpl: [
'Group Name: {name}'
],
showGroupsText: 'Allow Grouping'
};

this.features=[filtersFeature];
// this.callOverridden(this.features);
this.callParent(this.features);
}
});

dfoelber
23 Aug 2012, 9:10 AM
Hi,

Our ExtFeedViewer example (https://github.com/SenchaArchitect/ExtFeedViewer) performs a similar import with PreviewPlugin. Here are the basic steps:
Copy the plugin to your project root
Add a Loader child to your application node
Set the path of the loader. If you placed the plugin in ux/, it would look similar to this

{"Ext.ux":"ux/"}
Create the override, in FeedViewer's case it looks like this

Ext.define('MyApp.view.override.FeedGrid', {
requires: 'MyApp.view.FeedGrid'
}, function() {
Ext.override(MyApp.view.FeedGrid, {
viewConfig: {
itemId: 'view',
plugins: [{
pluginId: 'preview',
ptype: 'preview',
bodyField: 'description',
expanded: true
}]
}
});
});

huskerguy
23 Aug 2012, 11:00 AM
David,

thanks so much for your reply. However the result was a blank screen.
Here is how I translated your code for my needs:

Ext.define('MyApp.view.override.TicketGridPanel', {
requires: 'MyApp.view.TicketGridPanel'
}, function() {
Ext.override(MyApp.view.TicketGridPanel, {
viewConfig: {
features: [
{
ftype: 'grouping',
groupByText: 'Group by this Column',
groupHeaderTpl: [
'Group Name: {name}'
],
showGroupsText: 'Allow Grouping'
},
{
ftype: 'filters',
autoReload: false,
local: false,
updateBuffer: 1000,
filters: [
{
type: 'list',
dataIndex: 'state',
labelField: 'stateAbbr',
store: 'StateListJsonStore'
},
{
type: 'string',
dataIndex: 'insuredName'
}
]
}
]
}
});
});

huskerguy
23 Aug 2012, 11:04 AM
I don't know the steps of add a Loader node in sencha architect. I do have a launch method

huskerguy
23 Aug 2012, 12:51 PM
All,

using the override was correct and here is the code.

Ext.define('MyApp.view.override.TicketGridPanel', {
requires: [
'MyApp.view.TicketGridPanel',
'Ext.ux.grid.FiltersFeature'
],
override: 'MyApp.view.TicketGridPanel',

initComponent:function()
{

this.viewConfig = {
features: [
{
ftype: 'grouping',
groupByText: 'Group by this Column',
groupHeaderTpl: [
'Group Name: {name}'
],
showGroupsText: 'Allow Grouping'
},
{
ftype: 'filters',
autoReload: false,
local: false,
updateBuffer: 1000,
filters: [
{
type: 'list',
dataIndex: 'state',
labelField: 'stateAbbr',
store: 'StateListJsonStore'
},
{
type: 'string',
dataIndex: 'insuredName'
}
]
}
]
}

// this.callOverridden(arguments);
this.callParent(arguments);
}
});

huskerguy
24 Aug 2012, 4:35 AM
All,

If you want to get a ListFilter to actually work you have to modify ListMenu.js. There is a real bug in the constructor. In the else part of the constructor(The part for a store instead of an option list). Yes I am using a Json Store.
Anyway in the else part replace the line me.store.on('load', me.onLoad, me);
with
// add a listener to the store object
var storeObject = Ext.StoreMgr.lookup(me.store);
storeObject.on('load', me.onLoad, me);
me.store = storeObject;

Now it works.
Can I get the super secret discount now? I think I earned it(lol). I know it might not seem like it, but I am still a fan of the product. It has some really advanced ideas in it. Go Sencha. Once again thanks to every one who helped. I will now have a happy Friday

Joe