1

How to provide xml data to TreeGrid-DataSource ?

I have string which contains data in xml format.

String xmlData =

<List>
<employee>
    <EmployeeId>4</EmployeeId>
    <ReportsTo>1</ReportsTo>
    <Name>Charles Madigen</Name>
</employee>

<employee>
    <EmployeeId>192</EmployeeId>
    <ReportsTo>4</ReportsTo>
    <Name>Ralph Brogan</Name>
</employee>
</List>

DataSource required dataUrl i.e. dataComing form ServerSide.

what about clientSide if I have data in xml format ? How to set this data to TreeGrids dataSource ?

Any help or guidance in this matter would be appreciated.

StackOverFlow
  • 4,486
  • 12
  • 52
  • 87

1 Answers1

0

This showcase example looks like what you are doing http://www.smartclient.com/smartgwt/showcase/#tree_databinding_ondemand

Abhijith
  • 2,592
  • 5
  • 18
  • 30
  • In a given showcase example : xml file stored on client location. In my case I am generating xml as String and Want to pass this string to TreeGrid-DataSource – StackOverFlow Mar 27 '12 at 13:27
  • As you are only playing client side, I would suggest to build your tree in the same time as you are building your Xml string without using any DataSource and just provide tour TreeGrid with this Tree. – Alain BUFERNE Mar 27 '12 at 13:32
  • @AlainBUFERNE Thanks for reply. I already tried --> Tree tree = new Tree();tree.addList(listOfTreeNodeFromLeafToChild, parentNode); treeGridSeletced.setData(tree); but I got this message --> A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete. Script: http://127.0.0.1:8888/smartgwttree/sc/modules/ISC_Grids.js:114 – StackOverFlow Mar 28 '12 at 11:31
  • I also tried targetTreeGrid.getTree().addList(listOfTreeNodeFromLeafToChild, parentNode); Still browser throwing msg : Unresponsive script + above msg in prev comment – StackOverFlow Mar 28 '12 at 11:36
  • @VaibhaV :hi vaibhav i am doing the same thing have u find any solution of this problem.If yes then please share with me. – Dhruva Sep 10 '12 at 11:46