Announcement

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

    TreeGrid DataBinding - Client-side Data Integration

    I have a server that provides XML response over HTTP. I need to bind this XML response to a TreeGrid. I went trough the SmartClient Reference 6.5.1 regarding Tree DataBinding, but was not able to find a solution.

    Following the examples provided in the SmartGWT Showcase I am able to build a tree from data in an XML file stored locally. ( http://www.smartclient.com/smartgwt/showcase/#tree_appearance_connectors )

    Can anyone please provide sample code on how to DataBind a TreeGrid with data coming as XML response from a server. (This is a starting point.. ultimately I am trying to build a tree with varying node types, something similar to http://forums.smartclient.com/showthread.php?t=65&highlight=TreeGrid+Databinding )

    #2
    DataBind TreeGrid with XML responce over HTTP

    Is it possible to DataBind a TreeGrid on the client-side with data from an XML response over HTTP. Can anyone please give a sample code.

    Thanks in advance for any help.

    Comment


      #3
      Originally posted by ADA
      Following the examples provided in the SmartGWT Showcase I am able to build a tree from data in an XML file stored locally. ( http://www.smartclient.com/smartgwt/showcase/#tree_appearance_connectors )
      The above sample does data bind to xml from the server over HTTP. It's just that the sample users a static xml file on the server. You can have the datasource dataURL point to your http path that serves up the xml dynamically.

      Comment


        #4
        browser same-origin policy issue

        Originally posted by smartgwt.dev
        The above sample does data bind to xml from the server over HTTP. It's just that the sample users a static xml file on the server. You can have the datasource dataURL point to your http path that serves up the xml dynamically.
        If I point the DataSource DataURL to the http path that serves up the xml response, I get the browser same-origin policy issue.

        "SmartClient can't directly contact URL due to browser same-origin policy use XJSONDataSource for JSONP protocol or use the server-side HttpProxy included with SmartClient Server."

        Comment


          #5
          You cannot load xml from a different domain due to cross domain restrictions. The only way around it use a server side proxy servlet. You can search this forum or Google for more info on cross domain restrictions of ajax.

          Sanjiv

          Comment

          Working...
          X