-
6 Aug 2012 6:16 AM #1
Problem adding custom filter feature in Grid Panel
Problem adding custom filter feature in Grid Panel
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
-
6 Aug 2012 8:01 AM #2
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.Aaron Conran
@aconran
Sencha Architect Development Team
-
20 Aug 2012 2:18 PM #3
-
5 Oct 2012 5:50 AM #4
I'm having the same problem. Any news? A little help?
Thank's
-
5 Oct 2012 9:47 AM #5
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.
-
6 Oct 2012 4:38 PM #6
The Override is the correct answer this is what it should look like
The Override is the correct answer this is what it should look like
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);
}
});
-
8 Oct 2012 2:57 AM #7
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?
-
8 Oct 2012 3:04 AM #8
-
8 Oct 2012 8:16 AM #9
oops I forgot to mention I created the filter Columns dynamically
oops I forgot to mention I created the filter Columns dynamically
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,
-
8 Oct 2012 8:23 AM #10
I created the override through Sencha Architect
I created the override through Sencha Architect
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
Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.


Reply With Quote