Announcement

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

    how to get TreeGrid nodes as a listGridRecord[]

    i have extended the DataSource Class and have my own DataSource
    it's setClientOnly(true); and at certain event i fill it with the data returned from my server as a listGridRecords using addData (Record record).

    this DataSource is binded to a TreeGrid with the following properties :

    setAutoFetchData(true);
    setLoadDataOnDemand(false);
    setShowOpenIcons(false);
    setShowDropIcons(false);
    setClosedIconSuffix("");

    setDataSource(....Object from my DS....);

    on run time i want to get refrence to the treeGrid nodes using
    pTree.getRecords().
    OR
    pTree.getTree.getAllNodes();

    i have tried to use all available methods but i got the same Error :
    java.lang.ClassCastException: com.smartgwt.client.widgets.grid.ListGridRecord cannot be cast to com.smartgwt.client.widgets.tree.TreeNode.



    --- how i can access the treenodes by anyway ...please advice

    #2
    No one can have any idea for my problem ?? hope that any one can answer it's important
    thanks,...

    Comment


      #3
      Use TreeGrid.getRecords(). Make sure you're using the latest build and always post the version of Smart GWT, browser and OS when reporting an issue.

      Sanjiv

      Comment


        #4
        i take the latest build and i'm using SmartGwt 2.3
        also i used the getRecord Method but i got the same error ...
        cause in getRecord impl it use getOpenList(TreeNode node) and convert the node to TreeNode[] which give me the Error

        i over come this problem and make my native method that return the nodes as ListGridRecord which use internally convertToTreeNodeRecordArray(JavaScriptObject nativeArray) not convertToTreeNodeArray()
        and its work fine ...But i got a problem runing this code with internetExplorer 8
        it works fine with internetExplorer7!!!!
        do u have any idea why that happean?


        ...A.Elshal

        Comment


          #5
          If you think you've found a bug then post a standalone testcase.

          Comment

          Working...
          X