x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
    <meta charset="utf-8" />
5
    <title>Система контроля за подвижными элементами</title>
6
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
7
    <script type="text/javascript" src="https://hst-api.wialon.com/wsdk/script/wialon.js"></script>
8
</head>
9
<body> 
10
    
11
    
12
<table>
13
  <tr>
HTML
5
 
1
td, th{ border: 1px solid #c6c6c6; }
2
.wrap{ max-height:150px; overflow-y: auto; }
3
.odd, th{ background:#EEE; border: 1px solid #c6c6c6; }
4
ul{ list-style: none; margin:0px; padding:0px; display:block;overflow-y: auto; max-height: 200px;width: 300px}
5
label{ cursor:pointer; }
CSS
213
 
1
// Print message to log
2
function msg(text) { $("#log").prepend(text + "<br/>"); }
3
4
function init()
5
{
6
    var res_flags = wialon.item.Item.dataFlag.base | wialon.item.Resource.dataFlag.reports;
7
    var flags = wialon.item.Item.dataFlag.base | wialon.item.Unit.dataFlag.lastMessage | wialon.item.Item.dataFlag.customFields; 
8
    
9
    var sess = wialon.core.Session.getInstance(); // get instance of current Session
10
    // flags to specify what kind of data should be returned
11
    sess.loadLibrary("resourceReports"); // load Reports Library
12
    sess.loadLibrary("itemCustomFields");
13
    sess.updateDataFlags( // load items to current session
14
    [
15
        { type: "type",
16
          data: "avl_unit",
17
          flags: flags,
JS
Result
Source code of example Close ✕
1
 
1
/*source*/