Results 1 to 10 of 17

Thread: Problem adding custom filter feature in Grid Panel

Hybrid View

Previous Post Previous Post   Next Post Next Post
    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
    146
      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 User
    Join Date
    Aug 2012
    Location
    Kansas City - Metro
    Posts
    24
    Vote Rating
    1
      0  

    Default Got it done

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

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

    Default

    Can you post your filterFeatures.js and listMenu.js files?

    Thank's

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
  •