1
<!DOCTYPE html>
2
<html>
3
<head>
4
    <meta charset="utf-8" />
5
    <title>Wialon Playground - Unit edit fields</title>
6
    <script type="text/javascript" src="//code.jquery.com/jquery-latest.min.js"></script>
7
    <script type="text/javascript" src="//hst-api.wialon.com/wsdk/script/wialon.js"></script>
8
</head>
9
<body>
10
11
<p>
12
    Select unit:
13
        <select id="units">
HTML
2
 
1
#log, td{ border: 1px solid #c6c6c6; padding:5px;}
2
table select, table input { width:100%; }
CSS
210
 
1
var cur_unit = null; // global variable
2
var cur_prop = null; // global variable
3
var sess = null;
4
5
// Print message to log
6
function msg(text) { $("#log").prepend(text + "<br/>"); }
7
8
function init() { // Execute after login succeed
9
    $unitsSelect = $("#units");
10
    sess = wialon.core.Session.getInstance(); // get instance of current Session
11
  
12
  
13
    // flags to specify what kind of data should be returned
14
    var flags = wialon.item.Item.dataFlag.base;
15
16
    sess.updateDataFlags( // load items to current session
17
    [{type: "type", data: "avl_unit", flags: flags, mode: 0}], // Items specification
JS
Result
Source code of example Close ✕
1
 
1
/*source*/