PDA

View Full Version : [INFOREQ] Problem adding custom filter feature in Grid Panel



dandal71
6 Aug 2012, 6:16 AM
I want add filter feature in Grid Panel. Im using Ext.ux filter. The step in architect.
1. Add property "features:[]" in inspector.
2. Set new property with value {ftype : 'filters', encode : true, local : false}
When i do step 1 and 2, the application container change to blank. If delete features property cointener is restored.
Thanks
Daniel
Sorry my poor english

aconran
6 Aug 2012, 8:01 AM
Thanks for the bug report.

The issue here is that Architect is trying to render the grid with the custom feature on teh canvas but the custom feature is not loaded. Look for improvements in this workflow in the future.

For now, I'd recommend injecting the custom feature through an override to the grid.

huskerguy
20 Aug 2012, 2:18 PM
Thanks for the bug report.

The issue here is that Architect is trying to render the grid with the custom feature on teh canvas but the custom feature is not loaded. Look for improvements in this workflow in the future.

For now, I'd recommend injecting the custom feature through an override to the grid.


Any progress yet? I just started so I am not sure I could get an override to work. Would need help with that

finextjs
5 Oct 2012, 5:50 AM
I'm having the same problem. Any news? A little help?

Thank's

iplanit
5 Oct 2012, 9:47 AM
If you are in a hurry you can change dinamically the features, change the output code (I did that) or create the override.

I am waiting for an example of the override to learn the good way to do it.

But now Sencha Architect doesn't allow you to use the feature filters, if you override it will cause an error, because of the filters duplicate.

Do not forget to put the requires (Application, property) with your ux javascript.


I'm having the same problem. Any news? A little help?

Thank's

huskerguy
6 Oct 2012, 4:38 PM
Ext.define('MyApp.view.override.TicketGridPanel', {
requires: [
'MyApp.view.TicketGridPanel',
'Ext.ux.grid.FiltersFeature'
],
override: 'MyApp.view.TicketGridPanel',

initComponent:function()
{
// the filter created here is a dummy placeHolder it will get blasted.
this.viewConfig = {
features: [
{
id: 'groupingFeature',
encode: true,
ftype: 'grouping',
groupByText: 'Group by this Column',
groupHeaderTpl: [
'Group Name: {name}'
],
showGroupsText: 'Allow Grouping'
},
{
id: 'filtersFeature',
encode: true,
ftype: 'filters',
autoReload: false,
local: false,
updateBuffer: 1000,
filters: [
{
type: 'string',
dataIndex: 'dummyPlaceHolder'
}
]
}
],
getRowClass: function(record, rowIndex, rowParams, store) {
// this is the default behavior
// original classes alternate: x-grid-row(white), x-grid-row-alt(light-blue)

var today = new Date();
var delinqDate = record.get("delinqDate");
var retVar = "";

var one_day=1000*60*60*24; // one day in milliseconds
var totalDays = Math.ceil((today.getTime()-delinqDate.getTime())/(one_day));

// alert("totalDays are: " + totalDays);
if (totalDays >= 1 && totalDays <= 15)
{
retVar = "x-grid-row-yellow";
}
else if (totalDays >= 16 && totalDays <= 30)
{
retVar = "x-grid-row-orange";
}
else if (totalDays >= 31)
{
retVar = "x-grid-row-red";
}
else
{
retVar = "x-grid-row-alice-blue";
}

// alert("retVar is: " + retVar);
return retVar;

}

}

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

finextjs
8 Oct 2012, 2:57 AM
Thank you huskerguy,
but i'm not expert. I tried your override in my project and in a paging_grid example, but I don't see the filter and the grooping capability.
Firebug don't report any error.
I have only added the override modifing the name of the Grid panel in MyGridPanel:

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

and I have copied the ux folder in my project folder.

What else should I do?

iplanit
8 Oct 2012, 3:04 AM
You have to add the feature to your grid indicating the columns you want to be filterable (also in the filters you have to configure the columns to be numerical or string).

Regards

Thank you huskerguy,
but i'm not expert. I tried your override in my project and in a paging_grid example, but I don't see the filter and the grooping capability.
Firebug don't report any error.
I have only added the override modifing the name of the Grid panel in MyGridPanel:

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

and I have copied the ux folder in my project folder.

What else should I do?

huskerguy
8 Oct 2012, 8:16 AM
oops sorry I created all filter columns dynamically. It was a project requirement. It did it in a beforeRender event. If you want a non-dynamic solutions replace the dummy place holder with your real columns,

huskerguy
8 Oct 2012, 8:23 AM
More info I created the override thru the Sencha Architect program.
I am not an expert either I just started August 1, 2012. Where are the experts?
how do we talk to them?

Joe

huskerguy
8 Oct 2012, 8:49 AM
Any progress yet? I just started so I am not sure I could get an override to work. Would need help with that Yes, I have it working I had to change filterFeatures.js and listMenu.js to fix bugs and meet requirements. I now have filters that can be initialized from a database pretty cool

finextjs
25 Oct 2012, 7:59 AM
Can you post your filterFeatures.js and listMenu.js files?

Thank's

lool
3 Jan 2013, 4:42 AM
I solve this issue by inherits from Ext.panel.Table instead Ext.grid.Panel which accept adding "features" config as simple array

huskerguy
3 Jan 2013, 5:15 PM
Your way is different, but I am now happy with my solution. I had to completely re-do FiltersFeature.js and fix ListMenu.js. FiltersFeatures has a bad out of the box algorithm. I have 37 columns which each has a filter. So I call addFilter dynamically 37 times in afterRender of the Grid. Unfortunately, FilterFeatures destroys the existing filters and then recreates them on every call to addFilter. This is bad programming. You can imagine the memory and performance problems this created. I re-did the addFilter to stop this from happening. The reason I did the addFilter Dynamically is so I can initialize the filters from the database. Project requirement

orontobate
27 Sep 2013, 9:23 AM
I solve this issue by inherits from Ext.panel.Table instead Ext.grid.Panel which accept adding "features" config as simple array

Can you explain please?
I have the same problem: Architect is not accepting "features: []" as a custom property

huskerguy
27 Sep 2013, 9:51 AM
Hello,

the advice for adding features[] as a custom property does not work for Sencha architect 2.x. My solution is too make the gridPanel a separate class and then add an override to that class. In the override you can add the features as a config

orontobate
27 Sep 2013, 12:54 PM
Hello,

the advice for adding features[] as a custom property does not work for Sencha architect 2.x. My solution is too make the gridPanel a separate class and then add an override to that class. In the override you can add the features as a config

=D> thank you