-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathIndex.vbhtml
25 lines (20 loc) · 872 Bytes
/
Index.vbhtml
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
<script type="text/javascript">
function OnBatchStartEdit(s, e) {
//client processing
var keyIndex = s.GetColumnByField("ID").index;
var key = e.rowValues[keyIndex].value;
var condition = key % 2 == 0;
if (e.focusedColumn.fieldName == "ID")
e.cancel = true;
if (e.focusedColumn.fieldName == "ClientSideCancel") //cancel example
if (!condition) e.cancel = true;
if (e.focusedColumn.fieldName == "ClientSideReadOnly") {
editor = s.GetEditor(e.focusedColumn.fieldName); // make read-only example
editor.SetReadOnly(!condition);
}
//server preprocessing
if (typeof s.cp_cellsToDisable[key] != "undefined" && s.cp_cellsToDisable[key] == e.focusedColumn.fieldName)
e.cancel = true;
}
</script>
@Html.Action("GridViewPartial")