[OPEN] [#1871] TreePanel filter empty container disappear by click

  1. #1

    [OPEN] [#1871] TreePanel filter empty container disappear by click

    When filtering, nodes are displayed that do not contain any elements and when they are clicked, they disappear.
    This can also be reproduced with the online example: https://examples5.ext.net/#/TreePanel/Advanced/Filter/
    Enter "test" in the filter (see Attachment 25564), then it shows a node. If the node is clicked, it disappears (see Attachment 25565).

    Browser: Microsoft Edge version 97.0.1072.55 (Official build) (64-bit)
    Ext.net: 5.3.1.0
  2. #2
    Hello AMPEGDev, and welcome to Ext.NET forums!

    Thanks to the clear and easy steps to reproduce the issue!

    Looks like the fastest solution for your issue would be to switch to store filtering logic (just uncheck the "TreePanel Filtering" box), it looks like it worked right. I'm talking about the very same example you tried, so you can see for yourself; it should be straightforward by inspecting the page's source code (via example's "source code" button).

    I tracked down the issue to Ext.NET 4; Ext.NET 3 works as intended with TreePanel filter logic. We need to put a little more thought on the issue before we can log an issue for that, but I believe you can get going already just switching the filter to the store.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hi Fabrício thanks for the quick reply.
    We have changed the filtering on the store and now have the problem that the filtering does not work. We have unchecked the checkbox (see Click image for larger version. 

Name:	1-uncheck-treepanel.PNG 
Views:	80 
Size:	17.1 KB 
ID:	25566) and then we searched for "Overview" and nothing is displayed (see Click image for larger version. 

Name:	2-start-search.PNG 
Views:	81 
Size:	12.4 KB 
ID:	25567).
  4. #4
    Hello again, @AMPEGDev!

    I see, it becomes much harder to search by node like that. We have will investigate the reason and see if there's a feasible fix or workaround for the issue in the time being. We shall post back soon!
    Fabrício Murta
    Developer & Support Expert
  5. #5
    We have further investigated and using our own tree filtering logic seems not necessary when it is now (since Ext.NET 4) possible to specify the filterer approach in the tree panel's store. Setting it as Bottomup seems to attain the result we expect.

    If you implicitly set the store of the grid (you do not specify any ext:TreeStore in markup or new Ext.Net.TreeStore() in code behind), then you may wire an event to set the grid filter priority order setting with something like:

    <Listeners>
        <AfterRender Handler="this.getStore().filterer = 'bottomup';" />
    </Listeners>
    Otherwise, just set the tree store's Filterer config accordingly. In markup that would simply be:

    <ext:TreeStore runat="server" Filterer="BottomUp" ...>
    This should get you started with the filtering. You may need to review how you clear filters and whether you want to expand all nodes once a filter is run (which may not really be desirable in some situations e.g. when the filter matches just too many nodes).

    We have logged issue #1871 to revisit Ext.NET's own filtering logic and improve it in the future. So far the major issue seems just leaving orphaned nodes dangling, but it also really could have some optimization.

    Let us know if this helps you of if there's still trouble using the filtering functionality given the new directions above.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  6. #6
    Hi Fabrício,
    is there any news about the bug?
    We need this fix!
  7. #7
    Hello @AMPEGDev!

    Please use the store filter logic with the BottomUp approach as indicated in our last post. Let us know if it doest not work for you.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  8. #8
    Hi Fabrício,
    it works with the TreeStore but not with the Listeners. But now we have TreePanels where we assemble the node in codebehind. There we don't use TreeStore and there the solution with the Listeners -> AfterRender doesn't work either.
  9. #9
    Hello @AMPEGDev!

    One way or another the tree panel will have a TreeStore at some point. Providing the nodes as parameters is just a syntax sugar to fill a basic store. Behind the hood, it is always created.

    Maybe that's just the event that is triggered too early while the store is still not created. If you are delaying the tree data to be loaded, then perhaps when the panel is rendered there's still no data fed, thus no store created. We'd need to know a bit more how you're filling the tree to tell the best time to let the setting adjustment be fired, but a very pragmatic way that should work in most cases is, making the tree's store setting when the filter textfield is focused, or when the filter function is actually triggered.

    It's the safest but not the best place because you don't really need to keep changing the value of the filterer, much less every time a search is entered. Even if you check the value before setting it will work, but it is still unnecessary. But I don't think this would mean any noticeable performance hit to the end users.

    If you can make a test case highlighting how's the tree panel declared and data filled, we should be able to tell the best moment the tree store's filterer setting can be changed.

    Note: a tree node from code behind like in this example works just fine by setting it via the AfterRender event.

    Looking forward to your follow-up!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] ComboBox : Selected value disappear after button click
    By matrixwebtech in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Mar 30, 2015, 7:50 AM
  2. [CLOSED] combobox value disappear after button click
    By matrixwebtech in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Feb 16, 2015, 6:09 AM
  3. Replies: 4
    Last Post: Sep 17, 2014, 8:25 AM
  4. Replies: 2
    Last Post: Jul 09, 2013, 1:18 PM
  5. Replies: 1
    Last Post: Sep 30, 2011, 11:15 AM

Tags for this Thread

Posting Permissions