Search Results

Search found 1 results on 1 pages for 'wonderbread988'.

Page 1/1 | 1 

  • SmartGWT TreeGrid Selection

    - by wonderbread988
    I have a SmartGWT webapp that uses a TreeGrid with a dataSource. I would like this treeGrid to preselect values saved in a cookie. I have gotten the value to be saved in the cookie correctly, however I have tried several different methods of getting the treeGrid to select these values and I can not get it to work. I am attempting to do this in the onmoduleLoad method in my entry point. I have tried: Cookies.setCookie( "selectedUnit", TreeGrid.getSelectedPaths() ) to set the cookie and then when the page is reloaded: TreeGrid.setSelectedPaths( Cookies.getCookie("selectedUnit" ) When I could not get that to work, I tried storing just the id of the item selected: Cookies.setCookies( "selectedUnit", TreeGrid.getSelected().getAttribute("id") ) and then onLoad attempting to find that record and select it: TreeGrid.selectRecord( TreeGrid.getTree().find("id", Cookies.getCookie("selectedUnit") ) ) This did not work either, so finally I tried storing TreeGrid.getSelectedState() and upon retrieving that value form the cookie onLoad, passing it to TreeGrid.setSelectedState() similar to my first attempt, but passing state instead of path. I could not get any of these things to work. Can I not tell the TreeGrid to select an item in the 'OnmoduleLoad' method? Is this action only valid after the TreeGrid has been drawn? If that is the case where and how can I do this? Thank you in advance for any help you can give.

    Read the article

1