<html>
<head>
<link rel="stylesheet" type="text/css"
href="https://rawgit.com/vitmalina/w2ui/master/dist/w2ui.min.css" />
</head>
<body>
<div id="myGrid" style="height: 450px"></div>
</body>
<script type="module">
import { w2grid } from 'https://rawgit.com/vitmalina/w2ui/master/dist/w2ui.es6.min.js'
let grid = new w2grid({
name: 'myGrid',
columns: [
{ field: 'fname', text: 'First Name', size: '30%' },
{ field: 'lname', text: 'Last Name', size: '30%' },
{ field: 'email', text: 'Email', size: '40%' },
{ field: 'sdate', text: 'Start Date', size: '120px' },
],
records: [
{ recid: 1, fname: 'John', lname: 'Doe', email: 'jdoe@gmail.com', sdate: '4/3/2012' },
{ recid: 2, fname: 'Stuart', lname: 'Motzart', email: 'jdoe@gmail.com', sdate: '4/3/2012' },
{ recid: 3, fname: 'Jin', lname: 'Franson', email: 'jdoe@gmail.com', sdate: '4/3/2012' },
{ recid: 4, fname: 'Susan', lname: 'Ottie', email: 'jdoe@gmail.com', sdate: '4/3/2012' },
{ recid: 5, fname: 'Kelly', lname: 'Silver', email: 'jdoe@gmail.com', sdate: '4/3/2012' },
{ recid: 6, fname: 'Francis', lname: 'Gatos', email: 'jdoe@gmail.com', sdate: '4/3/2012' },
{ recid: 7, fname: 'Mark', lname: 'Welldo', email: 'jdoe@gmail.com', sdate: '4/3/2012' },
{ recid: 8, fname: 'Thomas', lname: 'Bahh', email: 'jdoe@gmail.com', sdate: '4/3/2012' },
{ recid: 9, fname: 'Sergei', lname: 'Rach', email: 'jdoe@gmail.com', sdate: '4/3/2012' }
]
})
grid.render('#myGrid')
</script>
</html>
xxxxxxxxxx
<html>
<head>
<link rel="stylesheet" type="text/css"
href="https://rawgit.com/vitmalina/w2ui/master/dist/w2ui.min.css" />
</head>
<body>
<div id="myGrid" style="height: 450px"></div>
</body>
<script type="module">
import { w2grid } from 'https://rawgit.com/vitmalina/w2ui/master/dist/w2ui.es6.min.js'
let grid = new w2grid({
name: 'myGrid',
url: 'data/records.json',
columns: [
{ field: 'fname', text: 'First Name', size: '30%' },
{ field: 'lname', text: 'Last Name', size: '30%' },
{ field: 'email', text: 'Email', size: '40%' },
{ field: 'sdate', text: 'Start Date', size: '120px' }
]
})
grid.render('#myGrid')
</script>
</html>
xxxxxxxxxx
request: {
"limit":100,
"offset":0,
"searchLogic":"AND",
"search":[
{"field":"age", "type":"int", "operator":"between", "value":[10,20]},
{"field":"fname", "type":"text", "operator":"begins", "value":"vit"}
],
"sort":[
{"field":"fname", "direction":"asc"},
{"field":"lname", "direction":"asc"}
]
}
xxxxxxxxxx
{
"status": "success",
"total": 36, // can be -1 (or unset) to indicate that total number is unknown
"records": [
{ "recid": 1, "field-1": "value-1", "field-N": "value-N" },
{ "recid": N, "field-1": "value-1", "field-N": "value-N" }
],
/* optional */
"summary": [
{ "recid": s1, "field-1": "value-1", "field-N": "value-N" }
]
}
xxxxxxxxxx
{
"status": "error",
"message": "Error Message"
}
xxxxxxxxxx
request: {
"action":"delete",
"recid": [1,2]
}
xxxxxxxxxx
{
"status" : "success"
}
xxxxxxxxxx
{
"status": "error",
"message": "Error Message"
}
xxxxxxxxxx
request: {
"action":"save"
"changes":[
{ "userid":1, "lname":"Cruze", "fname":"Tom" }
]
}
xxxxxxxxxx
{
"status" : "success"
}
xxxxxxxxxx
{
"status": "error",
"message": "Error Message"
}