WjFlexgridFilter is not working inside detail grid (inside wjFlexGridDetail)

Posted by: aswathy.murugan on 16 November 2017, 9:37 pm EST

    • Post Options:
    • Link

    Posted 16 November 2017, 9:37 pm EST

    Hi

    We are using wjFlexGridDetail to have a grid within the grid. We are not able to apply filter using WjFlexgridFilter to the inner grid. Filter icons appear but when filter is chosen, it is not applied to the grid. Please can you help.

    Thanks

    Aswathy

  • Posted 16 November 2017, 9:38 pm EST

    Forgot to mention, We are working with angular 2.

  • Posted 19 November 2017, 9:02 pm EST

    Hi,

    We are sorry, we are unable to replicate the issue at our end with latest build 5.20173.380. Please refer to the attached sample for the same.

    If the issue persists, please let us know with the demo sample depicting your issue.

    ~Manish

    FlexGrid_Detail_Grid_Filter.zip

  • Posted 20 November 2017, 6:45 pm EST

    Hi Manish

    The issue persist. I am using AMD version. Does that make any difference

  • Posted 20 November 2017, 10:25 pm EST

    Hi Manish

    Irrespective of version, Flexgrid filter is not working in inner grid if items source is based on outer grid. Filter is not working in sample row detail grid provided by wijmo. Below is the link

    http://demos.wijmo.com/5/Angular2/RowDetails/RowDetails/

    I am working on this grid where I face difficulty in implementing filter to inner grid

  • Posted 21 November 2017, 4:22 pm EST

    Hi

    Thank you for reporting the issue. We are able to replicate the issue at our end with provided information and it seems a bug.

    Hence, this issue has been forwarded to the concerned team for Further investigation with internal tracking id 298252.

    We will let you know as we get any update on this.

    ~Manish

  • Posted 31 January 2018, 11:33 pm EST

    This happens because the detail grids in the sample are using collection views that are already filtered.

    Here’s the code that gets the products for a given category in the sample:

    // get products for a given category
    var products = {};
    $scope.getProducts = function (categoryID) {
      var view = products[categoryID];
      if (!view) {
        view = new wijmo.collections.CollectionView($scope.products.sourceCollection);
        view.filter = function (item) {
          return item.CategoryID == categoryID;
        }
        products[categoryID] = view;
      }
      return view;
    }
    
    

    Because the filter is already set, the FlexGridFilter class cannot apply its own filter and therefore doesn’t work.

    You can fix this by changing the code that creates the detail grid a little bit. Instead of binding it directly to the product CollectionView (which is already filtered), bind it to the view’s items property instead. This will cause the grid to create a new CollectionView which can be filtered independently by the FlexGridFilter.

    Here’s the fix:

    var detailGrid = new wijmo.grid.FlexGrid(cell, {
        headersVisibility: 'Column',
        autoGenerateColumns: false,
        // get the filtered items so the detail grid will
        // have its own CollectionView, which can then be 
        // filtered independently
        itemsSource: $scope.getProducts(row.dataItem.CategoryID).[b]items[/b],
        isReadOnly: true,
        columns: [
          ...
    
    

    Hope this helps…

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels