Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Tree Grid implementation issues

    BuildDate Wed Mar 05 15:52:00 IST 2014
    Version 4.1p
    SCVersionNumber v9.1p_2014-03-05

    Team,

    I am implementing TreeGrid for my application. Since TreeGrid basically extends ListGrid i expected to get same funtionality behaviour from both. But i am facing multiple issues which are listed as follows :-
    1) Till the data has not arrived for my grid , My list grid shows a data loading message. On investigation i found that it is using this CSS :-

    Code:
    .loadingDataMessage,
    .offlineMessage,
    .emptyMessage {
      color: black;
      font-family: Arial, Verdana, sans-serif;
      font-size: 11px;
      padding: 11px;
    }
    But my tree grid is unable to use this. So can you show me a way how to make use of this in my TreeGrid too.
    I have tried using

    Code:
        setLoadingDataMessageStyle("loadingDataMessage");
                    setEmptyMessageStyle("emptyMessage");
                    setOfflineMessageStyle("offlineMessage");
    which is not working.

    2)My both grids use setShowFilterEditor(true)(with some customisations , although they are same in listgrid and tree grid) . But list grid uses 'contains' criteria but tree grid is using exact word search
    For example : my data has 'Mozambique' as a field value.
    List grid yields results even if i type 'moz'. But tree Grid does not. Upon investigating the query formed at back end I found the difference in the query formed.

    3) This also concerns the CSS(in my opinion)
    List grid headers show arrows for sorted columns.My Tree grid does not.

    I have attached the CSS we are using and screenshot of our requirement

    4)Lastly TreeGrid child node in my case is also showing folder icon same as parent. Upon clicking it it processes complete request and then shows it as empty. Is there any specific setting for showing no icon to child and a particular icon to parent.
    setNodeIcon() and setFolderIcon() can be usedin any way to meet my needs?
    Attached Files
    Last edited by mchoudhary; 10 Sep 2014, 02:13. Reason: Forgot to add attachments

    #2
    1) Nothing is different and you can see several samples in the Showcase where trees show a loading message while data is being fetched. You must be using code that differs from the samples; we'd need to see it in order to help.

    2) This is controlled via listGrid/treeGrid.autoFetchTextMatchStyle. As the docs tell you, exact match is what you want when fetching via load on demand, so if you want substring match elsewhere, consider setting formItem.operator via treeGridField.filterEditorProperties

    3) Also not the case, as you can readily see in the Showcase

    4) See tree.defaultIsFolder for several ways of controlling this

    Comment


      #3
      2) Can you plesae guide abit more.
      I am trying something like this :-

      Code:
       TextItem item = new TextItem();
                          item.setHint("Search");
                          item.setCriterionGetter(new FormItemCriterionGetter() {
                              
                              @Override
                              public Criterion getCriterion(DynamicForm form, FormItem item, TextMatchStyle textMatchStyle) {
                                  textMatchStyle=TextMatchStyle.SUBSTRING;
                                  item.setOperator(OperatorId.ICONTAINS);
                                 return item.getCriterion();
                              }
                              @Override
                              public Criterion getCriterion(DynamicForm form, FormItem item) {
                                  return null;
                              }
                          });
                          listGridArray[index].setFilterEditorProperties(item);
      Last edited by mchoudhary; 10 Sep 2014, 02:14.

      Comment


        #4
        So again we suggest simply setting FormItem.operator - this would be via the setOperator method, whereas the overrides you are attempting are only appropriate for more advanced use cases.

        Comment


          #5
          Thanks for your help.

          Issue 2 and 4 have worked out nicely.
          But i still cannot resolve problems 1 and 3.
          Sorting examples on showcase that i have seen all show sorting being handled on UI.That much is working on my code as well. Problem is when i am setting sort in code i.e in a programif i set a sort that does not work.
          For loading icon as well, i couldn't spot any differnece between codes on showcase and the one i have implemented.
          Still for reference I have attached the most relevant code snippet where all properties are being set for Tree grid.
          Attached Files

          Comment


            #6
            Sorry, we can't run your code, and we don't see anything in the partial code that you shared that would break the built-in features of showing a loading messages while fetching data, or showing sort indicators for sorted columns. Most likely the problem is in code you have not shared.

            To investigate further, we need a way to reproduce the problem - ideally, a ready-to-run, standalone test case.

            Comment


              #7
              Team,

              Loader icon on startup issue is still unresolved.
              I am facing this issue with the library mentioned above but with the previous version we dont face this problem.
              Previous version number is:-

              1. Smart GWT version: v9.0p_2013-07-29/PowerEdition Deployment (built 2013-07-29)
              2. GWT version: 2.5.0

              I have attached exact sample code also for reference.
              Does that help now?
              Attached Files

              Comment


                #8
                This issue should be fixed in the next nightly build (dated Sep 20 or above)

                Regards
                Isomorphic Software

                Comment


                  #9
                  We cannot use next build in our project. So can you please give some fix that would work with this build as well.(May be some kind of work around)

                  Comment


                    #10
                    There is one more issue:-

                    I am not able to customize my images for leaf nodes.The code i have used is :-

                    Code:
                    treeGrid.setCustomIconProperty("treeGridChild");
                    treeGrid.setNodeIcon("[SKIN]/treeGridChild.png");
                    where treeGrid is my instance for TreeGrid. And my image "treeGridChild.png" lies parallel to file.png. But still i always get the error :-
                    [error]
                    setImage: image 'icon_-1' couldn't be found
                    [/error]

                    Also if i try to rename "treeGridChild.png" to "file.png". it shows the right image but 3*3 sized image gets resized to 16*16 image which i clearly don't want.

                    Comment


                      #11
                      See docs for customIconProperty - what it does it change the name of the property in the TreeNode where a node-specific icon URL is stored. So the settings you've shown don't really make any sense unless you are also putting icon URLs in your tree data.

                      The rendered size of the icon is controlled by the iconSize property.

                      You need to pick up a new build to get fixes - download it from smartclient.com/builds.

                      Comment

                      Working...
                      X