Success! Looks like we've fixed this one. According to our records the fix was applied for EXTGWT-2908 in a recent build.
  1. #1
    Sencha User
    Join Date
    Jan 2013
    Posts
    10
    Vote Rating
    0
    mariusz.saternus@markit.com is on a distinguished road

      0  

    Default AsyncTreeGrid Filter issue (looped loading after filter application)

    AsyncTreeGrid Filter issue (looped loading after filter application)


    I have a async TreeGrid. On start up the widget loads all the nodes and then each individual node expands to reveal an arbitrary number of leafs. All this works well until I try to apply filters. After choosing a filter option the display only shows two nodes (as it should, according to the filter) and the leaf load process is being started automatically for both of them. The issue is that even though the server returns the entries for the leafs, they are never 'attached' to the node. Instead it just tries to load them over and over. So at this stage I have a couple of questions:
    • First of all I only want the filter to apply at node level and not leaf level.
    • Second is it possible to not expand the nodes after applying filters?
    • Lastly how do I stop this infinite loading issue? What might also be important is that in my TreeGrid nodes and leafs are of the same object type (based on their characteristics I make the decision on the server if I should load node or leaf representation). Also I override hasChildren in my TreeLoader.
    To re-iterate: the issue only happens after I apply the filter, before that everything gets loaded correctly (nodes, leafs etc) Thanks

  2. #2
    Sencha User
    Join Date
    Jan 2013
    Posts
    10
    Vote Rating
    0
    mariusz.saternus@markit.com is on a distinguished road

      0  

    Default


    OK, after doing some more digging this is what I found / think is happening:

    After the filter is being applied leafs are automatically fetched for each node that fits the filter criteria. Because of the enabled filter the code in the TreeStore (lines 792-795) are never executed. In a normal (non async) case they are not executed neither, however the async load process is still working in the background and I think it doesn't get confirmation that the load operation was successful, so it loads the same data again with causes the whole process to repeat over and over.

    Has anyone encountered a similar problem before and/or got an AsynTreeGrid working with filters?

  3. #3
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    This sounds like it could possibly be a bug, but I'd need to see how it is wired up to confirm. Can you try modifying one of the TreeGrid examples to use filters - this will allow us to both run a simple standalone example that demonstrates the issue.

    Grid filters are not expressly designed to work with the TreeGrid, but in my initial testing it seemed to behave as expected.

    Which versions of GWT and GXT are you using?

    EDIT: I thought this was in the GXT 3 questions, but now I see that it is in the 2.x Q&A forum. In light of that, there *is* specific TreeGrid support for filters - make sure you as using the com.extjs.gxt.ui.client.widget.treegrid.filters.TreeGridFilters class.

  4. #4
    Sencha User
    Join Date
    Jan 2013
    Posts
    10
    Vote Rating
    0
    mariusz.saternus@markit.com is on a distinguished road

      0  

    Default


    Yes that is the class that I'm using. The GXT ver is 2.2.5 and is GWT 2.4. The code below demonstrates the issue:

    Code:
    package com.issue.client; 
      
    import java.util.Arrays;  
    import java.util.List;  
      
    import com.extjs.gxt.ui.client.Registry;  
    import com.extjs.gxt.ui.client.Style.HorizontalAlignment;  
    import com.extjs.gxt.ui.client.data.BaseTreeLoader;  
    import com.extjs.gxt.ui.client.data.ModelData;  
    import com.extjs.gxt.ui.client.data.ModelKeyProvider;  
    import com.extjs.gxt.ui.client.data.RpcProxy;  
    import com.extjs.gxt.ui.client.data.TreeLoader;  
    import com.extjs.gxt.ui.client.store.Store;  
    import com.extjs.gxt.ui.client.store.StoreSorter;  
    import com.extjs.gxt.ui.client.store.TreeStore;  
    import com.extjs.gxt.ui.client.util.IconHelper;  
    import com.extjs.gxt.ui.client.widget.ContentPanel;  
    import com.extjs.gxt.ui.client.widget.LayoutContainer;  
    import com.extjs.gxt.ui.client.widget.button.ToolButton;  
    import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;  
    import com.extjs.gxt.ui.client.widget.grid.ColumnModel;  
    import com.extjs.gxt.ui.client.widget.grid.filters.StringFilter;
    import com.extjs.gxt.ui.client.widget.layout.FitLayout;  
    import com.extjs.gxt.ui.client.widget.layout.FlowLayout;  
    import com.extjs.gxt.ui.client.widget.tips.ToolTipConfig;  
    import com.extjs.gxt.ui.client.widget.treegrid.TreeGrid;  
    import com.extjs.gxt.ui.client.widget.treegrid.TreeGridCellRenderer;  
    import com.extjs.gxt.ui.client.widget.treegrid.filters.TreeGridFilters;
    import com.google.gwt.core.shared.GWT;
    import com.google.gwt.i18n.client.DateTimeFormat;  
    import com.google.gwt.user.client.Element;  
    import com.google.gwt.user.client.rpc.AsyncCallback;  
    @SuppressWarnings("deprecation")  
    public class AsyncTreeGridExample extends LayoutContainer {  
      
      @Override  
      protected void onRender(Element parent, int index) {  
        super.onRender(parent, index);  
      
        setLayout(new FlowLayout(10));  
      
        final GreetingServiceAsync service = GWT.create(GreetingService.class);  
      
        // data proxy  
        RpcProxy<List<FileModel>> proxy = new RpcProxy<List<FileModel>>() {  
          @Override  
          protected void load(Object loadConfig, AsyncCallback<List<FileModel>> callback) {  
            service.getFolderChildren((FileModel) loadConfig, callback);  
          }  
        };  
      
        // tree loader  
        final TreeLoader<FileModel> loader = new BaseTreeLoader<FileModel>(proxy) {  
          @Override  
          public boolean hasChildren(FileModel parent) {  
            return parent instanceof FolderModel;  
          }  
        };  
      
        // trees store  
        final TreeStore<FileModel> store = new TreeStore<FileModel>(loader);  
        store.setStoreSorter(new StoreSorter<FileModel>() {  
      
          @Override  
          public int compare(Store<FileModel> store, FileModel m1, FileModel m2, String property) {  
            boolean m1Folder = m1 instanceof FolderModel;  
            boolean m2Folder = m2 instanceof FolderModel;  
      
            if (m1Folder && !m2Folder) {  
              return -1;  
            } else if (!m1Folder && m2Folder) {  
              return 1;  
            }  
      
            return super.compare(store, m1, m2, property);  
          }  
        });  
      
        ColumnConfig name = new ColumnConfig("name", "Name", 100);  
        name.setRenderer(new TreeGridCellRenderer<ModelData>());  
      
        ColumnConfig date = new ColumnConfig("date", "Date", 100);  
        date.setDateTimeFormat(DateTimeFormat.getMediumDateTimeFormat());  
      
        ColumnConfig size = new ColumnConfig("size", "Size", 100);  
      
        ColumnModel cm = new ColumnModel(Arrays.asList(name, date, size));  
      
        ContentPanel cp = new ContentPanel();  
        cp.setBodyBorder(false);  
        cp.setHeading("Async TreeGrid");  
        cp.setButtonAlign(HorizontalAlignment.CENTER);  
        cp.setLayout(new FitLayout());  
        cp.setFrame(true);  
        cp.setSize(600, 300);  
        
        TreeGridFilters filters = new TreeGridFilters();  
        StringFilter nameFilter = new StringFilter("name");   
        filters.addFilter(nameFilter);   
      
        TreeGrid<ModelData> tree = new TreeGrid<ModelData>(store, cm);  
        tree.setCaching(false);
        store.setKeyProvider(new ModelKeyProvider<FileModel>() {  
      
          public String getKey(FileModel model) {  
            return model.<String> get("id");  
          }  
      
        });  
        tree.setBorders(true);  
        tree.getStyle().setLeafIcon(IconHelper.createStyle("icon-page"));  
        tree.setSize(400, 400);  
        tree.setAutoExpandColumn("name");  
        tree.setTrackMouseOver(false); 
        tree.addPlugin(filters);
        cp.add(tree);  
      
        ToolTipConfig config = new ToolTipConfig();  
        config.setTitle("Example Information");  
        config.setShowDelay(1);  
        config.setText("In this example state has been enabled for the treegrid. When enabled, the expand state of the treegrid is "  
            + "saved and restored using the StateManager. Try refreshing the browser after expanding some nodes in the "  
            + "treegrid. Notice that this works with asynchronous loading of nodes.");  
      
        ToolButton btn = new ToolButton("x-tool-help");  
        btn.setToolTip(config);  
      
        cp.getHeader().addTool(btn);  
      
        add(cp);  
      }  
      
    }
    In this example (and in the work I'm doing) I try to re-use the code from examples on your site as much as possible. I used code from the AsyncTreeGrid example (http://www.sencha.com/examples-2/#asynctreegrid) and just added filtering. The only other thing I changed is the name for the 'FileServce' I replaced it with the auto generated GreetingService. However the code is identical to the original FileService one from your examples.

    The issue still persists. Try filtering by name to see results.

  5. #5
    Sencha User
    Join Date
    Jan 2013
    Posts
    10
    Vote Rating
    0
    mariusz.saternus@markit.com is on a distinguished road

      0  

    Default


    Any updates on this? If I need to raise a support ticket for this then just let me know. However I would imagine that what I'm trying to achieve here is within the realm of things that one would expect should work 'out of the box' and not something that one should raise a support ticket to get fixed

    I mean have you been at least able to replicate the problem?

  6. #6
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    As this is the community forum, I mostly try to get people on the right track to finding out how to fix something, to provide enough details so others can help out, or to file a bug if it looks like there is an issue. Sorry for not checking back. If an issue is important, consider the premium help forum, or filing a support ticket.

    I hadn't run the app yet, but having done so, I'm not sure if it is a bug in how it works, or in the API itself. There is a flag in TreeGrid (both 2.x and 3.x it seems) called filtering, but it is never being set. I've tried a few quick experiments to see when it needs to be set (setting it when the TreeGrid is created, setting it to true only when filters are active), but it isn't behaving correctly yet.

    Before I move this to the bugs forum, I want to try to make sure I understand what you are trying to do. The purpose of the TreeLoader is to pull in one set of children at a time, but when filtering you either want
    a) filter all possible children and load all possible subtrees that include those children, or
    b) filter only the currently loaded children

    If A, that isn't going to use a TreeLoader - you need something else to properly grab the entire tree structure from the server and replace every level on the client.
    If B, that is going to be a *local* filter - you'll download the items from the remote server as the user opens things, and when they specify a filter, only sift through the items already available on the client.

    The best way for A to be implemented internally, with just the proxy you've specified, would be for it to make a request on every single container, loading all children. The server would have to know to send a node along if *it* or *any possible child* matches the current filter.

    For B, we still have a bug. I'm looking into it, and will report back.

  7. #7
    Sencha User
    Join Date
    Jan 2013
    Posts
    10
    Vote Rating
    0
    mariusz.saternus@markit.com is on a distinguished road

      0  

    Default


    What I am effectively trying to do is to combine AsyncTreeGrid behaviour (exactly like in http://www.sencha.com/examples-2/#asynctreegrid) so that at one time leafs get loaded for a particular node. In my set up initially I load all the nodes and each node has a set of leafs (I never have node within nodes). So the example you provided on your site works really well for me here. When I apply filtering what I want to happen is to filter only on the values of nodes (not leafs, however it so happens that leafs, of a given node, contain the same value in the same column for the filtered property). What I want to happen to filter on the results that I already have (so this would correspond to your scenario and only show the nodes that match the filter. I do not even, if that helps, need them to expand once filtered. So yes we still have a bug.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi