Community articleDisplaying a GET request in a Dojo grid
Added by IBM contributorIBM on September 27, 2013
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Here is sample code to send a GET request to the Domino® Data Service and read the response via a Dojo object.
This particular request is a Database collection GET das901Create New Article. The code is in an HTML file intended for installation on a Domino server at data\domino\html.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Domino Rest Services - Application collections</title>
<style type="text/css">
    @import "/domjs/dojo-1.5.0/dijit/themes/tundra/tundra.css";
    @import "/domjs/dojo-1.5.0/dojo/resources/dojo.css";
    @import "/domjs/dojo-1.5.0/dojox/grid/resources/tundraGrid.css"; 
<script type="text/javascript" src="/domjs/dojo-1.5.0/dojo/dojo.js"  
    djConfig="parseOnLoad: true"></script>
var dasurl = "";
var dasstore = new{target: dasurl,idAttribute:"*replicaid"});
#grid { 
    border: 1px solid #333;
    width: 100%;
    height: 400px;
    font-size: 0.9em;
    font-family: Geneva, Arial, Helvetica, sans-serif;
<body class="tundra">
	<div style="width: 95%; height: 95%; padding: 25px" >
		<h1>Domino Rest Services - Application collections</h1>
		<table id="grid" dojoType="dojox.grid.DataGrid" store="dasstore" 
         		clientSort="true" width="auto">
				<th field="@title" width="auto" >Title</th> 
				<th field="@filepath" width="auto" >Filepath</th> 
				<th field="@replicaid" width="auto" >ReplicaID</th> 
				<th field="@template" width="auto" >Template</th> 
				<th field="@link" width="auto" >Link</th> 

Explanatory notes:
  • For this GET request, create a object whose target is the resource URL, in this example
  • The dojox.grid.DataGrid table can then address response items from the REST store by name, for example, @title, @filepath, and so on.
  • For this example, if the name of the HTML file on the server is data\domino\html\dasdbreststore.html, the user addresses the file in a browser as:
Parent topic: Programming Domino Data Service