Hi,
I am trying to build a TreeGrid populating with the 'Title' field for the first level from YAHOO! JSON Services http://api.search.yahoo.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&output=json
I am trying with the Yahoo! JSON Services example under Data Integration from the SmartGWT Showcase. I am just replacing the ListGrid show in the example with a TreeGrid. The tree shows "Loading data.." , and a window with the message "Finding records that match your criteria..." then Getting a Script warning.
Script warning from GWT -
"A script on this page is causing mozilla to run slowly. If it continues to run, your computer may become unresponsive. Do you want to abort the script?"
Script warning from a Standalone browser -
"Warning: Unresponsive script. A script on this page may be busy, or it may have stopped responding." Along with a random script like
Script: http://localhost:8888/com.mycompany.Campaign/sc/client/language/Tree.js:905
or
Script: http://localhost:8888/com.mycompany.Campaign/sc/client/language/Array.js:132
or
Script: http://localhost:8888/com.mycompany.Campaign/sc/client/language/Array.js:772
or
Script: http://localhost:8888/com.mycompany.Campaign/sc/client/language/IsA.js:173
Can anyone please let me know what I am missing here or point me to any sample code.
I am using SmartGWT 1.0 b2 and GWT 1.5.3 for linux.
Thanks in advance for any help.
Following is the code
I am trying to build a TreeGrid populating with the 'Title' field for the first level from YAHOO! JSON Services http://api.search.yahoo.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&output=json
I am trying with the Yahoo! JSON Services example under Data Integration from the SmartGWT Showcase. I am just replacing the ListGrid show in the example with a TreeGrid. The tree shows "Loading data.." , and a window with the message "Finding records that match your criteria..." then Getting a Script warning.
Script warning from GWT -
"A script on this page is causing mozilla to run slowly. If it continues to run, your computer may become unresponsive. Do you want to abort the script?"
Script warning from a Standalone browser -
"Warning: Unresponsive script. A script on this page may be busy, or it may have stopped responding." Along with a random script like
Script: http://localhost:8888/com.mycompany.Campaign/sc/client/language/Tree.js:905
or
Script: http://localhost:8888/com.mycompany.Campaign/sc/client/language/Array.js:132
or
Script: http://localhost:8888/com.mycompany.Campaign/sc/client/language/Array.js:772
or
Script: http://localhost:8888/com.mycompany.Campaign/sc/client/language/IsA.js:173
Can anyone please let me know what I am missing here or point me to any sample code.
I am using SmartGWT 1.0 b2 and GWT 1.5.3 for linux.
Thanks in advance for any help.
Following is the code
Code:
XJSONDataSource xjsonDS = new XJSONDataSource(); xjsonDS.setDataURL("http://api.search.yahoo.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&output=json"); xjsonDS.setRecordXPath("/ResultSet/Result"); DataSourceIntegerField pkField = new DataSourceIntegerField("pk"); pkField.setHidden(true); pkField.setPrimaryKey(true); DataSourceTextField title = new DataSourceTextField("Title"); title.setRootValue("1"); xjsonDS.addField(pkField); xjsonDS.addField(title); final TreeGrid jsonTree = new TreeGrid(); jsonTree.setLoadDataOnDemand(false); jsonTree.setTop(100); jsonTree.setWidth("30%"); jsonTree.setHeight("60%"); jsonTree.setShowConnectors(true); jsonTree.setNodeIcon("icons/16/folder_document.png"); jsonTree.setFolderIcon("icons/16/folder_out.png"); jsonTree.setShowOpenIcons(false); jsonTree.setShowDropIcons(false); jsonTree.setClosedIconSuffix(""); jsonTree.setBaseStyle("noBorderCell"); jsonTree.setShowAllRecords(true); jsonTree.setDataSource(xjsonDS); button.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() { public void onClick( com.smartgwt.client.widgets.form.fields.events.ClickEvent event) { jsonTree.fetchData(form.getValuesAsCriteria()); } });
Comment