Skip to content

Commit

Permalink
Update grid.html
Browse files Browse the repository at this point in the history
  • Loading branch information
vitmalina committed Apr 16, 2021
1 parent eb199dc commit 9c5016c
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions docs/overview/grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ <h3>Grid Overview</h3>
<ul>
<li><a href="#ex1">Example 1</a> - local data source</li>
<li><a href="#ex2">Example 2</a> - remove data source</li>
<li><a href="#data-structures">Request Data Stracture</a></li>
<li><a href="#data-structures2">Response Data Stracture</a></li>
<li><a href="#struct-request">Request Data Stracture</a></li>
<li><a href="#struct-response">Response Data Stracture</a></li>
<li><a href="#struct-delete">Delete Requestst</a></li>
<li><a href="#struct-save">Save Request</a></li>
</ul>
<div id="ex1" style="height: 20px"></div>

<h4 id="ex1">Example 1 - Local Data Source</h4>
<h4>Example 1 - Local Data Source</h4>

Below is a simple example how to use the grid. This grid does not pull records from the server, but uses local data source.
It shows the minimum HTML and JavaScript you need to have to display the grid.
Expand Down Expand Up @@ -50,9 +53,9 @@ <h4 id="ex1">Example 1 - Local Data Source</h4>
</script>
</html>
</textarea>
<div style="height: 20px"></div>
<div id="ex2" style="height: 20px"></div>

<h4 id="ex2">Example 2 - Remote Data Source</h4>
<h4>Example 2 - Remote Data Source</h4>
This example displays similar grid as the example above, but it retrieves records from the server. It assumes that you have a file
data/records.json relative to where your example runs that returns JSON structure.

Expand Down Expand Up @@ -81,9 +84,9 @@ <h4 id="ex2">Example 2 - Remote Data Source</h4>
</script>
</html>
</textarea>
<div style="height: 20px"></div>
<div id="struct-request" style="height: 20px"></div>

<h4 id="data-structures">Request Data Structure</h4>
<h4>Request Data Structure</h4>

The grid communicates with the server by sending a HTTP request in the format displayed below. Keep in mind that not all of the parameters are
sent with each requests. Parameters such as search, sort, etc. might not be submitted if user did not apply them. The grid will also submit
Expand All @@ -109,9 +112,9 @@ <h4 id="data-structures">Request Data Structure</h4>
</textarea>

However, you can control how you want request data to be encoded. See <a class="property" href="w2utils.settings">w2utils.settings</a> - see dataType.
<div style="height: 20px"></div>
<div id="struct-response" style="height: 20px"></div>

<h4 id="data-structures2">Response Data Structure</h4>
<h4>Response Data Structure</h4>

The grid expects data in the JSON format from the server as it is described below.

Expand All @@ -137,7 +140,7 @@ <h4 id="data-structures2">Response Data Structure</h4>
"message": "Error Message"
}
</textarea>
<div style="height: 20px"></div>
<div id="struct-delete" style="height: 20px"></div>

<h4>Delete Records</h4>

Expand All @@ -163,7 +166,7 @@ <h4>Delete Records</h4>
"message": "Error Message"
}
</textarea>
<div style="height: 20px"></div>
<div id="struct-save" style="height: 20px"></div>

<h4>Save Records</h4>

Expand Down

0 comments on commit 9c5016c

Please sign in to comment.