-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample08.html
More file actions
44 lines (36 loc) · 1.39 KB
/
Copy pathexample08.html
File metadata and controls
44 lines (36 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
<HEAD>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>set row/column background color from server</TITLE>
<script type="text/javascript" src="./oGrid.js"></script>
<link type="text/css" rel="stylesheet" href="oGrid.css" />
<style type="text/css">
.oGrid .error{background-color:#ffee00;color:red;}
</style>
<SCRIPT language="javascript">
var obj;
window.onload = function () {
obj = new obj4u.oGrid(dataTable);
obj.event.AddEvent("onLog", showLog);
obj.event.AddEvent("onSelectedRow", oGrid_SelectedRow);
obj.loadUrl = 'http://obj4u.com/samples/getJSON3.php';
//obj.reloadPage = false; // when this page only view data can use this function.
obj.load("init");
obj.renderData();
}
function oGrid_SelectedRow(rowElement, row) {
var selectedRows = obj.getSelectRows();
alert(rowElement.rowIndex + "," + row.index + " , " + selectedRows.length + "," + row["Id"]);
}
function showLog(msg) {
alert(msg);
}
</SCRIPT>
</HEAD>
<BODY>
<TABLE id="dataTable">
</TABLE>
</BODY>
</HTML>