Page tree
Skip to end of metadata
Go to start of metadata is the most popular grid display library.

In this example, we will demonstrate how to integrate Metamug API call with data table

<link href="" rel="stylesheet" type="text/css" />
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<table class="table table-striped" id="publisher-table">
      <th scope="col">#</th>
      <th scope="col">Name</th>
      <th scope="col">Profie View</th>
      <th scope="col">Registered On</th>
      <th scope="col">Last Visited</th>

Ajax Call

The ajax request needs to send Accept header as application/json+dataset.

    	'url': 'http://localhost:7000/bookmark/v1.0/publisher',
    	'type': 'GET',
		    'beforeSend': function (request) {
		        request.setRequestHeader("Accept", "application/json+dataset");
		    	return json.publisherList.dataset;

Rest Resource

<Resource xmlns="" v="1.0">
  <Request method="GET">
    <Desc> Example Resource </Desc>
    <Sql id="publisherList" > 
              select id, email, name, exp, registered_on, last_visited_on
        from publisher 

If the accept header is set to application/json+dataset it will return the data in 2D array format.

Metamug json dataset response


  • No labels