Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Problem adding custom filter feature in Grid Panel

    Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    3
    Vote Rating
    1
      0  

    Default 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

  2. #2
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    145
      0  

    Default

    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

  3. #3
    Sencha User
    Join Date
    Aug 2012
    Location
    Kansas City - Metro
    Posts
    24
    Vote Rating
    1
      0  

    Default I am trying to add the FiltersFeature as well

    Quote Originally Posted by aconran View Post
    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

  4. #4
    Sencha Premium Member
    Join Date
    Mar 2012
    Location
    Italy
    Posts
    5
    Vote Rating
    0
      0  

    Default

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

    Thank's

  5. #5
    Sencha User
    Join Date
    Aug 2012
    Location
    Dublin
    Posts
    72
    Vote Rating
    11
      0  

    Default

    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.

    Quote Originally Posted by finextjs View Post
    I'm having the same problem. Any news? A little help?

    Thank's

  6. #6
    Sencha User
    Join Date
    Aug 2012
    Location
    Kansas City - Metro
    Posts
    24
    Vote Rating
    1
      0  

    Default 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);
    }
    });

  7. #7
    Sencha Premium Member
    Join Date
    Mar 2012
    Location
    Italy
    Posts
    5
    Vote Rating
    0
      0  

    Default

    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. #8
    Sencha User
    Join Date
    Aug 2012
    Location
    Dublin
    Posts
    72
    Vote Rating
    11
      0  

    Default

    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
    Quote Originally Posted by finextjs View Post
    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?

  9. #9
    Sencha User
    Join Date
    Aug 2012
    Location
    Kansas City - Metro
    Posts
    24
    Vote Rating
    1
      0  

    Default 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,

  10. #10
    Sencha User
    Join Date
    Aug 2012
    Location
    Kansas City - Metro
    Posts
    24
    Vote Rating
    1
      0  

    Default 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

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •