Announcement

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

    Lazy loading facet values when expanding tree in CubeGrid

    Hello,
    I'm developping an application that is using the cubegrid. I have 3 dependent facets that I have grouped in a tree facet (for the record the facets names are career, function, sub-function). I would like to load the facet values on demand in order to not to have to build the tree in advance as this would be resource consuming.
    I've read in the documentation that facet values could be loaded on demand:
    "Including lazily loading data for expanding/collapsing tree facets and when facetValues are made visible programmatically or via menus."
    From what I've seen in CubeGrid there is no event when a user expand a tree, there's only a function call to a toggle_collapse function. Reading the forums I've seen that in that case I would have to re-create the CubeGrid after adding the facet values.
    Could you give an example an how to add an event when tree facet is expanded and recreate the tree?
    I'm using SmartClient v8.1
    Thanks.

    #2
    The CubeGrid will load data (as in CellRecords) when tree facets are expanded and collapsed, but currently there's no support for the tree facet itself to be loaded on demand, and there is no documented framework API for picking up an event when the tree is expanded. With some low-level hacking you could add your own click handler to the DOM elements directly. The most maintainable solution is probably to sponsor a feature to make the CubeGrid capable of load on demand for tree facets:

    http://www.smartclient.com/services/index.jsp#features

    Comment


      #3
      Hi,
      Could you give me an example of how I would add this event handler to the DOM? Could you give some pointer? I think I would have to overwrite the drawing part, since this event handler will have to be present on newly created arrow component.
      Thanks.

      Comment


        #4
        This is an unsupported hack - but if you look at the DOM with eg Firebug you can see the turndown arrows have an onmousedown handler calling a JavaScript function on the cube. You could override that function in JSNI.

        Comment


          #5
          So the trick would be to override isc_CubeGrid__toggleOpenState, and call fecthData to get the facet values?
          Would I have to recreate the cubegrid?

          Comment


            #6
            Yes, you would have to re-created the CubeGrid with the new tree facet. Note that since you're re-creating the cube, you're going to lose any expand/collapse state unless you are careful to preserve it, and it's not going to be nearly as fast to re-create the cube as to just expand a tree facet that's already loaded. Our actual recommendation is to just load the whole tree facet up front or sponsor load on demand tree facets as a new feature.

            Comment


              #7
              I've just made a query, and found that we have near from 4200 combinations in the tree (we have 3 levels), won't this be overkill for the cube grid? Can we go that way, generating the facet values first?

              Comment


                #8
                This should be OK, especially if you do not need to support IE6. Just be sure that you set the tree so that it's initially mostly collapsed.

                Comment


                  #9
                  I'll try that then. We have to support IE7+ and the idea is to have everything closed at loading time and the user would drill down this facet.

                  Comment


                    #10
                    Since there might be cases of facets with thousands of members, it would seem that our best bet is overriding isc_CubeGrid__toggleOpenState.
                    Can we rely on the fact that isc_CubeGrid__toggleOpenState will still be around in upcoming releases?

                    Comment


                      #11
                      As was repeatedly stated above - this would be a hack and the right approach is to sponsor a feature.

                      Comment


                        #12
                        Should be included basicly on the cube !

                        Then you can say the cube functionality is not suitable for complex business which results in thousands of combinations for facet values !!

                        Comment


                          #13
                          No, that would be quite an absurd and obviously false thing to say, since the cube has been shipping with a variety of complex business applications for years.

                          As covered above, tree facets with thousands of nodes are fine, even though this would generally be considered poorly usability.

                          On legacy browsers such as IE8, displaying tens of thousands of nodes in a single tree facet may require some kind of filtering before showing the cube as such, which again would generally be a better UI, as well as more efficient.

                          Comment


                            #14
                            Originally posted by Isomorphic View Post
                            No, that would be quite an absurd and obviously false thing to say, since the cube has been shipping with a variety of complex business applications for years.

                            As covered above, tree facets with thousands of nodes are fine, even though this would generally be considered poorly usability.

                            On legacy browsers such as IE8, displaying tens of thousands of nodes in a single tree facet may require some kind of filtering before showing the cube as such, which again would generally be a better UI, as well as more efficient.
                            Please! , let's talk in a technical & practical way!. We have thousands of nodes for the facet values , about (25,000 Customers, 500 Sales Persons and about 4000 Items) which we need to combine as facets with their values (each of the past entities has a classification hierarchy ends with one of these entities as the leaf node),

                            What already happens is that when we are trying to load all these data (the full hierarchy with the entities as leafs) before the cube generation , the application just hangs up & become not responding anymore, that's a normal result for loading 10s of thousands of facet values objects in the memory!

                            If you are suggesting some workaround here to be made please make it -technical wise- clear enough. or just dun say the cube is fine with complex business without a technical proof.
                            Thank you ..

                            Comment


                              #15
                              Originally posted by minaazmy View Post
                              Please! , let's talk in a technical & practical way!. We have thousands of nodes for the facet values , about (25,000 Customers, 500 Sales Persons and about 4000 Items) which we need to combine as facets with their values (each of the past entities has a classification hierarchy ends with one of these entities as the leaf node),

                              What already happens is that when we are trying to load all these data (the full hierarchy with the entities as leafs) before the cube generation , the application just hangs up & become not responding anymore, that's a normal result for loading 10s of thousands of facet values objects in the memory!

                              If you are suggesting some workaround here to be made please make it -technical wise- clear enough. or just dun say the cube is fine with complex business without a technical proof.
                              Thank you ..
                              PS: We are not working on IE , we are working on FF..

                              Comment

                              Working...
                              X