在下文中,我想/books.xml
用类似http://server:port/books
. 本质上,XmlStore 将由其他服务器或端口提供服务,而不是提供服务的服务器或端口
<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>