Reputation:

Can I create a dojox.data.XmlStore with a url pointing to a different port or server

In the following, I want to replace /books.xml with something like http://server:port/books. In essence the XmlStore to be served by some other server or port than the one serving this

<div dojoType="dojox.data.XmlStore" url="/books.xml" jsId="fileStore_book" rootItem="book"></div>
<div dojoType="dojox.grid.data.DojoData" jsId="model_fileStore_book" store="fileStore_book" query="{title:'*'}"></div>
<div
    id="fileGrid_book"
    dojoType="dojox.Grid"
    model="model_fileStore_book"
    rowsPerPage="10"
    style="width: 400px; height: 300px;"
>
    <script type="dojo/method">this.setStructure([{cells: [[{field: "isbn", name: "ISBN", width: 10}, {field: "author", name: "Author", width: 10}, {field: "title", name: "Title", width: 'auto'}]]}]);</script>
</div>

Upvotes: 0

Views: 1217

Answers (1)

Eugene Lazutkin
Eugene Lazutkin

Reputation: 43956

The data store is bound by "the same origin" restrictions like all data sources in web applications. You should either proxy the other server using your server, or consider alternative means of data access, e.g., JSONP, or the window-name transport.

Upvotes: 0

Related Questions