TreeList conditional filter functionality

4 posts, 0 answers
  1. Alexandra
    Alexandra avatar
    18 posts
    Member since:
    Sep 2015

    Posted 28 Aug Link to this post

    We have implemented in grid a conditional filter using 'filterMenuOpen' and 'filter' events of the grid. And it works.
    Now we have a page where a hierarchy data needs to be display and must have the same look and feel as the grid, hence the conditional filtering. In order to do this we have modified the treelist in order to have the 'filterMenuOpen' and 'filter' events on tree adapting the code from grid. 
    We also handled the filter open like in the thread http://www.telerik.com/forums/cascade-filter-using-ajax-binding

    But we have found that setting the filter on treelist does not work in the same way as it does for grid:
    1. We have a table with Id, MainField, SubField, ParentId => the data is displayed in the treelist correctly
    (The SubField has to have the source dynamic based on the MainField selected)
    2. Select a filter on MainField => the data is filtered correctly
    3. Select a filter on SubField => The datasource of SubField it is correct based on the selected MainField filter value and the filter is done correctly
    4. Change the MainField filter and select another value (we have to remove the SubField filter) =>
    The TreeList displays changes multiple times and the last one is not the correct one (It displays the same data as the first filter at point 2)

    Questions:

    1. Is there a way to make the filter functionality work like in grid?

    2. Is there a plan to soon release a new version to make the treelist have the same functionality as the grid? If not can we still hope there will be one :D

    3. Is there a solution to implement the hierarchy in the grid?

     

    PS: Because we are using MVC and should have the same filtering as the grid we had to attach to the framework the same functionality (as in grid) already supported by the filter (kendoFilterMenu) in treelist.

  2. Stefan
    Admin
    Stefan avatar
    1394 posts

    Posted 30 Aug Link to this post

    Hello Alexandra,

    Thank you for the detailed description.

    Regarding the questions:

    1) In general, both filter functionalities are similar as they both are using the dataSource filter features. The TreeList has a different type of dataSource, but it inherits the Grid dataSource and it is just extending it with some additional features(not related to the filtering):

    http://docs.telerik.com/kendo-ui/api/javascript/data/treelistdatasource

    2) For now, we do not plan to change the filter functionality of the TreeList or of the Grid.

    3) The Grid can be made hierarchical as well. Please check our demo example demonstrating this:

    http://demos.telerik.com/aspnet-mvc/grid/hierarchy

    In general, the both widget should behave the same when filtering with small differences.

    If an issue still occurs, please provide us with a fully runnable example where the scenario can be observed and we will gladly provide a suggestion best suited for it.

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Alexandra
    Alexandra avatar
    18 posts
    Member since:
    Sep 2015

    Posted 01 Sep in reply to Stefan Link to this post

    Hi Stefan,

    While creating the example scenario for you to help me with I have found the problem. I wanted to introduce the noRecords functionality as the grid and implemented it like this:

    from this code
    ...
    if (!data.length) {
    this._showStatus(kendo.htmlEncode(messages.noRows));
    }
    ...
    to this code
    ...
    if (!data.length) {
    if (this.options.noRecords) {
    this._showStatus(kendo.htmlEncode(messages.noRows));
    }
    else {
    $(this.content).add(this.lockedContent).hide();
    this.element.find('.k-status').remove();
    }
    }
    ...

    and apperently this influence the display of the data. After I remove the above code it worked (I used CSS to hide the status message)

    But now I have another related question: is there a way to have the progress (busy indicator) functionality with the spinning image as the grid has? The reason I ask is because when doing the filter on treelist you see the data twice in treelist. One is the full tree with all the data and the other one is the filtered tree with the filtered data. The grid has the progress and you don't see what is happening behind.
  4. Stefan
    Admin
    Stefan avatar
    1394 posts

    Posted 05 Sep Link to this post

    Hello Alexandra,

    The Kendo UI loading indicator can be placed programmatically over the TreeList:

    http://docs.telerik.com/kendo-ui/api/javascript/ui/ui#methods-progress

    http://dojo.telerik.com/IyiKa

    In the real application, two events have to be used, one for showing it and one for hiding it at the correct moment.

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top