Skip to content

Instantly share code, notes, and snippets.

@MrCoder
Created March 15, 2016 07:32
Show Gist options
  • Save MrCoder/4913b3eb9e7b4d778573 to your computer and use it in GitHub Desktop.
Save MrCoder/4913b3eb9e7b4d778573 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
/* START MicrosoftAjax.js */
//----------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------
// MicrosoftAjax.js
Function.__typeName = "Function";
Function.__class = true;
Function.createCallback = function (b, a) {
return function () {
var e = arguments.length;
if (e > 0) {
var d = [];
for (var c = 0; c < e; c++)d[c] = arguments[c];
d[e] = a;
return b.apply(this, d)
}
return b.call(this, a)
}
};
Function.createDelegate = function (a, b) {
return function () {
return b.apply(a, arguments)
}
};
Function.emptyFunction = Function.emptyMethod = function () {
};
Function.validateParameters = function (c, b, a) {
return Function._validateParams(c, b, a)
};
Function._validateParams = function (g, e, c) {
var a, d = e.length;
c = c || typeof c === "undefined";
a = Function._validateParameterCount(g, e, c);
if (a) {
a.popStackFrame();
return a
}
for (var b = 0, i = g.length; b < i; b++) {
var f = e[Math.min(b, d - 1)], h = f.name;
if (f.parameterArray)h += "[" + (b - d + 1) + "]"; else if (!c && b >= d)break;
a = Function._validateParameter(g[b], f, h);
if (a) {
a.popStackFrame();
return a
}
}
return null
};
Function._validateParameterCount = function (j, d, i) {
var a, c, b = d.length, e = j.length;
if (e < b) {
var f = b;
for (a = 0; a < b; a++) {
var g = d[a];
if (g.optional || g.parameterArray)f--
}
if (e < f)c = true
} else if (i && e > b) {
c = true;
for (a = 0; a < b; a++)if (d[a].parameterArray) {
c = false;
break
}
}
if (c) {
var h = Error.parameterCount();
h.popStackFrame();
return h
}
return null
};
Function._validateParameter = function (c, a, h) {
var b, g = a.type, l = !!a.integer, k = !!a.domElement, m = !!a.mayBeNull;
b = Function._validateParameterType(c, g, l, k, m, h);
if (b) {
b.popStackFrame();
return b
}
var e = a.elementType, f = !!a.elementMayBeNull;
if (g === Array && typeof c !== "undefined" && c !== null && (e || !f)) {
var j = !!a.elementInteger, i = !!a.elementDomElement;
for (var d = 0; d < c.length; d++) {
var n = c[d];
b = Function._validateParameterType(n, e, j, i, f, h + "[" + d + "]");
if (b) {
b.popStackFrame();
return b
}
}
}
return null
};
Function._validateParameterType = function (b, c, k, j, h, d) {
var a, g;
if (typeof b === "undefined")if (h)return null; else {
a = Error.argumentUndefined(d);
a.popStackFrame();
return a
}
if (b === null)if (h)return null; else {
a = Error.argumentNull(d);
a.popStackFrame();
return a
}
if (c && c.__enum) {
if (typeof b !== "number") {
a = Error.argumentType(d, Object.getType(b), c);
a.popStackFrame();
return a
}
if (b % 1 === 0) {
var e = c.prototype;
if (!c.__flags || b === 0) {
for (g in e)if (e[g] === b)return null
} else {
var i = b;
for (g in e) {
var f = e[g];
if (f === 0)continue;
if ((f & b) === f)i -= f;
if (i === 0)return null
}
}
}
a = Error.argumentOutOfRange(d, b, String.format(Sys.Res.enumInvalidValue, b, c.getName()));
a.popStackFrame();
return a
}
if (j && (!Sys._isDomElement(b) || b.nodeType === 3)) {
a = Error.argument(d, Sys.Res.argumentDomElement);
a.popStackFrame();
return a
}
if (c && !Sys._isInstanceOfType(c, b)) {
a = Error.argumentType(d, Object.getType(b), c);
a.popStackFrame();
return a
}
if (c === Number && k)if (b % 1 !== 0) {
a = Error.argumentOutOfRange(d, b, Sys.Res.argumentInteger);
a.popStackFrame();
return a
}
return null
};
Error.__typeName = "Error";
Error.__class = true;
Error.create = function (d, b) {
var a = new Error(d);
a.message = d;
if (b)for (var c in b)a[c] = b[c];
a.popStackFrame();
return a
};
Error.argument = function (a, c) {
var b = "Sys.ArgumentException: " + (c ? c : Sys.Res.argument);
if (a)b += "\n" + String.format(Sys.Res.paramName, a);
var d = Error.create(b, {name: "Sys.ArgumentException", paramName: a});
d.popStackFrame();
return d
};
Error.argumentNull = function (a, c) {
var b = "Sys.ArgumentNullException: " + (c ? c : Sys.Res.argumentNull);
if (a)b += "\n" + String.format(Sys.Res.paramName, a);
var d = Error.create(b, {name: "Sys.ArgumentNullException", paramName: a});
d.popStackFrame();
return d
};
Error.argumentOutOfRange = function (c, a, d) {
var b = "Sys.ArgumentOutOfRangeException: " + (d ? d : Sys.Res.argumentOutOfRange);
if (c)b += "\n" + String.format(Sys.Res.paramName, c);
if (typeof a !== "undefined" && a !== null)b += "\n" + String.format(Sys.Res.actualValue, a);
var e = Error.create(b, {name: "Sys.ArgumentOutOfRangeException", paramName: c, actualValue: a});
e.popStackFrame();
return e
};
Error.argumentType = function (d, c, b, e) {
var a = "Sys.ArgumentTypeException: ";
if (e)a += e; else if (c && b)a += String.format(Sys.Res.argumentTypeWithTypes, c.getName(), b.getName()); else a += Sys.Res.argumentType;
if (d)a += "\n" + String.format(Sys.Res.paramName, d);
var f = Error.create(a, {name: "Sys.ArgumentTypeException", paramName: d, actualType: c, expectedType: b});
f.popStackFrame();
return f
};
Error.argumentUndefined = function (a, c) {
var b = "Sys.ArgumentUndefinedException: " + (c ? c : Sys.Res.argumentUndefined);
if (a)b += "\n" + String.format(Sys.Res.paramName, a);
var d = Error.create(b, {name: "Sys.ArgumentUndefinedException", paramName: a});
d.popStackFrame();
return d
};
Error.format = function (a) {
var c = "Sys.FormatException: " + (a ? a : Sys.Res.format), b = Error.create(c, {name: "Sys.FormatException"});
b.popStackFrame();
return b
};
Error.invalidOperation = function (a) {
var c = "Sys.InvalidOperationException: " + (a ? a : Sys.Res.invalidOperation), b = Error.create(c, {name: "Sys.InvalidOperationException"});
b.popStackFrame();
return b
};
Error.notImplemented = function (a) {
var c = "Sys.NotImplementedException: " + (a ? a : Sys.Res.notImplemented), b = Error.create(c, {name: "Sys.NotImplementedException"});
b.popStackFrame();
return b
};
Error.parameterCount = function (a) {
var c = "Sys.ParameterCountException: " + (a ? a : Sys.Res.parameterCount), b = Error.create(c, {name: "Sys.ParameterCountException"});
b.popStackFrame();
return b
};
Error.prototype.popStackFrame = function () {
if (typeof this.stack === "undefined" || this.stack === null || typeof this.fileName === "undefined" || this.fileName === null || typeof this.lineNumber === "undefined" || this.lineNumber === null)return;
var a = this.stack.split("\n"), c = a[0], e = this.fileName + ":" + this.lineNumber;
while (typeof c !== "undefined" && c !== null && c.indexOf(e) === -1) {
a.shift();
c = a[0]
}
var d = a[1];
if (typeof d === "undefined" || d === null)return;
var b = d.match(/@(.*):(\d+)$/);
if (typeof b === "undefined" || b === null)return;
this.fileName = b[1];
this.lineNumber = parseInt(b[2]);
a.shift();
this.stack = a.join("\n")
};
Object.__typeName = "Object";
Object.__class = true;
Object.getType = function (b) {
var a = b.constructor;
if (!a || typeof a !== "function" || !a.__typeName || a.__typeName === "Object")return Object;
return a
};
Object.getTypeName = function (a) {
return Object.getType(a).getName()
};
String.__typeName = "String";
String.__class = true;
String.prototype.endsWith = function (a) {
return this.substr(this.length - a.length) === a
};
String.prototype.startsWith = function (a) {
return this.substr(0, a.length) === a
};
String.prototype.trim = function () {
return this.replace(/^\s+|\s+$/g, "")
};
String.prototype.trimEnd = function () {
return this.replace(/\s+$/, "")
};
String.prototype.trimStart = function () {
return this.replace(/^\s+/, "")
};
String.format = function () {
return String._toFormattedString(false, arguments)
};
String._toFormattedString = function (l, j) {
var c = "", e = j[0];
for (var a = 0; true;) {
var f = e.indexOf("{", a), d = e.indexOf("}", a);
if (f < 0 && d < 0) {
c += e.slice(a);
break
}
if (d > 0 && (d < f || f < 0)) {
c += e.slice(a, d + 1);
a = d + 2;
continue
}
c += e.slice(a, f);
a = f + 1;
if (e.charAt(a) === "{") {
c += "{";
a++;
continue
}
if (d < 0)break;
var h = e.substring(a, d), g = h.indexOf(":"), k = parseInt(g < 0 ? h : h.substring(0, g), 10) + 1, i = g < 0 ? "" : h.substring(g + 1), b = j[k];
if (typeof b === "undefined" || b === null)b = "";
if (b.toFormattedString)c += b.toFormattedString(i); else if (l && b.localeFormat)c += b.localeFormat(i); else if (b.format)c += b.format(i); else c += b.toString();
a = d + 1
}
return c
};
Boolean.__typeName = "Boolean";
Boolean.__class = true;
Boolean.parse = function (b) {
var a = b.trim().toLowerCase();
if (a === "false")return false;
if (a === "true")return true
};
Date.__typeName = "Date";
Date.__class = true;
Number.__typeName = "Number";
Number.__class = true;
RegExp.__typeName = "RegExp";
RegExp.__class = true;
if (!window)this.window = this;
window.Type = Function;
Type.prototype.callBaseMethod = function (a, d, b) {
var c = Sys._getBaseMethod(this, a, d);
if (!b)return c.apply(a); else return c.apply(a, b)
};
Type.prototype.getBaseMethod = function (a, b) {
return Sys._getBaseMethod(this, a, b)
};
Type.prototype.getBaseType = function () {
return typeof this.__baseType === "undefined" ? null : this.__baseType
};
Type.prototype.getInterfaces = function () {
var a = [], b = this;
while (b) {
var c = b.__interfaces;
if (c)for (var d = 0, f = c.length; d < f; d++) {
var e = c[d];
if (!Array.contains(a, e))a[a.length] = e
}
b = b.__baseType
}
return a
};
Type.prototype.getName = function () {
return typeof this.__typeName === "undefined" ? "" : this.__typeName
};
Type.prototype.implementsInterface = function (d) {
this.resolveInheritance();
var c = d.getName(), a = this.__interfaceCache;
if (a) {
var e = a[c];
if (typeof e !== "undefined")return e
} else a = this.__interfaceCache = {};
var b = this;
while (b) {
var f = b.__interfaces;
if (f)if (Array.indexOf(f, d) !== -1)return a[c] = true;
b = b.__baseType
}
return a[c] = false
};
Type.prototype.inheritsFrom = function (b) {
this.resolveInheritance();
var a = this.__baseType;
while (a) {
if (a === b)return true;
a = a.__baseType
}
return false
};
Type.prototype.initializeBase = function (a, b) {
this.resolveInheritance();
if (this.__baseType)if (!b)this.__baseType.apply(a); else this.__baseType.apply(a, b);
return a
};
Type.prototype.isImplementedBy = function (a) {
if (typeof a === "undefined" || a === null)return false;
var b = Object.getType(a);
return !!(b.implementsInterface && b.implementsInterface(this))
};
Type.prototype.isInstanceOfType = function (a) {
return Sys._isInstanceOfType(this, a)
};
Type.prototype.registerClass = function (c, b, d) {
this.prototype.constructor = this;
this.__typeName = c;
this.__class = true;
if (b) {
this.__baseType = b;
this.__basePrototypePending = true
}
Sys.__upperCaseTypes[c.toUpperCase()] = this;
if (d) {
this.__interfaces = [];
for (var a = 2, f = arguments.length; a < f; a++) {
var e = arguments[a];
this.__interfaces.push(e)
}
}
return this
};
Type.prototype.registerInterface = function (a) {
Sys.__upperCaseTypes[a.toUpperCase()] = this;
this.prototype.constructor = this;
this.__typeName = a;
this.__interface = true;
return this
};
Type.prototype.resolveInheritance = function () {
if (this.__basePrototypePending) {
var b = this.__baseType;
b.resolveInheritance();
for (var a in b.prototype) {
var c = b.prototype[a];
if (!this.prototype[a])this.prototype[a] = c
}
delete this.__basePrototypePending
}
};
Type.getRootNamespaces = function () {
return Array.clone(Sys.__rootNamespaces)
};
Type.isClass = function (a) {
if (typeof a === "undefined" || a === null)return false;
return !!a.__class
};
Type.isInterface = function (a) {
if (typeof a === "undefined" || a === null)return false;
return !!a.__interface
};
Type.isNamespace = function (a) {
if (typeof a === "undefined" || a === null)return false;
return !!a.__namespace
};
Type.parse = function (typeName, ns) {
var fn;
if (ns) {
fn = Sys.__upperCaseTypes[ns.getName().toUpperCase() + "." + typeName.toUpperCase()];
return fn || null
}
if (!typeName)return null;
if (!Type.__htClasses)Type.__htClasses = {};
fn = Type.__htClasses[typeName];
if (!fn) {
fn = eval(typeName);
Type.__htClasses[typeName] = fn
}
return fn
};
Type.registerNamespace = function (e) {
var d = window, c = e.split(".");
for (var b = 0; b < c.length; b++) {
var f = c[b], a = d[f];
if (!a)a = d[f] = {};
if (!a.__namespace) {
if (b === 0 && e !== "Sys")Sys.__rootNamespaces[Sys.__rootNamespaces.length] = a;
a.__namespace = true;
a.__typeName = c.slice(0, b + 1).join(".");
a.getName = function () {
return this.__typeName
}
}
d = a
}
};
Type._checkDependency = function (c, a) {
var d = Type._registerScript._scripts, b = d ? !!d[c] : false;
if (typeof a !== "undefined" && !b)throw Error.invalidOperation(String.format(Sys.Res.requiredScriptReferenceNotIncluded, a, c));
return b
};
Type._registerScript = function (a, c) {
var b = Type._registerScript._scripts;
if (!b)Type._registerScript._scripts = b = {};
if (b[a])throw Error.invalidOperation(String.format(Sys.Res.scriptAlreadyLoaded, a));
b[a] = true;
if (c)for (var d = 0, f = c.length; d < f; d++) {
var e = c[d];
if (!Type._checkDependency(e))throw Error.invalidOperation(String.format(Sys.Res.scriptDependencyNotFound, a, e))
}
};
Type.registerNamespace("Sys");
Sys.__upperCaseTypes = {};
Sys.__rootNamespaces = [Sys];
Sys._isInstanceOfType = function (c, b) {
if (typeof b === "undefined" || b === null)return false;
if (b instanceof c)return true;
var a = Object.getType(b);
return !!(a === c) || a.inheritsFrom && a.inheritsFrom(c) || a.implementsInterface && a.implementsInterface(c)
};
Sys._getBaseMethod = function (d, e, c) {
var b = d.getBaseType();
if (b) {
var a = b.prototype[c];
return a instanceof Function ? a : null
}
return null
};
Sys._isDomElement = function (a) {
var c = false;
if (typeof a.nodeType !== "number") {
var b = a.ownerDocument || a.document || a;
if (b != a) {
var d = b.defaultView || b.parentWindow;
c = d != a
} else c = typeof b.body === "undefined"
}
return !c
};
Array.__typeName = "Array";
Array.__class = true;
Array.add = Array.enqueue = function (a, b) {
a[a.length] = b
};
Array.addRange = function (a, b) {
a.push.apply(a, b)
};
Array.clear = function (a) {
a.length = 0
};
Array.clone = function (a) {
if (a.length === 1)return [a[0]]; else return Array.apply(null, a)
};
Array.contains = function (a, b) {
return Sys._indexOf(a, b) >= 0
};
Array.dequeue = function (a) {
return a.shift()
};
Array.forEach = function (b, e, d) {
for (var a = 0, f = b.length; a < f; a++) {
var c = b[a];
if (typeof c !== "undefined")e.call(d, c, a, b)
}
};
Array.indexOf = function (a, c, b) {
return Sys._indexOf(a, c, b)
};
Array.insert = function (a, b, c) {
a.splice(b, 0, c)
};
Array.parse = function (value) {
if (!value)return [];
return eval(value)
};
Array.remove = function (b, c) {
var a = Sys._indexOf(b, c);
if (a >= 0)b.splice(a, 1);
return a >= 0
};
Array.removeAt = function (a, b) {
a.splice(b, 1)
};
Sys._indexOf = function (d, e, a) {
if (typeof e === "undefined")return -1;
var c = d.length;
if (c !== 0) {
a = a - 0;
if (isNaN(a))a = 0; else {
if (isFinite(a))a = a - a % 1;
if (a < 0)a = Math.max(0, c + a)
}
for (var b = a; b < c; b++)if (typeof d[b] !== "undefined" && d[b] === e)return b
}
return -1
};
Type._registerScript._scripts = {
"MicrosoftAjaxCore.js": true,
"MicrosoftAjaxGlobalization.js": true,
"MicrosoftAjaxSerialization.js": true,
"MicrosoftAjaxComponentModel.js": true,
"MicrosoftAjaxHistory.js": true,
"MicrosoftAjaxNetwork.js": true,
"MicrosoftAjaxWebServices.js": true
};
Sys.IDisposable = function () {
};
Sys.IDisposable.prototype = {};
Sys.IDisposable.registerInterface("Sys.IDisposable");
Sys.StringBuilder = function (a) {
this._parts = typeof a !== "undefined" && a !== null && a !== "" ? [a.toString()] : [];
this._value = {};
this._len = 0
};
Sys.StringBuilder.prototype = {
append: function (a) {
this._parts[this._parts.length] = a
}, appendLine: function (a) {
this._parts[this._parts.length] = typeof a === "undefined" || a === null || a === "" ? "\r\n" : a + "\r\n"
}, clear: function () {
this._parts = [];
this._value = {};
this._len = 0
}, isEmpty: function () {
if (this._parts.length === 0)return true;
return this.toString() === ""
}, toString: function (a) {
a = a || "";
var b = this._parts;
if (this._len !== b.length) {
this._value = {};
this._len = b.length
}
var d = this._value;
if (typeof d[a] === "undefined") {
if (a !== "")for (var c = 0; c < b.length;)if (typeof b[c] === "undefined" || b[c] === "" || b[c] === null)b.splice(c, 1); else c++;
d[a] = this._parts.join(a)
}
return d[a]
}
};
Sys.StringBuilder.registerClass("Sys.StringBuilder");
Sys.Browser = {};
Sys.Browser.InternetExplorer = {};
Sys.Browser.Firefox = {};
Sys.Browser.Safari = {};
Sys.Browser.Opera = {};
Sys.Browser.agent = null;
Sys.Browser.hasDebuggerStatement = false;
Sys.Browser.name = navigator.appName;
Sys.Browser.version = parseFloat(navigator.appVersion);
Sys.Browser.documentMode = 0;
if (navigator.userAgent.indexOf(" MSIE ") > -1) {
Sys.Browser.agent = Sys.Browser.InternetExplorer;
Sys.Browser.version = parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]);
if (Sys.Browser.version >= 8)if (document.documentMode >= 7)Sys.Browser.documentMode = document.documentMode;
Sys.Browser.hasDebuggerStatement = true
} else if (navigator.userAgent.indexOf(" Firefox/") > -1) {
Sys.Browser.agent = Sys.Browser.Firefox;
Sys.Browser.version = parseFloat(navigator.userAgent.match(/Firefox\/(\d+\.\d+)/)[1]);
Sys.Browser.name = "Firefox";
Sys.Browser.hasDebuggerStatement = true
} else if (navigator.userAgent.indexOf(" AppleWebKit/") > -1) {
Sys.Browser.agent = Sys.Browser.Safari;
Sys.Browser.version = parseFloat(navigator.userAgent.match(/AppleWebKit\/(\d+(\.\d+)?)/)[1]);
Sys.Browser.name = "Safari"
} else if (navigator.userAgent.indexOf("Opera/") > -1)Sys.Browser.agent = Sys.Browser.Opera;
Sys.EventArgs = function () {
};
Sys.EventArgs.registerClass("Sys.EventArgs");
Sys.EventArgs.Empty = new Sys.EventArgs;
Sys.CancelEventArgs = function () {
Sys.CancelEventArgs.initializeBase(this);
this._cancel = false
};
Sys.CancelEventArgs.prototype = {
get_cancel: function () {
return this._cancel
}, set_cancel: function (a) {
this._cancel = a
}
};
Sys.CancelEventArgs.registerClass("Sys.CancelEventArgs", Sys.EventArgs);
Type.registerNamespace("Sys.UI");
Sys._Debug = function () {
};
Sys._Debug.prototype = {
_appendConsole: function (a) {
if (typeof Debug !== "undefined" && Debug.writeln)Debug.writeln(a);
if (window.console && window.console.log)window.console.log(a);
if (window.opera)window.opera.postError(a);
if (window.debugService)window.debugService.trace(a)
}, _appendTrace: function (b) {
var a = document.getElementById("TraceConsole");
if (a && a.tagName.toUpperCase() === "TEXTAREA")a.value += b + "\n"
}, assert: function (c, a, b) {
if (!c) {
a = b && this.assert.caller ? String.format(Sys.Res.assertFailedCaller, a, this.assert.caller) : String.format(Sys.Res.assertFailed, a);
if (confirm(String.format(Sys.Res.breakIntoDebugger, a)))this.fail(a)
}
}, clearTrace: function () {
var a = document.getElementById("TraceConsole");
if (a && a.tagName.toUpperCase() === "TEXTAREA")a.value = ""
}, fail: function (message) {
this._appendConsole(message);
if (Sys.Browser.hasDebuggerStatement)eval("debugger")
}, trace: function (a) {
this._appendConsole(a);
this._appendTrace(a)
}, traceDump: function (a, b) {
var c = this._traceDump(a, b, true)
}, _traceDump: function (a, c, f, b, d) {
c = c ? c : "traceDump";
b = b ? b : "";
if (a === null) {
this.trace(b + c + ": null");
return
}
switch (typeof a) {
case "undefined":
this.trace(b + c + ": Undefined");
break;
case "number":
case "string":
case "boolean":
this.trace(b + c + ": " + a);
break;
default:
if (Date.isInstanceOfType(a) || RegExp.isInstanceOfType(a)) {
this.trace(b + c + ": " + a.toString());
break
}
if (!d)d = []; else if (Array.contains(d, a)) {
this.trace(b + c + ": ...");
return
}
Array.add(d, a);
if (a == window || a === document || window.HTMLElement && a instanceof HTMLElement || typeof a.nodeName === "string") {
var k = a.tagName ? a.tagName : "DomElement";
if (a.id)k += " - " + a.id;
this.trace(b + c + " {" + k + "}")
} else {
var i = Object.getTypeName(a);
this.trace(b + c + (typeof i === "string" ? " {" + i + "}" : ""));
if (b === "" || f) {
b += " ";
var e, j, l, g, h;
if (Array.isInstanceOfType(a)) {
j = a.length;
for (e = 0; e < j; e++)this._traceDump(a[e], "[" + e + "]", f, b, d)
} else for (g in a) {
h = a[g];
if (!Function.isInstanceOfType(h))this._traceDump(h, g, f, b, d)
}
}
}
Array.remove(d, a)
}
}
};
Sys._Debug.registerClass("Sys._Debug");
Sys.Debug = new Sys._Debug;
Sys.Debug.isDebug = false;
function Sys$Enum$parse(c, e) {
var a, b, i;
if (e) {
a = this.__lowerCaseValues;
if (!a) {
this.__lowerCaseValues = a = {};
var g = this.prototype;
for (var f in g)a[f.toLowerCase()] = g[f]
}
} else a = this.prototype;
if (!this.__flags) {
i = e ? c.toLowerCase() : c;
b = a[i.trim()];
if (typeof b !== "number")throw Error.argument("value", String.format(Sys.Res.enumInvalidValue, c, this.__typeName));
return b
} else {
var h = (e ? c.toLowerCase() : c).split(","), j = 0;
for (var d = h.length - 1; d >= 0; d--) {
var k = h[d].trim();
b = a[k];
if (typeof b !== "number")throw Error.argument("value", String.format(Sys.Res.enumInvalidValue, c.split(",")[d].trim(), this.__typeName));
j |= b
}
return j
}
}
function Sys$Enum$toString(c) {
if (typeof c === "undefined" || c === null)return this.__string;
var d = this.prototype, a;
if (!this.__flags || c === 0) {
for (a in d)if (d[a] === c)return a
} else {
var b = this.__sortedValues;
if (!b) {
b = [];
for (a in d)b[b.length] = {key: a, value: d[a]};
b.sort(function (a, b) {
return a.value - b.value
});
this.__sortedValues = b
}
var e = [], g = c;
for (a = b.length - 1; a >= 0; a--) {
var h = b[a], f = h.value;
if (f === 0)continue;
if ((f & c) === f) {
e[e.length] = h.key;
g -= f;
if (g === 0)break
}
}
if (e.length && g === 0)return e.reverse().join(", ")
}
return ""
}
Type.prototype.registerEnum = function (b, c) {
Sys.__upperCaseTypes[b.toUpperCase()] = this;
for (var a in this.prototype)this[a] = this.prototype[a];
this.__typeName = b;
this.parse = Sys$Enum$parse;
this.__string = this.toString();
this.toString = Sys$Enum$toString;
this.__flags = c;
this.__enum = true
};
Type.isEnum = function (a) {
if (typeof a === "undefined" || a === null)return false;
return !!a.__enum
};
Type.isFlags = function (a) {
if (typeof a === "undefined" || a === null)return false;
return !!a.__flags
};
Sys.CollectionChange = function (e, a, c, b, d) {
this.action = e;
if (a)if (!(a instanceof Array))a = [a];
this.newItems = a || null;
if (typeof c !== "number")c = -1;
this.newStartingIndex = c;
if (b)if (!(b instanceof Array))b = [b];
this.oldItems = b || null;
if (typeof d !== "number")d = -1;
this.oldStartingIndex = d
};
Sys.CollectionChange.registerClass("Sys.CollectionChange");
Sys.NotifyCollectionChangedAction = function () {
throw Error.notImplemented()
};
Sys.NotifyCollectionChangedAction.prototype = {add: 0, remove: 1, reset: 2};
Sys.NotifyCollectionChangedAction.registerEnum("Sys.NotifyCollectionChangedAction");
Sys.NotifyCollectionChangedEventArgs = function (a) {
this._changes = a;
Sys.NotifyCollectionChangedEventArgs.initializeBase(this)
};
Sys.NotifyCollectionChangedEventArgs.prototype = {
get_changes: function () {
return this._changes || []
}
};
Sys.NotifyCollectionChangedEventArgs.registerClass("Sys.NotifyCollectionChangedEventArgs", Sys.EventArgs);
Sys.Observer = function () {
};
Sys.Observer.registerClass("Sys.Observer");
Sys.Observer.makeObservable = function (a) {
var c = a instanceof Array, b = Sys.Observer;
if (a.setValue === b._observeMethods.setValue)return a;
b._addMethods(a, b._observeMethods);
if (c)b._addMethods(a, b._arrayMethods);
return a
};
Sys.Observer._addMethods = function (c, b) {
for (var a in b)c[a] = b[a]
};
Sys.Observer._addEventHandler = function (c, a, b) {
Sys.Observer._getContext(c, true).events._addHandler(a, b)
};
Sys.Observer.addEventHandler = function (c, a, b) {
Sys.Observer._addEventHandler(c, a, b)
};
Sys.Observer._removeEventHandler = function (c, a, b) {
Sys.Observer._getContext(c, true).events._removeHandler(a, b)
};
Sys.Observer.removeEventHandler = function (c, a, b) {
Sys.Observer._removeEventHandler(c, a, b)
};
Sys.Observer.raiseEvent = function (b, e, d) {
var c = Sys.Observer._getContext(b);
if (!c)return;
var a = c.events.getHandler(e);
if (a)a(b, d)
};
Sys.Observer.addPropertyChanged = function (b, a) {
Sys.Observer._addEventHandler(b, "propertyChanged", a)
};
Sys.Observer.removePropertyChanged = function (b, a) {
Sys.Observer._removeEventHandler(b, "propertyChanged", a)
};
Sys.Observer.beginUpdate = function (a) {
Sys.Observer._getContext(a, true).updating = true
};
Sys.Observer.endUpdate = function (b) {
var a = Sys.Observer._getContext(b);
if (!a || !a.updating)return;
a.updating = false;
var d = a.dirty;
a.dirty = false;
if (d) {
if (b instanceof Array) {
var c = a.changes;
a.changes = null;
Sys.Observer.raiseCollectionChanged(b, c)
}
Sys.Observer.raisePropertyChanged(b, "")
}
};
Sys.Observer.isUpdating = function (b) {
var a = Sys.Observer._getContext(b);
return a ? a.updating : false
};
Sys.Observer._setValue = function (a, j, g) {
var b, f, k = a, d = j.split(".");
for (var i = 0, m = d.length - 1; i < m; i++) {
var l = d[i];
b = a["get_" + l];
if (typeof b === "function")a = b.call(a); else a = a[l];
var n = typeof a;
if (a === null || n === "undefined")throw Error.invalidOperation(String.format(Sys.Res.nullReferenceInPath, j))
}
var e, c = d[m];
b = a["get_" + c];
f = a["set_" + c];
if (typeof b === "function")e = b.call(a); else e = a[c];
if (typeof f === "function")f.call(a, g); else a[c] = g;
if (e !== g) {
var h = Sys.Observer._getContext(k);
if (h && h.updating) {
h.dirty = true;
return
}
Sys.Observer.raisePropertyChanged(k, d[0])
}
};
Sys.Observer.setValue = function (b, a, c) {
Sys.Observer._setValue(b, a, c)
};
Sys.Observer.raisePropertyChanged = function (b, a) {
Sys.Observer.raiseEvent(b, "propertyChanged", new Sys.PropertyChangedEventArgs(a))
};
Sys.Observer.addCollectionChanged = function (b, a) {
Sys.Observer._addEventHandler(b, "collectionChanged", a)
};
Sys.Observer.removeCollectionChanged = function (b, a) {
Sys.Observer._removeEventHandler(b, "collectionChanged", a)
};
Sys.Observer._collectionChange = function (d, c) {
var a = Sys.Observer._getContext(d);
if (a && a.updating) {
a.dirty = true;
var b = a.changes;
if (!b)a.changes = b = [c]; else b.push(c)
} else {
Sys.Observer.raiseCollectionChanged(d, [c]);
Sys.Observer.raisePropertyChanged(d, "length")
}
};
Sys.Observer.add = function (a, b) {
var c = new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add, [b], a.length);
Array.add(a, b);
Sys.Observer._collectionChange(a, c)
};
Sys.Observer.addRange = function (a, b) {
var c = new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add, b, a.length);
Array.addRange(a, b);
Sys.Observer._collectionChange(a, c)
};
Sys.Observer.clear = function (a) {
var b = Array.clone(a);
Array.clear(a);
Sys.Observer._collectionChange(a, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.reset, null, -1, b, 0))
};
Sys.Observer.insert = function (a, b, c) {
Array.insert(a, b, c);
Sys.Observer._collectionChange(a, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add, [c], b))
};
Sys.Observer.remove = function (a, b) {
var c = Array.indexOf(a, b);
if (c !== -1) {
Array.remove(a, b);
Sys.Observer._collectionChange(a, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.remove, null, -1, [b], c));
return true
}
return false
};
Sys.Observer.removeAt = function (b, a) {
if (a > -1 && a < b.length) {
var c = b[a];
Array.removeAt(b, a);
Sys.Observer._collectionChange(b, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.remove, null, -1, [c], a))
}
};
Sys.Observer.raiseCollectionChanged = function (b, a) {
Sys.Observer.raiseEvent(b, "collectionChanged", new Sys.NotifyCollectionChangedEventArgs(a))
};
Sys.Observer._observeMethods = {
add_propertyChanged: function (a) {
Sys.Observer._addEventHandler(this, "propertyChanged", a)
}, remove_propertyChanged: function (a) {
Sys.Observer._removeEventHandler(this, "propertyChanged", a)
}, addEventHandler: function (a, b) {
Sys.Observer._addEventHandler(this, a, b)
}, removeEventHandler: function (a, b) {
Sys.Observer._removeEventHandler(this, a, b)
}, get_isUpdating: function () {
return Sys.Observer.isUpdating(this)
}, beginUpdate: function () {
Sys.Observer.beginUpdate(this)
}, endUpdate: function () {
Sys.Observer.endUpdate(this)
}, setValue: function (b, a) {
Sys.Observer._setValue(this, b, a)
}, raiseEvent: function (b, a) {
Sys.Observer.raiseEvent(this, b, a)
}, raisePropertyChanged: function (a) {
Sys.Observer.raiseEvent(this, "propertyChanged", new Sys.PropertyChangedEventArgs(a))
}
};
Sys.Observer._arrayMethods = {
add_collectionChanged: function (a) {
Sys.Observer._addEventHandler(this, "collectionChanged", a)
}, remove_collectionChanged: function (a) {
Sys.Observer._removeEventHandler(this, "collectionChanged", a)
}, add: function (a) {
Sys.Observer.add(this, a)
}, addRange: function (a) {
Sys.Observer.addRange(this, a)
}, clear: function () {
Sys.Observer.clear(this)
}, insert: function (a, b) {
Sys.Observer.insert(this, a, b)
}, remove: function (a) {
return Sys.Observer.remove(this, a)
}, removeAt: function (a) {
Sys.Observer.removeAt(this, a)
}, raiseCollectionChanged: function (a) {
Sys.Observer.raiseEvent(this, "collectionChanged", new Sys.NotifyCollectionChangedEventArgs(a))
}
};
Sys.Observer._getContext = function (b, c) {
var a = b._observerContext;
if (a)return a();
if (c)return (b._observerContext = Sys.Observer._createContext())();
return null
};
Sys.Observer._createContext = function () {
var a = {events: new Sys.EventHandlerList};
return function () {
return a
}
};
Date._appendPreOrPostMatch = function (e, b) {
var d = 0, a = false;
for (var c = 0, g = e.length; c < g; c++) {
var f = e.charAt(c);
switch (f) {
case "'":
if (a)b.append("'"); else d++;
a = false;
break;
case "\\":
if (a)b.append("\\");
a = !a;
break;
default:
b.append(f);
a = false
}
}
return d
};
Date._expandFormat = function (a, b) {
if (!b)b = "F";
var c = b.length;
if (c === 1)switch (b) {
case "d":
return a.ShortDatePattern;
case "D":
return a.LongDatePattern;
case "t":
return a.ShortTimePattern;
case "T":
return a.LongTimePattern;
case "f":
return a.LongDatePattern + " " + a.ShortTimePattern;
case "F":
return a.FullDateTimePattern;
case "M":
case "m":
return a.MonthDayPattern;
case "s":
return a.SortableDateTimePattern;
case "Y":
case "y":
return a.YearMonthPattern;
default:
throw Error.format(Sys.Res.formatInvalidString)
} else if (c === 2 && b.charAt(0) === "%")b = b.charAt(1);
return b
};
Date._expandYear = function (c, a) {
var d = new Date, e = Date._getEra(d);
if (a < 100) {
var b = Date._getEraYear(d, c, e);
a += b - b % 100;
if (a > c.Calendar.TwoDigitYearMax)a -= 100
}
return a
};
Date._getEra = function (e, c) {
if (!c)return 0;
var b, d = e.getTime();
for (var a = 0, f = c.length; a < f; a += 4) {
b = c[a + 2];
if (b === null || d >= b)return a
}
return 0
};
Date._getEraYear = function (d, b, e, c) {
var a = d.getFullYear();
if (!c && b.eras)a -= b.eras[e + 3];
return a
};
Date._getParseRegExp = function (b, e) {
if (!b._parseRegExp)b._parseRegExp = {}; else if (b._parseRegExp[e])return b._parseRegExp[e];
var c = Date._expandFormat(b, e);
c = c.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g, "\\\\$1");
var a = new Sys.StringBuilder("^"), j = [], f = 0, i = 0, h = Date._getTokenRegExp(), d;
while ((d = h.exec(c)) !== null) {
var l = c.slice(f, d.index);
f = h.lastIndex;
i += Date._appendPreOrPostMatch(l, a);
if (i % 2 === 1) {
a.append(d[0]);
continue
}
switch (d[0]) {
case "dddd":
case "ddd":
case "MMMM":
case "MMM":
case "gg":
case "g":
a.append("(\\D+)");
break;
case "tt":
case "t":
a.append("(\\D*)");
break;
case "yyyy":
a.append("(\\d{4})");
break;
case "fff":
a.append("(\\d{3})");
break;
case "ff":
a.append("(\\d{2})");
break;
case "f":
a.append("(\\d)");
break;
case "dd":
case "d":
case "MM":
case "M":
case "yy":
case "y":
case "HH":
case "H":
case "hh":
case "h":
case "mm":
case "m":
case "ss":
case "s":
a.append("(\\d\\d?)");
break;
case "zzz":
a.append("([+-]?\\d\\d?:\\d{2})");
break;
case "zz":
case "z":
a.append("([+-]?\\d\\d?)");
break;
case "/":
a.append("(\\" + b.DateSeparator + ")")
}
Array.add(j, d[0])
}
Date._appendPreOrPostMatch(c.slice(f), a);
a.append("$");
var k = a.toString().replace(/\s+/g, "\\s+"), g = {"regExp": k, "groups": j};
b._parseRegExp[e] = g;
return g
};
Date._getTokenRegExp = function () {
return /\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g
};
Date.parseLocale = function (a) {
return Date._parse(a, Sys.CultureInfo.CurrentCulture, arguments)
};
Date.parseInvariant = function (a) {
return Date._parse(a, Sys.CultureInfo.InvariantCulture, arguments)
};
Date._parse = function (h, d, i) {
var a, c, b, f, e, g = false;
for (a = 1, c = i.length; a < c; a++) {
f = i[a];
if (f) {
g = true;
b = Date._parseExact(h, f, d);
if (b)return b
}
}
if (!g) {
e = d._getDateTimeFormats();
for (a = 0, c = e.length; a < c; a++) {
b = Date._parseExact(h, e[a], d);
if (b)return b
}
}
return null
};
Date._parseExact = function (w, D, k) {
w = w.trim();
var g = k.dateTimeFormat, A = Date._getParseRegExp(g, D), C = (new RegExp(A.regExp)).exec(w);
if (C === null)return null;
var B = A.groups, x = null, e = null, c = null, j = null, i = null, d = 0, h, p = 0, q = 0, f = 0, l = null, v = false;
for (var s = 0, E = B.length; s < E; s++) {
var a = C[s + 1];
if (a)switch (B[s]) {
case "dd":
case "d":
j = parseInt(a, 10);
if (j < 1 || j > 31)return null;
break;
case "MMMM":
c = k._getMonthIndex(a);
if (c < 0 || c > 11)return null;
break;
case "MMM":
c = k._getAbbrMonthIndex(a);
if (c < 0 || c > 11)return null;
break;
case "M":
case "MM":
c = parseInt(a, 10) - 1;
if (c < 0 || c > 11)return null;
break;
case "y":
case "yy":
e = Date._expandYear(g, parseInt(a, 10));
if (e < 0 || e > 9999)return null;
break;
case "yyyy":
e = parseInt(a, 10);
if (e < 0 || e > 9999)return null;
break;
case "h":
case "hh":
d = parseInt(a, 10);
if (d === 12)d = 0;
if (d < 0 || d > 11)return null;
break;
case "H":
case "HH":
d = parseInt(a, 10);
if (d < 0 || d > 23)return null;
break;
case "m":
case "mm":
p = parseInt(a, 10);
if (p < 0 || p > 59)return null;
break;
case "s":
case "ss":
q = parseInt(a, 10);
if (q < 0 || q > 59)return null;
break;
case "tt":
case "t":
var z = a.toUpperCase();
v = z === g.PMDesignator.toUpperCase();
if (!v && z !== g.AMDesignator.toUpperCase())return null;
break;
case "f":
f = parseInt(a, 10) * 100;
if (f < 0 || f > 999)return null;
break;
case "ff":
f = parseInt(a, 10) * 10;
if (f < 0 || f > 999)return null;
break;
case "fff":
f = parseInt(a, 10);
if (f < 0 || f > 999)return null;
break;
case "dddd":
i = k._getDayIndex(a);
if (i < 0 || i > 6)return null;
break;
case "ddd":
i = k._getAbbrDayIndex(a);
if (i < 0 || i > 6)return null;
break;
case "zzz":
var u = a.split(/:/);
if (u.length !== 2)return null;
h = parseInt(u[0], 10);
if (h < -12 || h > 13)return null;
var m = parseInt(u[1], 10);
if (m < 0 || m > 59)return null;
l = h * 60 + (a.startsWith("-") ? -m : m);
break;
case "z":
case "zz":
h = parseInt(a, 10);
if (h < -12 || h > 13)return null;
l = h * 60;
break;
case "g":
case "gg":
var o = a;
if (!o || !g.eras)return null;
o = o.toLowerCase().trim();
for (var r = 0, F = g.eras.length; r < F; r += 4)if (o === g.eras[r + 1].toLowerCase()) {
x = r;
break
}
if (x === null)return null
}
}
var b = new Date, t, n = g.Calendar.convert;
if (n)t = n.fromGregorian(b)[0]; else t = b.getFullYear();
if (e === null)e = t; else if (g.eras)e += g.eras[(x || 0) + 3];
if (c === null)c = 0;
if (j === null)j = 1;
if (n) {
b = n.toGregorian(e, c, j);
if (b === null)return null
} else {
b.setFullYear(e, c, j);
if (b.getDate() !== j)return null;
if (i !== null && b.getDay() !== i)return null
}
if (v && d < 12)d += 12;
b.setHours(d, p, q, f);
if (l !== null) {
var y = b.getMinutes() - (l + b.getTimezoneOffset());
b.setHours(b.getHours() + parseInt(y / 60, 10), y % 60)
}
return b
};
Date.prototype.format = function (a) {
return this._toFormattedString(a, Sys.CultureInfo.InvariantCulture)
};
Date.prototype.localeFormat = function (a) {
return this._toFormattedString(a, Sys.CultureInfo.CurrentCulture)
};
Date.prototype._toFormattedString = function (e, j) {
var b = j.dateTimeFormat, n = b.Calendar.convert;
if (!e || !e.length || e === "i")if (j && j.name.length)if (n)return this._toFormattedString(b.FullDateTimePattern, j); else {
var r = new Date(this.getTime()), x = Date._getEra(this, b.eras);
r.setFullYear(Date._getEraYear(this, b, x));
return r.toLocaleString()
} else return this.toString();
var l = b.eras, k = e === "s";
e = Date._expandFormat(b, e);
var a = new Sys.StringBuilder, c;
function d(a) {
if (a < 10)return "0" + a;
return a.toString()
}
function m(a) {
if (a < 10)return "00" + a;
if (a < 100)return "0" + a;
return a.toString()
}
function v(a) {
if (a < 10)return "000" + a; else if (a < 100)return "00" + a; else if (a < 1000)return "0" + a;
return a.toString()
}
var h, p, t = /([^d]|^)(d|dd)([^d]|$)/g;
function s() {
if (h || p)return h;
h = t.test(e);
p = true;
return h
}
var q = 0, o = Date._getTokenRegExp(), f;
if (!k && n)f = n.fromGregorian(this);
for (; true;) {
var w = o.lastIndex, i = o.exec(e), u = e.slice(w, i ? i.index : e.length);
q += Date._appendPreOrPostMatch(u, a);
if (!i)break;
if (q % 2 === 1) {
a.append(i[0]);
continue
}
function g(a, b) {
if (f)return f[b];
switch (b) {
case 0:
return a.getFullYear();
case 1:
return a.getMonth();
case 2:
return a.getDate()
}
}
switch (i[0]) {
case "dddd":
a.append(b.DayNames[this.getDay()]);
break;
case "ddd":
a.append(b.AbbreviatedDayNames[this.getDay()]);
break;
case "dd":
h = true;
a.append(d(g(this, 2)));
break;
case "d":
h = true;
a.append(g(this, 2));
break;
case "MMMM":
a.append(b.MonthGenitiveNames && s() ? b.MonthGenitiveNames[g(this, 1)] : b.MonthNames[g(this, 1)]);
break;
case "MMM":
a.append(b.AbbreviatedMonthGenitiveNames && s() ? b.AbbreviatedMonthGenitiveNames[g(this, 1)] : b.AbbreviatedMonthNames[g(this, 1)]);
break;
case "MM":
a.append(d(g(this, 1) + 1));
break;
case "M":
a.append(g(this, 1) + 1);
break;
case "yyyy":
a.append(v(f ? f[0] : Date._getEraYear(this, b, Date._getEra(this, l), k)));
break;
case "yy":
a.append(d((f ? f[0] : Date._getEraYear(this, b, Date._getEra(this, l), k)) % 100));
break;
case "y":
a.append((f ? f[0] : Date._getEraYear(this, b, Date._getEra(this, l), k)) % 100);
break;
case "hh":
c = this.getHours() % 12;
if (c === 0)c = 12;
a.append(d(c));
break;
case "h":
c = this.getHours() % 12;
if (c === 0)c = 12;
a.append(c);
break;
case "HH":
a.append(d(this.getHours()));
break;
case "H":
a.append(this.getHours());
break;
case "mm":
a.append(d(this.getMinutes()));
break;
case "m":
a.append(this.getMinutes());
break;
case "ss":
a.append(d(this.getSeconds()));
break;
case "s":
a.append(this.getSeconds());
break;
case "tt":
a.append(this.getHours() < 12 ? b.AMDesignator : b.PMDesignator);
break;
case "t":
a.append((this.getHours() < 12 ? b.AMDesignator : b.PMDesignator).charAt(0));
break;
case "f":
a.append(m(this.getMilliseconds()).charAt(0));
break;
case "ff":
a.append(m(this.getMilliseconds()).substr(0, 2));
break;
case "fff":
a.append(m(this.getMilliseconds()));
break;
case "z":
c = this.getTimezoneOffset() / 60;
a.append((c <= 0 ? "+" : "-") + Math.floor(Math.abs(c)));
break;
case "zz":
c = this.getTimezoneOffset() / 60;
a.append((c <= 0 ? "+" : "-") + d(Math.floor(Math.abs(c))));
break;
case "zzz":
c = this.getTimezoneOffset() / 60;
a.append((c <= 0 ? "+" : "-") + d(Math.floor(Math.abs(c))) + ":" + d(Math.abs(this.getTimezoneOffset() % 60)));
break;
case "g":
case "gg":
if (b.eras)a.append(b.eras[Date._getEra(this, l) + 1]);
break;
case "/":
a.append(b.DateSeparator)
}
}
return a.toString()
};
String.localeFormat = function () {
return String._toFormattedString(true, arguments)
};
Number.parseLocale = function (a) {
return Number._parse(a, Sys.CultureInfo.CurrentCulture)
};
Number.parseInvariant = function (a) {
return Number._parse(a, Sys.CultureInfo.InvariantCulture)
};
Number._parse = function (b, o) {
b = b.trim();
if (b.match(/^[+-]?infinity$/i))return parseFloat(b);
if (b.match(/^0x[a-f0-9]+$/i))return parseInt(b);
var a = o.numberFormat, g = Number._parseNumberNegativePattern(b, a, a.NumberNegativePattern), h = g[0], e = g[1];
if (h === "" && a.NumberNegativePattern !== 1) {
g = Number._parseNumberNegativePattern(b, a, 1);
h = g[0];
e = g[1]
}
if (h === "")h = "+";
var j, d, f = e.indexOf("e");
if (f < 0)f = e.indexOf("E");
if (f < 0) {
d = e;
j = null
} else {
d = e.substr(0, f);
j = e.substr(f + 1)
}
var c, k, m = d.indexOf(a.NumberDecimalSeparator);
if (m < 0) {
c = d;
k = null
} else {
c = d.substr(0, m);
k = d.substr(m + a.NumberDecimalSeparator.length)
}
c = c.split(a.NumberGroupSeparator).join("");
var n = a.NumberGroupSeparator.replace(/\u00A0/g, " ");
if (a.NumberGroupSeparator !== n)c = c.split(n).join("");
var l = h + c;
if (k !== null)l += "." + k;
if (j !== null) {
var i = Number._parseNumberNegativePattern(j, a, 1);
if (i[0] === "")i[0] = "+";
l += "e" + i[0] + i[1]
}
if (l.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/))return parseFloat(l);
return Number.NaN
};
Number._parseNumberNegativePattern = function (a, d, e) {
var b = d.NegativeSign, c = d.PositiveSign;
switch (e) {
case 4:
b = " " + b;
c = " " + c;
case 3:
if (a.endsWith(b))return ["-", a.substr(0, a.length - b.length)]; else if (a.endsWith(c))return ["+", a.substr(0, a.length - c.length)];
break;
case 2:
b += " ";
c += " ";
case 1:
if (a.startsWith(b))return ["-", a.substr(b.length)]; else if (a.startsWith(c))return ["+", a.substr(c.length)];
break;
case 0:
if (a.startsWith("(") && a.endsWith(")"))return ["-", a.substr(1, a.length - 2)]
}
return ["", a]
};
Number.prototype.format = function (a) {
return this._toFormattedString(a, Sys.CultureInfo.InvariantCulture)
};
Number.prototype.localeFormat = function (a) {
return this._toFormattedString(a, Sys.CultureInfo.CurrentCulture)
};
Number.prototype._toFormattedString = function (e, j) {
if (!e || e.length === 0 || e === "i")if (j && j.name.length > 0)return this.toLocaleString(); else return this.toString();
var o = ["n %", "n%", "%n"], n = ["-n %", "-n%", "-%n"], p = ["(n)", "-n", "- n", "n-", "n -"], m = ["$n", "n$", "$ n", "n $"], l = ["($n)", "-$n", "$-n", "$n-", "(n$)", "-n$", "n-$", "n$-", "-n $", "-$ n", "n $-", "$ n-", "$ -n", "n- $", "($ n)", "(n $)"];
function g(a, c, d) {
for (var b = a.length; b < c; b++)a = d ? "0" + a : a + "0";
return a
}
function i(j, i, l, n, p) {
var h = l[0], k = 1, o = Math.pow(10, i), m = Math.round(j * o) / o;
if (!isFinite(m))m = j;
j = m;
var b = j.toString(), a = "", c, e = b.split(/e/i);
b = e[0];
c = e.length > 1 ? parseInt(e[1]) : 0;
e = b.split(".");
b = e[0];
a = e.length > 1 ? e[1] : "";
var q;
if (c > 0) {
a = g(a, c, false);
b += a.slice(0, c);
a = a.substr(c)
} else if (c < 0) {
c = -c;
b = g(b, c + 1, true);
a = b.slice(-c, b.length) + a;
b = b.slice(0, -c)
}
if (i > 0) {
if (a.length > i)a = a.slice(0, i); else a = g(a, i, false);
a = p + a
} else a = "";
var d = b.length - 1, f = "";
while (d >= 0) {
if (h === 0 || h > d)if (f.length > 0)return b.slice(0, d + 1) + n + f + a; else return b.slice(0, d + 1) + a;
if (f.length > 0)f = b.slice(d - h + 1, d + 1) + n + f; else f = b.slice(d - h + 1, d + 1);
d -= h;
if (k < l.length) {
h = l[k];
k++
}
}
return b.slice(0, d + 1) + n + f + a
}
var a = j.numberFormat, d = Math.abs(this);
if (!e)e = "D";
var b = -1;
if (e.length > 1)b = parseInt(e.slice(1), 10);
var c;
switch (e.charAt(0)) {
case "d":
case "D":
c = "n";
if (b !== -1)d = g("" + d, b, true);
if (this < 0)d = -d;
break;
case "c":
case "C":
if (this < 0)c = l[a.CurrencyNegativePattern]; else c = m[a.CurrencyPositivePattern];
if (b === -1)b = a.CurrencyDecimalDigits;
d = i(Math.abs(this), b, a.CurrencyGroupSizes, a.CurrencyGroupSeparator, a.CurrencyDecimalSeparator);
break;
case "n":
case "N":
if (this < 0)c = p[a.NumberNegativePattern]; else c = "n";
if (b === -1)b = a.NumberDecimalDigits;
d = i(Math.abs(this), b, a.NumberGroupSizes, a.NumberGroupSeparator, a.NumberDecimalSeparator);
break;
case "p":
case "P":
if (this < 0)c = n[a.PercentNegativePattern]; else c = o[a.PercentPositivePattern];
if (b === -1)b = a.PercentDecimalDigits;
d = i(Math.abs(this) * 100, b, a.PercentGroupSizes, a.PercentGroupSeparator, a.PercentDecimalSeparator);
break;
default:
throw Error.format(Sys.Res.formatBadFormatSpecifier)
}
var k = /n|\$|-|%/g, f = "";
for (; true;) {
var q = k.lastIndex, h = k.exec(c);
f += c.slice(q, h ? h.index : c.length);
if (!h)break;
switch (h[0]) {
case "n":
f += d;
break;
case "$":
f += a.CurrencySymbol;
break;
case "-":
if (/[1-9]/.test(d))f += a.NegativeSign;
break;
case "%":
f += a.PercentSymbol
}
}
return f
};
Sys.CultureInfo = function (c, b, a) {
this.name = c;
this.numberFormat = b;
this.dateTimeFormat = a
};
Sys.CultureInfo.prototype = {
_getDateTimeFormats: function () {
if (!this._dateTimeFormats) {
var a = this.dateTimeFormat;
this._dateTimeFormats = [a.MonthDayPattern, a.YearMonthPattern, a.ShortDatePattern, a.ShortTimePattern, a.LongDatePattern, a.LongTimePattern, a.FullDateTimePattern, a.RFC1123Pattern, a.SortableDateTimePattern, a.UniversalSortableDateTimePattern]
}
return this._dateTimeFormats
}, _getIndex: function (c, d, e) {
var b = this._toUpper(c), a = Array.indexOf(d, b);
if (a === -1)a = Array.indexOf(e, b);
return a
}, _getMonthIndex: function (a) {
if (!this._upperMonths) {
this._upperMonths = this._toUpperArray(this.dateTimeFormat.MonthNames);
this._upperMonthsGenitive = this._toUpperArray(this.dateTimeFormat.MonthGenitiveNames)
}
return this._getIndex(a, this._upperMonths, this._upperMonthsGenitive)
}, _getAbbrMonthIndex: function (a) {
if (!this._upperAbbrMonths) {
this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);
this._upperAbbrMonthsGenitive = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthGenitiveNames)
}
return this._getIndex(a, this._upperAbbrMonths, this._upperAbbrMonthsGenitive)
}, _getDayIndex: function (a) {
if (!this._upperDays)this._upperDays = this._toUpperArray(this.dateTimeFormat.DayNames);
return Array.indexOf(this._upperDays, this._toUpper(a))
}, _getAbbrDayIndex: function (a) {
if (!this._upperAbbrDays)this._upperAbbrDays = this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames);
return Array.indexOf(this._upperAbbrDays, this._toUpper(a))
}, _toUpperArray: function (c) {
var b = [];
for (var a = 0, d = c.length; a < d; a++)b[a] = this._toUpper(c[a]);
return b
}, _toUpper: function (a) {
return a.split("\u00a0").join(" ").toUpperCase()
}
};
Sys.CultureInfo.registerClass("Sys.CultureInfo");
Sys.CultureInfo._parse = function (a) {
var b = a.dateTimeFormat;
if (b && !b.eras)b.eras = a.eras;
return new Sys.CultureInfo(a.name, a.numberFormat, b)
};
Sys.CultureInfo.InvariantCulture = Sys.CultureInfo._parse({
"name": "",
"numberFormat": {
"CurrencyDecimalDigits": 2,
"CurrencyDecimalSeparator": ".",
"IsReadOnly": true,
"CurrencyGroupSizes": [3],
"NumberGroupSizes": [3],
"PercentGroupSizes": [3],
"CurrencyGroupSeparator": ",",
"CurrencySymbol": "\u00a4",
"NaNSymbol": "NaN",
"CurrencyNegativePattern": 0,
"NumberNegativePattern": 1,
"PercentPositivePattern": 0,
"PercentNegativePattern": 0,
"NegativeInfinitySymbol": "-Infinity",
"NegativeSign": "-",
"NumberDecimalDigits": 2,
"NumberDecimalSeparator": ".",
"NumberGroupSeparator": ",",
"CurrencyPositivePattern": 0,
"PositiveInfinitySymbol": "Infinity",
"PositiveSign": "+",
"PercentDecimalDigits": 2,
"PercentDecimalSeparator": ".",
"PercentGroupSeparator": ",",
"PercentSymbol": "%",
"PerMilleSymbol": "\u2030",
"NativeDigits": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
"DigitSubstitution": 1
},
"dateTimeFormat": {
"AMDesignator": "AM",
"Calendar": {
"MinSupportedDateTime": "@-62135568000000@",
"MaxSupportedDateTime": "@253402300799999@",
"AlgorithmType": 1,
"CalendarType": 1,
"Eras": [1],
"TwoDigitYearMax": 2029,
"IsReadOnly": true
},
"DateSeparator": "/",
"FirstDayOfWeek": 0,
"CalendarWeekRule": 0,
"FullDateTimePattern": "dddd, dd MMMM yyyy HH:mm:ss",
"LongDatePattern": "dddd, dd MMMM yyyy",
"LongTimePattern": "HH:mm:ss",
"MonthDayPattern": "MMMM dd",
"PMDesignator": "PM",
"RFC1123Pattern": "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",
"ShortDatePattern": "MM/dd/yyyy",
"ShortTimePattern": "HH:mm",
"SortableDateTimePattern": "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
"TimeSeparator": ":",
"UniversalSortableDateTimePattern": "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
"YearMonthPattern": "yyyy MMMM",
"AbbreviatedDayNames": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
"ShortestDayNames": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
"DayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
"AbbreviatedMonthNames": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""],
"MonthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""],
"IsReadOnly": true,
"NativeCalendarName": "Gregorian Calendar",
"AbbreviatedMonthGenitiveNames": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""],
"MonthGenitiveNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""]
},
"eras": [1, "A.D.", null, 0]
});
if (typeof __cultureInfo === "object") {
Sys.CultureInfo.CurrentCulture = Sys.CultureInfo._parse(__cultureInfo);
delete __cultureInfo
} else Sys.CultureInfo.CurrentCulture = Sys.CultureInfo._parse({
"name": "en-US",
"numberFormat": {
"CurrencyDecimalDigits": 2,
"CurrencyDecimalSeparator": ".",
"IsReadOnly": false,
"CurrencyGroupSizes": [3],
"NumberGroupSizes": [3],
"PercentGroupSizes": [3],
"CurrencyGroupSeparator": ",",
"CurrencySymbol": "$",
"NaNSymbol": "NaN",
"CurrencyNegativePattern": 0,
"NumberNegativePattern": 1,
"PercentPositivePattern": 0,
"PercentNegativePattern": 0,
"NegativeInfinitySymbol": "-Infinity",
"NegativeSign": "-",
"NumberDecimalDigits": 2,
"NumberDecimalSeparator": ".",
"NumberGroupSeparator": ",",
"CurrencyPositivePattern": 0,
"PositiveInfinitySymbol": "Infinity",
"PositiveSign": "+",
"PercentDecimalDigits": 2,
"PercentDecimalSeparator": ".",
"PercentGroupSeparator": ",",
"PercentSymbol": "%",
"PerMilleSymbol": "\u2030",
"NativeDigits": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
"DigitSubstitution": 1
},
"dateTimeFormat": {
"AMDesignator": "AM",
"Calendar": {
"MinSupportedDateTime": "@-62135568000000@",
"MaxSupportedDateTime": "@253402300799999@",
"AlgorithmType": 1,
"CalendarType": 1,
"Eras": [1],
"TwoDigitYearMax": 2029,
"IsReadOnly": false
},
"DateSeparator": "/",
"FirstDayOfWeek": 0,
"CalendarWeekRule": 0,
"FullDateTimePattern": "dddd, MMMM dd, yyyy h:mm:ss tt",
"LongDatePattern": "dddd, MMMM dd, yyyy",
"LongTimePattern": "h:mm:ss tt",
"MonthDayPattern": "MMMM dd",
"PMDesignator": "PM",
"RFC1123Pattern": "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",
"ShortDatePattern": "M/d/yyyy",
"ShortTimePattern": "h:mm tt",
"SortableDateTimePattern": "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
"TimeSeparator": ":",
"UniversalSortableDateTimePattern": "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
"YearMonthPattern": "MMMM, yyyy",
"AbbreviatedDayNames": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
"ShortestDayNames": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
"DayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
"AbbreviatedMonthNames": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""],
"MonthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""],
"IsReadOnly": false,
"NativeCalendarName": "Gregorian Calendar",
"AbbreviatedMonthGenitiveNames": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""],
"MonthGenitiveNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""]
},
"eras": [1, "A.D.", null, 0]
});
Type.registerNamespace("Sys.Serialization");
Sys.Serialization.JavaScriptSerializer = function () {
};
Sys.Serialization.JavaScriptSerializer.registerClass("Sys.Serialization.JavaScriptSerializer");
Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs = [];
Sys.Serialization.JavaScriptSerializer._charsToEscape = [];
Sys.Serialization.JavaScriptSerializer._dateRegEx = new RegExp('(^|[^\\\\])\\"\\\\/Date\\((-?[0-9]+)(?:[a-zA-Z]|(?:\\+|-)[0-9]{4})?\\)\\\\/\\"', "g");
Sys.Serialization.JavaScriptSerializer._escapeChars = {};
Sys.Serialization.JavaScriptSerializer._escapeRegEx = new RegExp('["\\\\\\x00-\\x1F]', "i");
Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal = new RegExp('["\\\\\\x00-\\x1F]', "g");
Sys.Serialization.JavaScriptSerializer._jsonRegEx = new RegExp("[^,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]", "g");
Sys.Serialization.JavaScriptSerializer._jsonStringRegEx = new RegExp('"(\\\\.|[^"\\\\])*"', "g");
Sys.Serialization.JavaScriptSerializer._serverTypeFieldName = "__type";
Sys.Serialization.JavaScriptSerializer._init = function () {
var c = ["\\u0000", "\\u0001", "\\u0002", "\\u0003", "\\u0004", "\\u0005", "\\u0006", "\\u0007", "\\b", "\\t", "\\n", "\\u000b", "\\f", "\\r", "\\u000e", "\\u000f", "\\u0010", "\\u0011", "\\u0012", "\\u0013", "\\u0014", "\\u0015", "\\u0016", "\\u0017", "\\u0018", "\\u0019", "\\u001a", "\\u001b", "\\u001c", "\\u001d", "\\u001e", "\\u001f"];
Sys.Serialization.JavaScriptSerializer._charsToEscape[0] = "\\";
Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs["\\"] = new RegExp("\\\\", "g");
Sys.Serialization.JavaScriptSerializer._escapeChars["\\"] = "\\\\";
Sys.Serialization.JavaScriptSerializer._charsToEscape[1] = '"';
Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs['"'] = new RegExp('"', "g");
Sys.Serialization.JavaScriptSerializer._escapeChars['"'] = '\\"';
for (var a = 0; a < 32; a++) {
var b = String.fromCharCode(a);
Sys.Serialization.JavaScriptSerializer._charsToEscape[a + 2] = b;
Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[b] = new RegExp(b, "g");
Sys.Serialization.JavaScriptSerializer._escapeChars[b] = c[a]
}
};
Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder = function (b, a) {
a.append(b.toString())
};
Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder = function (a, b) {
if (isFinite(a))b.append(String(a)); else throw Error.invalidOperation(Sys.Res.cannotSerializeNonFiniteNumbers)
};
Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder = function (a, c) {
c.append('"');
if (Sys.Serialization.JavaScriptSerializer._escapeRegEx.test(a)) {
if (Sys.Serialization.JavaScriptSerializer._charsToEscape.length === 0)Sys.Serialization.JavaScriptSerializer._init();
if (a.length < 128)a = a.replace(Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal, function (a) {
return Sys.Serialization.JavaScriptSerializer._escapeChars[a]
}); else for (var d = 0; d < 34; d++) {
var b = Sys.Serialization.JavaScriptSerializer._charsToEscape[d];
if (a.indexOf(b) !== -1)if (Sys.Browser.agent === Sys.Browser.Opera || Sys.Browser.agent === Sys.Browser.FireFox)a = a.split(b).join(Sys.Serialization.JavaScriptSerializer._escapeChars[b]); else a = a.replace(Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[b], Sys.Serialization.JavaScriptSerializer._escapeChars[b])
}
}
c.append(a);
c.append('"')
};
Sys.Serialization.JavaScriptSerializer._serializeWithBuilder = function (b, a, i, g) {
var c;
switch (typeof b) {
case "object":
if (b)if (Number.isInstanceOfType(b))Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(b, a); else if (Boolean.isInstanceOfType(b))Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(b, a); else if (String.isInstanceOfType(b))Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(b, a); else if (Array.isInstanceOfType(b)) {
a.append("[");
for (c = 0; c < b.length; ++c) {
if (c > 0)a.append(",");
Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b[c], a, false, g)
}
a.append("]")
} else {
if (Date.isInstanceOfType(b)) {
a.append('"\\/Date(');
a.append(b.getTime());
a.append(')\\/"');
break
}
var d = [], f = 0;
for (var e in b) {
if (e.startsWith("$"))continue;
if (e === Sys.Serialization.JavaScriptSerializer._serverTypeFieldName && f !== 0) {
d[f++] = d[0];
d[0] = e
} else d[f++] = e
}
if (i)d.sort();
a.append("{");
var j = false;
for (c = 0; c < f; c++) {
var h = b[d[c]];
if (typeof h !== "undefined" && typeof h !== "function") {
if (j)a.append(","); else j = true;
Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(d[c], a, i, g);
a.append(":");
Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(h, a, i, g)
}
}
a.append("}")
} else a.append("null");
break;
case "number":
Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(b, a);
break;
case "string":
Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(b, a);
break;
case "boolean":
Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(b, a);
break;
default:
a.append("null")
}
};
Sys.Serialization.JavaScriptSerializer.serialize = function (b) {
var a = new Sys.StringBuilder;
Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b, a, false);
return a.toString()
};
Sys.Serialization.JavaScriptSerializer.deserialize = function (data, secure) {
if (data.length === 0)throw Error.argument("data", Sys.Res.cannotDeserializeEmptyString);
try {
var exp = data.replace(Sys.Serialization.JavaScriptSerializer._dateRegEx, "$1new Date($2)");
if (secure && Sys.Serialization.JavaScriptSerializer._jsonRegEx.test(exp.replace(Sys.Serialization.JavaScriptSerializer._jsonStringRegEx, "")))throw null;
return eval("(" + exp + ")")
} catch (a) {
throw Error.argument("data", Sys.Res.cannotDeserializeInvalidJson)
}
};
Type.registerNamespace("Sys.UI");
Sys.EventHandlerList = function () {
this._list = {}
};
Sys.EventHandlerList.prototype = {
_addHandler: function (b, a) {
Array.add(this._getEvent(b, true), a)
}, addHandler: function (b, a) {
this._addHandler(b, a)
}, _removeHandler: function (c, b) {
var a = this._getEvent(c);
if (!a)return;
Array.remove(a, b)
}, removeHandler: function (b, a) {
this._removeHandler(b, a)
}, getHandler: function (b) {
var a = this._getEvent(b);
if (!a || a.length === 0)return null;
a = Array.clone(a);
return function (c, d) {
for (var b = 0, e = a.length; b < e; b++)a[b](c, d)
}
}, _getEvent: function (a, b) {
if (!this._list[a]) {
if (!b)return null;
this._list[a] = []
}
return this._list[a]
}
};
Sys.EventHandlerList.registerClass("Sys.EventHandlerList");
Sys.CommandEventArgs = function (c, a, b) {
Sys.CommandEventArgs.initializeBase(this);
this._commandName = c;
this._commandArgument = a;
this._commandSource = b
};
Sys.CommandEventArgs.prototype = {
_commandName: null,
_commandArgument: null,
_commandSource: null,
get_commandName: function () {
return this._commandName
},
get_commandArgument: function () {
return this._commandArgument
},
get_commandSource: function () {
return this._commandSource
}
};
Sys.CommandEventArgs.registerClass("Sys.CommandEventArgs", Sys.CancelEventArgs);
Sys.INotifyPropertyChange = function () {
};
Sys.INotifyPropertyChange.prototype = {};
Sys.INotifyPropertyChange.registerInterface("Sys.INotifyPropertyChange");
Sys.PropertyChangedEventArgs = function (a) {
Sys.PropertyChangedEventArgs.initializeBase(this);
this._propertyName = a
};
Sys.PropertyChangedEventArgs.prototype = {
get_propertyName: function () {
return this._propertyName
}
};
Sys.PropertyChangedEventArgs.registerClass("Sys.PropertyChangedEventArgs", Sys.EventArgs);
Sys.INotifyDisposing = function () {
};
Sys.INotifyDisposing.prototype = {};
Sys.INotifyDisposing.registerInterface("Sys.INotifyDisposing");
Sys.Component = function () {
if (Sys.Application)Sys.Application.registerDisposableObject(this)
};
Sys.Component.prototype = {
_id: null, _initialized: false, _updating: false, get_events: function () {
if (!this._events)this._events = new Sys.EventHandlerList;
return this._events
}, get_id: function () {
return this._id
}, set_id: function (a) {
this._id = a
}, get_isInitialized: function () {
return this._initialized
}, get_isUpdating: function () {
return this._updating
}, add_disposing: function (a) {
this.get_events().addHandler("disposing", a)
}, remove_disposing: function (a) {
this.get_events().removeHandler("disposing", a)
}, add_propertyChanged: function (a) {
this.get_events().addHandler("propertyChanged", a)
}, remove_propertyChanged: function (a) {
this.get_events().removeHandler("propertyChanged", a)
}, beginUpdate: function () {
this._updating = true
}, dispose: function () {
if (this._events) {
var a = this._events.getHandler("disposing");
if (a)a(this, Sys.EventArgs.Empty)
}
delete this._events;
Sys.Application.unregisterDisposableObject(this);
Sys.Application.removeComponent(this)
}, endUpdate: function () {
this._updating = false;
if (!this._initialized)this.initialize();
this.updated()
}, initialize: function () {
this._initialized = true
}, raisePropertyChanged: function (b) {
if (!this._events)return;
var a = this._events.getHandler("propertyChanged");
if (a)a(this, new Sys.PropertyChangedEventArgs(b))
}, updated: function () {
}
};
Sys.Component.registerClass("Sys.Component", null, Sys.IDisposable, Sys.INotifyPropertyChange, Sys.INotifyDisposing);
function Sys$Component$_setProperties(a, i) {
var d, j = Object.getType(a), e = j === Object || j === Sys.UI.DomElement, h = Sys.Component.isInstanceOfType(a) && !a.get_isUpdating();
if (h)a.beginUpdate();
for (var c in i) {
var b = i[c], f = e ? null : a["get_" + c];
if (e || typeof f !== "function") {
var k = a[c];
if (!b || typeof b !== "object" || e && !k)a[c] = b; else Sys$Component$_setProperties(k, b)
} else {
var l = a["set_" + c];
if (typeof l === "function")l.apply(a, [b]); else if (b instanceof Array) {
d = f.apply(a);
for (var g = 0, m = d.length, n = b.length; g < n; g++, m++)d[m] = b[g]
} else if (typeof b === "object" && Object.getType(b) === Object) {
d = f.apply(a);
Sys$Component$_setProperties(d, b)
}
}
}
if (h)a.endUpdate()
}
function Sys$Component$_setReferences(c, b) {
for (var a in b) {
var e = c["set_" + a], d = $find(b[a]);
e.apply(c, [d])
}
}
var $create = Sys.Component.create = function (h, f, d, c, g) {
var a = g ? new h(g) : new h, b = Sys.Application, i = b.get_isCreatingComponents();
a.beginUpdate();
if (f)Sys$Component$_setProperties(a, f);
if (d)for (var e in d)a["add_" + e](d[e]);
if (a.get_id())b.addComponent(a);
if (i) {
b._createdComponents[b._createdComponents.length] = a;
if (c)b._addComponentToSecondPass(a, c); else a.endUpdate()
} else {
if (c)Sys$Component$_setReferences(a, c);
a.endUpdate()
}
return a
};
Sys.UI.MouseButton = function () {
throw Error.notImplemented()
};
Sys.UI.MouseButton.prototype = {leftButton: 0, middleButton: 1, rightButton: 2};
Sys.UI.MouseButton.registerEnum("Sys.UI.MouseButton");
Sys.UI.Key = function () {
throw Error.notImplemented()
};
Sys.UI.Key.prototype = {
backspace: 8,
tab: 9,
enter: 13,
esc: 27,
space: 32,
pageUp: 33,
pageDown: 34,
end: 35,
home: 36,
left: 37,
up: 38,
right: 39,
down: 40,
del: 127
};
Sys.UI.Key.registerEnum("Sys.UI.Key");
Sys.UI.Point = function (a, b) {
this.rawX = a;
this.rawY = b;
this.x = Math.round(a);
this.y = Math.round(b)
};
Sys.UI.Point.registerClass("Sys.UI.Point");
Sys.UI.Bounds = function (c, d, b, a) {
this.x = c;
this.y = d;
this.height = a;
this.width = b
};
Sys.UI.Bounds.registerClass("Sys.UI.Bounds");
Sys.UI.DomEvent = function (e) {
var a = e, b = this.type = a.type.toLowerCase();
this.rawEvent = a;
this.altKey = a.altKey;
if (typeof a.button !== "undefined")this.button = typeof a.which !== "undefined" ? a.button : a.button === 4 ? Sys.UI.MouseButton.middleButton : a.button === 2 ? Sys.UI.MouseButton.rightButton : Sys.UI.MouseButton.leftButton;
if (b === "keypress")this.charCode = a.charCode || a.keyCode; else if (a.keyCode && a.keyCode === 46)this.keyCode = 127; else this.keyCode = a.keyCode;
this.clientX = a.clientX;
this.clientY = a.clientY;
this.ctrlKey = a.ctrlKey;
this.target = a.target ? a.target : a.srcElement;
if (!b.startsWith("key"))if (typeof a.offsetX !== "undefined" && typeof a.offsetY !== "undefined") {
this.offsetX = a.offsetX;
this.offsetY = a.offsetY
} else if (this.target && this.target.nodeType !== 3 && typeof a.clientX === "number") {
var c = Sys.UI.DomElement.getLocation(this.target), d = Sys.UI.DomElement._getWindow(this.target);
this.offsetX = (d.pageXOffset || 0) + a.clientX - c.x;
this.offsetY = (d.pageYOffset || 0) + a.clientY - c.y
}
this.screenX = a.screenX;
this.screenY = a.screenY;
this.shiftKey = a.shiftKey
};
Sys.UI.DomEvent.prototype = {
preventDefault: function () {
if (this.rawEvent.preventDefault)this.rawEvent.preventDefault(); else if (window.event)this.rawEvent.returnValue = false
}, stopPropagation: function () {
if (this.rawEvent.stopPropagation)this.rawEvent.stopPropagation(); else if (window.event)this.rawEvent.cancelBubble = true
}
};
Sys.UI.DomEvent.registerClass("Sys.UI.DomEvent");
var $addHandler = Sys.UI.DomEvent.addHandler = function (a, d, e, g) {
if (!a._events)a._events = {};
var c = a._events[d];
if (!c)a._events[d] = c = [];
var b;
if (a.addEventListener) {
b = function (b) {
return e.call(a, new Sys.UI.DomEvent(b))
};
a.addEventListener(d, b, false)
} else if (a.attachEvent) {
b = function () {
var b = {};
try {
b = Sys.UI.DomElement._getWindow(a).event
} catch (c) {
}
return e.call(a, new Sys.UI.DomEvent(b))
};
a.attachEvent("on" + d, b)
}
c[c.length] = {handler: e, browserHandler: b, autoRemove: g};
if (g) {
var f = a.dispose;
if (f !== Sys.UI.DomEvent._disposeHandlers) {
a.dispose = Sys.UI.DomEvent._disposeHandlers;
if (typeof f !== "undefined")a._chainDispose = f
}
}
}, $addHandlers = Sys.UI.DomEvent.addHandlers = function (f, d, c, e) {
for (var b in d) {
var a = d[b];
if (c)a = Function.createDelegate(c, a);
$addHandler(f, b, a, e || false)
}
}, $clearHandlers = Sys.UI.DomEvent.clearHandlers = function (a) {
Sys.UI.DomEvent._clearHandlers(a, false)
};
Sys.UI.DomEvent._clearHandlers = function (a, g) {
if (a._events) {
var e = a._events;
for (var b in e) {
var d = e[b];
for (var c = d.length - 1; c >= 0; c--) {
var f = d[c];
if (!g || f.autoRemove)$removeHandler(a, b, f.handler)
}
}
a._events = null
}
};
Sys.UI.DomEvent._disposeHandlers = function () {
Sys.UI.DomEvent._clearHandlers(this, true);
var b = this._chainDispose, a = typeof b;
if (a !== "undefined") {
this.dispose = b;
this._chainDispose = null;
if (a === "function")this.dispose()
}
};
var $removeHandler = Sys.UI.DomEvent.removeHandler = function (b, a, c) {
Sys.UI.DomEvent._removeHandler(b, a, c)
};
Sys.UI.DomEvent._removeHandler = function (a, e, f) {
var d = null, c = a._events[e];
for (var b = 0, g = c.length; b < g; b++)if (c[b].handler === f) {
d = c[b].browserHandler;
break
}
if (a.removeEventListener)a.removeEventListener(e, d, false); else if (a.detachEvent)a.detachEvent("on" + e, d);
c.splice(b, 1)
};
Sys.UI.DomElement = function () {
};
Sys.UI.DomElement.registerClass("Sys.UI.DomElement");
Sys.UI.DomElement.addCssClass = function (a, b) {
if (!Sys.UI.DomElement.containsCssClass(a, b))if (a.className === "")a.className = b; else a.className += " " + b
};
Sys.UI.DomElement.containsCssClass = function (b, a) {
return Array.contains(b.className.split(" "), a)
};
Sys.UI.DomElement.getBounds = function (a) {
var b = Sys.UI.DomElement.getLocation(a);
return new Sys.UI.Bounds(b.x, b.y, a.offsetWidth || 0, a.offsetHeight || 0)
};
var $get = Sys.UI.DomElement.getElementById = function (f, e) {
if (!e)return document.getElementById(f);
if (e.getElementById)return e.getElementById(f);
var c = [], d = e.childNodes;
for (var b = 0; b < d.length; b++) {
var a = d[b];
if (a.nodeType == 1)c[c.length] = a
}
while (c.length) {
a = c.shift();
if (a.id == f)return a;
d = a.childNodes;
for (b = 0; b < d.length; b++) {
a = d[b];
if (a.nodeType == 1)c[c.length] = a
}
}
return null
};
if (document.documentElement.getBoundingClientRect)Sys.UI.DomElement.getLocation = function (a) {
if (a.self || a.nodeType === 9 || a === document.documentElement || a.parentNode === a.ownerDocument.documentElement)return new Sys.UI.Point(0, 0);
var f = a.getBoundingClientRect();
if (!f)return new Sys.UI.Point(0, 0);
var e = a.ownerDocument.documentElement, h = a.ownerDocument.body, l, c = Math.round(f.left) + (e.scrollLeft || h.scrollLeft), d = Math.round(f.top) + (e.scrollTop || h.scrollTop);
if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
try {
var g = a.ownerDocument.parentWindow.frameElement || null;
if (g) {
var i = g.frameBorder === "0" || g.frameBorder === "no" ? 2 : 0;
c += i;
d += i
}
} catch (m) {
}
if (Sys.Browser.version === 7 && !document.documentMode) {
var j = document.body, k = j.getBoundingClientRect(), b = (k.right - k.left) / j.clientWidth;
b = Math.round(b * 100);
b = (b - b % 5) / 100;
if (!isNaN(b) && b !== 1) {
c = Math.round(c / b);
d = Math.round(d / b)
}
}
if ((document.documentMode || 0) < 8) {
c -= e.clientLeft;
d -= e.clientTop
}
}
return new Sys.UI.Point(c, d)
}; else if (Sys.Browser.agent === Sys.Browser.Safari)Sys.UI.DomElement.getLocation = function (c) {
if (c.window && c.window === c || c.nodeType === 9)return new Sys.UI.Point(0, 0);
var d = 0, e = 0, a, j = null, g = null, b;
for (a = c; a; j = a, (g = b, a = a.offsetParent)) {
b = Sys.UI.DomElement._getCurrentStyle(a);
var f = a.tagName ? a.tagName.toUpperCase() : null;
if ((a.offsetLeft || a.offsetTop) && (f !== "BODY" || (!g || g.position !== "absolute"))) {
d += a.offsetLeft;
e += a.offsetTop
}
if (j && Sys.Browser.version >= 3) {
d += parseInt(b.borderLeftWidth);
e += parseInt(b.borderTopWidth)
}
}
b = Sys.UI.DomElement._getCurrentStyle(c);
var h = b ? b.position : null;
if (!h || h !== "absolute")for (a = c.parentNode; a; a = a.parentNode) {
f = a.tagName ? a.tagName.toUpperCase() : null;
if (f !== "BODY" && f !== "HTML" && (a.scrollLeft || a.scrollTop)) {
d -= a.scrollLeft || 0;
e -= a.scrollTop || 0
}
b = Sys.UI.DomElement._getCurrentStyle(a);
var i = b ? b.position : null;
if (i && i === "absolute")break
}
return new Sys.UI.Point(d, e)
}; else Sys.UI.DomElement.getLocation = function (d) {
if (d.window && d.window === d || d.nodeType === 9)return new Sys.UI.Point(0, 0);
var e = 0, f = 0, a, i = null, g = null, b = null;
for (a = d; a; i = a, (g = b, a = a.offsetParent)) {
var c = a.tagName ? a.tagName.toUpperCase() : null;
b = Sys.UI.DomElement._getCurrentStyle(a);
if ((a.offsetLeft || a.offsetTop) && !(c === "BODY" && (!g || g.position !== "absolute"))) {
e += a.offsetLeft;
f += a.offsetTop
}
if (i !== null && b) {
if (c !== "TABLE" && c !== "TD" && c !== "HTML") {
e += parseInt(b.borderLeftWidth) || 0;
f += parseInt(b.borderTopWidth) || 0
}
if (c === "TABLE" && (b.position === "relative" || b.position === "absolute")) {
e += parseInt(b.marginLeft) || 0;
f += parseInt(b.marginTop) || 0
}
}
}
b = Sys.UI.DomElement._getCurrentStyle(d);
var h = b ? b.position : null;
if (!h || h !== "absolute")for (a = d.parentNode; a; a = a.parentNode) {
c = a.tagName ? a.tagName.toUpperCase() : null;
if (c !== "BODY" && c !== "HTML" && (a.scrollLeft || a.scrollTop)) {
e -= a.scrollLeft || 0;
f -= a.scrollTop || 0;
b = Sys.UI.DomElement._getCurrentStyle(a);
if (b) {
e += parseInt(b.borderLeftWidth) || 0;
f += parseInt(b.borderTopWidth) || 0
}
}
}
return new Sys.UI.Point(e, f)
};
Sys.UI.DomElement.isDomElement = function (a) {
return Sys._isDomElement(a)
};
Sys.UI.DomElement.removeCssClass = function (d, c) {
var a = " " + d.className + " ", b = a.indexOf(" " + c + " ");
if (b >= 0)d.className = (a.substr(0, b) + " " + a.substring(b + c.length + 1, a.length)).trim()
};
Sys.UI.DomElement.resolveElement = function (b, c) {
var a = b;
if (!a)return null;
if (typeof a === "string")a = Sys.UI.DomElement.getElementById(a, c);
return a
};
Sys.UI.DomElement.raiseBubbleEvent = function (c, d) {
var b = c;
while (b) {
var a = b.control;
if (a && a.onBubbleEvent && a.raiseBubbleEvent) {
Sys.UI.DomElement._raiseBubbleEventFromControl(a, c, d);
return
}
b = b.parentNode
}
};
Sys.UI.DomElement._raiseBubbleEventFromControl = function (a, b, c) {
if (!a.onBubbleEvent(b, c))a._raiseBubbleEvent(b, c)
};
Sys.UI.DomElement.setLocation = function (b, c, d) {
var a = b.style;
a.position = "absolute";
a.left = c + "px";
a.top = d + "px"
};
Sys.UI.DomElement.toggleCssClass = function (b, a) {
if (Sys.UI.DomElement.containsCssClass(b, a))Sys.UI.DomElement.removeCssClass(b, a); else Sys.UI.DomElement.addCssClass(b, a)
};
Sys.UI.DomElement.getVisibilityMode = function (a) {
return a._visibilityMode === Sys.UI.VisibilityMode.hide ? Sys.UI.VisibilityMode.hide : Sys.UI.VisibilityMode.collapse
};
Sys.UI.DomElement.setVisibilityMode = function (a, b) {
Sys.UI.DomElement._ensureOldDisplayMode(a);
if (a._visibilityMode !== b) {
a._visibilityMode = b;
if (Sys.UI.DomElement.getVisible(a) === false)if (a._visibilityMode === Sys.UI.VisibilityMode.hide)a.style.display = a._oldDisplayMode; else a.style.display = "none";
a._visibilityMode = b
}
};
Sys.UI.DomElement.getVisible = function (b) {
var a = b.currentStyle || Sys.UI.DomElement._getCurrentStyle(b);
if (!a)return true;
return a.visibility !== "hidden" && a.display !== "none"
};
Sys.UI.DomElement.setVisible = function (a, b) {
if (b !== Sys.UI.DomElement.getVisible(a)) {
Sys.UI.DomElement._ensureOldDisplayMode(a);
a.style.visibility = b ? "visible" : "hidden";
if (b || a._visibilityMode === Sys.UI.VisibilityMode.hide)a.style.display = a._oldDisplayMode; else a.style.display = "none"
}
};
Sys.UI.DomElement._ensureOldDisplayMode = function (a) {
if (!a._oldDisplayMode) {
var b = a.currentStyle || Sys.UI.DomElement._getCurrentStyle(a);
a._oldDisplayMode = b ? b.display : null;
if (!a._oldDisplayMode || a._oldDisplayMode === "none")switch (a.tagName.toUpperCase()) {
case "DIV":
case "P":
case "ADDRESS":
case "BLOCKQUOTE":
case "BODY":
case "COL":
case "COLGROUP":
case "DD":
case "DL":
case "DT":
case "FIELDSET":
case "FORM":
case "H1":
case "H2":
case "H3":
case "H4":
case "H5":
case "H6":
case "HR":
case "IFRAME":
case "LEGEND":
case "OL":
case "PRE":
case "TABLE":
case "TD":
case "TH":
case "TR":
case "UL":
a._oldDisplayMode = "block";
break;
case "LI":
a._oldDisplayMode = "list-item";
break;
default:
a._oldDisplayMode = "inline"
}
}
};
Sys.UI.DomElement._getWindow = function (a) {
var b = a.ownerDocument || a.document || a;
return b.defaultView || b.parentWindow
};
Sys.UI.DomElement._getCurrentStyle = function (a) {
if (a.nodeType === 3)return null;
var c = Sys.UI.DomElement._getWindow(a);
if (a.documentElement)a = a.documentElement;
var b = c && a !== c && c.getComputedStyle ? c.getComputedStyle(a, null) : a.currentStyle || a.style;
if (!b && Sys.Browser.agent === Sys.Browser.Safari && a.style) {
var g = a.style.display, f = a.style.position;
a.style.position = "absolute";
a.style.display = "block";
var e = c.getComputedStyle(a, null);
a.style.display = g;
a.style.position = f;
b = {};
for (var d in e)b[d] = e[d];
b.display = "none"
}
return b
};
Sys.IContainer = function () {
};
Sys.IContainer.prototype = {};
Sys.IContainer.registerInterface("Sys.IContainer");
Sys.ApplicationLoadEventArgs = function (b, a) {
Sys.ApplicationLoadEventArgs.initializeBase(this);
this._components = b;
this._isPartialLoad = a
};
Sys.ApplicationLoadEventArgs.prototype = {
get_components: function () {
return this._components
}, get_isPartialLoad: function () {
return this._isPartialLoad
}
};
Sys.ApplicationLoadEventArgs.registerClass("Sys.ApplicationLoadEventArgs", Sys.EventArgs);
Sys._Application = function () {
Sys._Application.initializeBase(this);
this._disposableObjects = [];
this._components = {};
this._createdComponents = [];
this._secondPassComponents = [];
this._unloadHandlerDelegate = Function.createDelegate(this, this._unloadHandler);
Sys.UI.DomEvent.addHandler(window, "unload", this._unloadHandlerDelegate);
this._domReady()
};
Sys._Application.prototype = {
_creatingComponents: false,
_disposing: false,
_deleteCount: 0,
get_isCreatingComponents: function () {
return this._creatingComponents
},
get_isDisposing: function () {
return this._disposing
},
add_init: function (a) {
if (this._initialized)a(this, Sys.EventArgs.Empty); else this.get_events().addHandler("init", a)
},
remove_init: function (a) {
this.get_events().removeHandler("init", a)
},
add_load: function (a) {
this.get_events().addHandler("load", a)
},
remove_load: function (a) {
this.get_events().removeHandler("load", a)
},
add_unload: function (a) {
this.get_events().addHandler("unload", a)
},
remove_unload: function (a) {
this.get_events().removeHandler("unload", a)
},
addComponent: function (a) {
this._components[a.get_id()] = a
},
beginCreateComponents: function () {
this._creatingComponents = true
},
dispose: function () {
if (!this._disposing) {
this._disposing = true;
if (this._timerCookie) {
window.clearTimeout(this._timerCookie);
delete this._timerCookie
}
if (this._endRequestHandler) {
Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler);
delete this._endRequestHandler
}
if (this._beginRequestHandler) {
Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler);
delete this._beginRequestHandler
}
if (window.pageUnload)window.pageUnload(this, Sys.EventArgs.Empty);
var c = this.get_events().getHandler("unload");
if (c)c(this, Sys.EventArgs.Empty);
var b = Array.clone(this._disposableObjects);
for (var a = 0, f = b.length; a < f; a++) {
var d = b[a];
if (typeof d !== "undefined")d.dispose()
}
Array.clear(this._disposableObjects);
Sys.UI.DomEvent.removeHandler(window, "unload", this._unloadHandlerDelegate);
if (Sys._ScriptLoader) {
var e = Sys._ScriptLoader.getInstance();
if (e)e.dispose()
}
Sys._Application.callBaseMethod(this, "dispose")
}
},
disposeElement: function (c, j) {
if (c.nodeType === 1) {
var b, h = c.getElementsByTagName("*"), g = h.length, i = new Array(g);
for (b = 0; b < g; b++)i[b] = h[b];
for (b = g - 1; b >= 0; b--) {
var d = i[b], f = d.dispose;
if (f && typeof f === "function")d.dispose(); else {
var e = d.control;
if (e && typeof e.dispose === "function")e.dispose()
}
var a = d._behaviors;
if (a)this._disposeComponents(a);
a = d._components;
if (a) {
this._disposeComponents(a);
d._components = null
}
}
if (!j) {
var f = c.dispose;
if (f && typeof f === "function")c.dispose(); else {
var e = c.control;
if (e && typeof e.dispose === "function")e.dispose()
}
var a = c._behaviors;
if (a)this._disposeComponents(a);
a = c._components;
if (a) {
this._disposeComponents(a);
c._components = null
}
}
}
},
endCreateComponents: function () {
var b = this._secondPassComponents;
for (var a = 0, d = b.length; a < d; a++) {
var c = b[a].component;
Sys$Component$_setReferences(c, b[a].references);
c.endUpdate()
}
this._secondPassComponents = [];
this._creatingComponents = false
},
findComponent: function (b, a) {
return a ? Sys.IContainer.isInstanceOfType(a) ? a.findComponent(b) : a[b] || null : Sys.Application._components[b] || null
},
getComponents: function () {
var a = [], b = this._components;
for (var c in b)a[a.length] = b[c];
return a
},
initialize: function () {
if (!this.get_isInitialized() && !this._disposing) {
Sys._Application.callBaseMethod(this, "initialize");
this._raiseInit();
if (this.get_stateString) {
if (Sys.WebForms && Sys.WebForms.PageRequestManager) {
this._beginRequestHandler = Function.createDelegate(this, this._onPageRequestManagerBeginRequest);
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(this._beginRequestHandler);
this._endRequestHandler = Function.createDelegate(this, this._onPageRequestManagerEndRequest);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._endRequestHandler)
}
var a = this.get_stateString();
if (a !== this._currentEntry)this._navigate(a); else this._ensureHistory()
}
this.raiseLoad()
}
},
notifyScriptLoaded: function () {
},
registerDisposableObject: function (b) {
if (!this._disposing) {
var a = this._disposableObjects, c = a.length;
a[c] = b;
b.__msdisposeindex = c
}
},
raiseLoad: function () {
var b = this.get_events().getHandler("load"), a = new Sys.ApplicationLoadEventArgs(Array.clone(this._createdComponents), !!this._loaded);
this._loaded = true;
if (b)b(this, a);
if (window.pageLoad)window.pageLoad(this, a);
this._createdComponents = []
},
removeComponent: function (b) {
var a = b.get_id();
if (a)delete this._components[a]
},
unregisterDisposableObject: function (a) {
if (!this._disposing) {
var e = a.__msdisposeindex;
if (typeof e === "number") {
var b = this._disposableObjects;
delete b[e];
delete a.__msdisposeindex;
if (++this._deleteCount > 1000) {
var c = [];
for (var d = 0, f = b.length; d < f; d++) {
a = b[d];
if (typeof a !== "undefined") {
a.__msdisposeindex = c.length;
c.push(a)
}
}
this._disposableObjects = c;
this._deleteCount = 0
}
}
}
},
_addComponentToSecondPass: function (b, a) {
this._secondPassComponents[this._secondPassComponents.length] = {component: b, references: a}
},
_disposeComponents: function (a) {
if (a)for (var b = a.length - 1; b >= 0; b--) {
var c = a[b];
if (typeof c.dispose === "function")c.dispose()
}
},
_domReady: function () {
var a, g, f = this;
function b() {
f.initialize()
}
var c = function () {
Sys.UI.DomEvent.removeHandler(window, "load", c);
b()
};
Sys.UI.DomEvent.addHandler(window, "load", c);
if (document.addEventListener)try {
document.addEventListener("DOMContentLoaded", a = function () {
document.removeEventListener("DOMContentLoaded", a, false);
b()
}, false)
} catch (h) {
} else if (document.attachEvent)if (window == window.top && document.documentElement.doScroll) {
var e, d = document.createElement("div");
a = function () {
try {
d.doScroll("left")
} catch (c) {
e = window.setTimeout(a, 0);
return
}
d = null;
b()
};
a()
} else document.attachEvent("onreadystatechange", a = function () {
if (document.readyState === "complete") {
document.detachEvent("onreadystatechange", a);
b()
}
})
},
_raiseInit: function () {
var a = this.get_events().getHandler("init");
if (a) {
this.beginCreateComponents();
a(this, Sys.EventArgs.Empty);
this.endCreateComponents()
}
},
_unloadHandler: function () {
this.dispose()
}
};
Sys._Application.registerClass("Sys._Application", Sys.Component, Sys.IContainer);
Sys.Application = new Sys._Application;
var $find = Sys.Application.findComponent;
Sys.UI.Behavior = function (b) {
Sys.UI.Behavior.initializeBase(this);
this._element = b;
var a = b._behaviors;
if (!a)b._behaviors = [this]; else a[a.length] = this
};
Sys.UI.Behavior.prototype = {
_name: null, get_element: function () {
return this._element
}, get_id: function () {
var a = Sys.UI.Behavior.callBaseMethod(this, "get_id");
if (a)return a;
if (!this._element || !this._element.id)return "";
return this._element.id + "$" + this.get_name()
}, get_name: function () {
if (this._name)return this._name;
var a = Object.getTypeName(this), b = a.lastIndexOf(".");
if (b !== -1)a = a.substr(b + 1);
if (!this.get_isInitialized())this._name = a;
return a
}, set_name: function (a) {
this._name = a
}, initialize: function () {
Sys.UI.Behavior.callBaseMethod(this, "initialize");
var a = this.get_name();
if (a)this._element[a] = this
}, dispose: function () {
Sys.UI.Behavior.callBaseMethod(this, "dispose");
var a = this._element;
if (a) {
var c = this.get_name();
if (c)a[c] = null;
var b = a._behaviors;
Array.remove(b, this);
if (b.length === 0)a._behaviors = null;
delete this._element
}
}
};
Sys.UI.Behavior.registerClass("Sys.UI.Behavior", Sys.Component);
Sys.UI.Behavior.getBehaviorByName = function (b, c) {
var a = b[c];
return a && Sys.UI.Behavior.isInstanceOfType(a) ? a : null
};
Sys.UI.Behavior.getBehaviors = function (a) {
if (!a._behaviors)return [];
return Array.clone(a._behaviors)
};
Sys.UI.Behavior.getBehaviorsByType = function (d, e) {
var a = d._behaviors, c = [];
if (a)for (var b = 0, f = a.length; b < f; b++)if (e.isInstanceOfType(a[b]))c[c.length] = a[b];
return c
};
Sys.UI.VisibilityMode = function () {
throw Error.notImplemented()
};
Sys.UI.VisibilityMode.prototype = {hide: 0, collapse: 1};
Sys.UI.VisibilityMode.registerEnum("Sys.UI.VisibilityMode");
Sys.UI.Control = function (a) {
Sys.UI.Control.initializeBase(this);
this._element = a;
a.control = this;
var b = this.get_role();
if (b)a.setAttribute("role", b)
};
Sys.UI.Control.prototype = {
_parent: null, _visibilityMode: Sys.UI.VisibilityMode.hide, get_element: function () {
return this._element
}, get_id: function () {
if (!this._element)return "";
return this._element.id
}, set_id: function () {
throw Error.invalidOperation(Sys.Res.cantSetId)
}, get_parent: function () {
if (this._parent)return this._parent;
if (!this._element)return null;
var a = this._element.parentNode;
while (a) {
if (a.control)return a.control;
a = a.parentNode
}
return null
}, set_parent: function (a) {
this._parent = a
}, get_role: function () {
return null
}, get_visibilityMode: function () {
return Sys.UI.DomElement.getVisibilityMode(this._element)
}, set_visibilityMode: function (a) {
Sys.UI.DomElement.setVisibilityMode(this._element, a)
}, get_visible: function () {
return Sys.UI.DomElement.getVisible(this._element)
}, set_visible: function (a) {
Sys.UI.DomElement.setVisible(this._element, a)
}, addCssClass: function (a) {
Sys.UI.DomElement.addCssClass(this._element, a)
}, dispose: function () {
Sys.UI.Control.callBaseMethod(this, "dispose");
if (this._element) {
this._element.control = null;
delete this._element
}
if (this._parent)delete this._parent
}, onBubbleEvent: function () {
return false
}, raiseBubbleEvent: function (a, b) {
this._raiseBubbleEvent(a, b)
}, _raiseBubbleEvent: function (b, c) {
var a = this.get_parent();
while (a) {
if (a.onBubbleEvent(b, c))return;
a = a.get_parent()
}
}, removeCssClass: function (a) {
Sys.UI.DomElement.removeCssClass(this._element, a)
}, toggleCssClass: function (a) {
Sys.UI.DomElement.toggleCssClass(this._element, a)
}
};
Sys.UI.Control.registerClass("Sys.UI.Control", Sys.Component);
Sys.HistoryEventArgs = function (a) {
Sys.HistoryEventArgs.initializeBase(this);
this._state = a
};
Sys.HistoryEventArgs.prototype = {
get_state: function () {
return this._state
}
};
Sys.HistoryEventArgs.registerClass("Sys.HistoryEventArgs", Sys.EventArgs);
Sys.Application._appLoadHandler = null;
Sys.Application._beginRequestHandler = null;
Sys.Application._clientId = null;
Sys.Application._currentEntry = "";
Sys.Application._endRequestHandler = null;
Sys.Application._history = null;
Sys.Application._enableHistory = false;
Sys.Application._historyFrame = null;
Sys.Application._historyInitialized = false;
Sys.Application._historyPointIsNew = false;
Sys.Application._ignoreTimer = false;
Sys.Application._initialState = null;
Sys.Application._state = {};
Sys.Application._timerCookie = 0;
Sys.Application._timerHandler = null;
Sys.Application._uniqueId = null;
Sys._Application.prototype.get_stateString = function () {
var a = null;
if (Sys.Browser.agent === Sys.Browser.Firefox) {
var c = window.location.href, b = c.indexOf("#");
if (b !== -1)a = c.substring(b + 1); else a = "";
return a
} else a = window.location.hash;
if (a.length > 0 && a.charAt(0) === "#")a = a.substring(1);
return a
};
Sys._Application.prototype.get_enableHistory = function () {
return this._enableHistory
};
Sys._Application.prototype.set_enableHistory = function (a) {
this._enableHistory = a
};
Sys._Application.prototype.add_navigate = function (a) {
this.get_events().addHandler("navigate", a)
};
Sys._Application.prototype.remove_navigate = function (a) {
this.get_events().removeHandler("navigate", a)
};
Sys._Application.prototype.addHistoryPoint = function (c, f) {
this._ensureHistory();
var b = this._state;
for (var a in c) {
var d = c[a];
if (d === null) {
if (typeof b[a] !== "undefined")delete b[a]
} else b[a] = d
}
var e = this._serializeState(b);
this._historyPointIsNew = true;
this._setState(e, f);
this._raiseNavigate()
};
Sys._Application.prototype.setServerId = function (a, b) {
this._clientId = a;
this._uniqueId = b
};
Sys._Application.prototype.setServerState = function (a) {
this._ensureHistory();
this._state.__s = a;
this._updateHiddenField(a)
};
Sys._Application.prototype._deserializeState = function (a) {
var e = {};
a = a || "";
var b = a.indexOf("&&");
if (b !== -1 && b + 2 < a.length) {
e.__s = a.substr(b + 2);
a = a.substr(0, b)
}
var g = a.split("&");
for (var f = 0, j = g.length; f < j; f++) {
var d = g[f], c = d.indexOf("=");
if (c !== -1 && c + 1 < d.length) {
var i = d.substr(0, c), h = d.substr(c + 1);
e[i] = decodeURIComponent(h)
}
}
return e
};
Sys._Application.prototype._enableHistoryInScriptManager = function () {
this._enableHistory = true
};
Sys._Application.prototype._ensureHistory = function () {
if (!this._historyInitialized && this._enableHistory) {
if (Sys.Browser.agent === Sys.Browser.InternetExplorer && (!document.documentMode || document.documentMode < 8)) {
this._historyFrame = document.getElementById("__historyFrame");
this._ignoreIFrame = true
}
this._timerHandler = Function.createDelegate(this, this._onIdle);
this._timerCookie = window.setTimeout(this._timerHandler, 100);
try {
this._initialState = this._deserializeState(this.get_stateString())
} catch (a) {
}
this._historyInitialized = true
}
};
Sys._Application.prototype._navigate = function (c) {
this._ensureHistory();
var b = this._deserializeState(c);
if (this._uniqueId) {
var d = this._state.__s || "", a = b.__s || "";
if (a !== d) {
this._updateHiddenField(a);
__doPostBack(this._uniqueId, a);
this._state = b;
return
}
}
this._setState(c);
this._state = b;
this._raiseNavigate()
};
Sys._Application.prototype._onIdle = function () {
delete this._timerCookie;
var a = this.get_stateString();
if (a !== this._currentEntry) {
if (!this._ignoreTimer) {
this._historyPointIsNew = false;
this._navigate(a)
}
} else this._ignoreTimer = false;
this._timerCookie = window.setTimeout(this._timerHandler, 100)
};
Sys._Application.prototype._onIFrameLoad = function (a) {
if (!document.documentMode || document.documentMode < 8) {
this._ensureHistory();
if (!this._ignoreIFrame) {
this._historyPointIsNew = false;
this._navigate(a)
}
this._ignoreIFrame = false
}
};
Sys._Application.prototype._onPageRequestManagerBeginRequest = function () {
this._ignoreTimer = true;
this._originalTitle = document.title
};
Sys._Application.prototype._onPageRequestManagerEndRequest = function (g, f) {
var d = f.get_dataItems()[this._clientId], c = this._originalTitle;
this._originalTitle = null;
var b = document.getElementById("__EVENTTARGET");
if (b && b.value === this._uniqueId)b.value = "";
if (typeof d !== "undefined") {
this.setServerState(d);
this._historyPointIsNew = true
} else this._ignoreTimer = false;
var a = this._serializeState(this._state);
if (a !== this._currentEntry) {
this._ignoreTimer = true;
if (typeof c === "string") {
if (Sys.Browser.agent !== Sys.Browser.InternetExplorer || Sys.Browser.version > 7) {
var e = document.title;
document.title = c;
this._setState(a);
document.title = e
} else this._setState(a);
this._raiseNavigate()
} else {
this._setState(a);
this._raiseNavigate()
}
}
};
Sys._Application.prototype._raiseNavigate = function () {
var d = this._historyPointIsNew, c = this.get_events().getHandler("navigate"), b = {};
for (var a in this._state)if (a !== "__s")b[a] = this._state[a];
var e = new Sys.HistoryEventArgs(b);
if (c)c(this, e);
if (!d) {
var f;
try {
if (Sys.Browser.agent === Sys.Browser.Firefox && window.location.hash && (!window.frameElement || window.top.location.hash))Sys.Browser.version < 3.5 ? window.history.go(0) : (location.hash = this.get_stateString())
} catch (g) {
}
}
};
Sys._Application.prototype._serializeState = function (d) {
var b = [];
for (var a in d) {
var e = d[a];
if (a === "__s")var c = e; else b[b.length] = a + "=" + encodeURIComponent(e)
}
return b.join("&") + (c ? "&&" + c : "")
};
Sys._Application.prototype._setState = function (a, b) {
if (this._enableHistory) {
a = a || "";
if (a !== this._currentEntry) {
if (window.theForm) {
var d = window.theForm.action, e = d.indexOf("#");
window.theForm.action = (e !== -1 ? d.substring(0, e) : d) + "#" + a
}
if (this._historyFrame && this._historyPointIsNew) {
var f = document.createElement("div");
f.appendChild(document.createTextNode(b || document.title));
var g = f.innerHTML;
this._ignoreIFrame = true;
var c = this._historyFrame.contentWindow.document;
c.open("javascript:'<html></html>'");
c.write("<html><head><title>" + g + "</title><scri" + 'pt type="text/javascript">parent.Sys.Application._onIFrameLoad(' + Sys.Serialization.JavaScriptSerializer.serialize(a) + ");</scri" + "pt></head><body></body></html>");
c.close()
}
this._ignoreTimer = false;
this._currentEntry = a;
if (this._historyFrame || this._historyPointIsNew) {
var h = this.get_stateString();
if (a !== h) {
window.location.hash = a;
this._currentEntry = this.get_stateString();
if (typeof b !== "undefined" && b !== null)document.title = b
}
}
this._historyPointIsNew = false
}
}
};
Sys._Application.prototype._updateHiddenField = function (b) {
if (this._clientId) {
var a = document.getElementById(this._clientId);
if (a)a.value = b
}
};
if (!window.XMLHttpRequest)window.XMLHttpRequest = function () {
var b = ["Msxml2.XMLHTTP.3.0", "Msxml2.XMLHTTP"];
for (var a = 0, c = b.length; a < c; a++)try {
return new ActiveXObject(b[a])
} catch (d) {
}
return null
};
Type.registerNamespace("Sys.Net");
Sys.Net.WebRequestExecutor = function () {
this._webRequest = null;
this._resultObject = null
};
Sys.Net.WebRequestExecutor.prototype = {
get_webRequest: function () {
return this._webRequest
}, _set_webRequest: function (a) {
this._webRequest = a
}, get_started: function () {
throw Error.notImplemented()
}, get_responseAvailable: function () {
throw Error.notImplemented()
}, get_timedOut: function () {
throw Error.notImplemented()
}, get_aborted: function () {
throw Error.notImplemented()
}, get_responseData: function () {
throw Error.notImplemented()
}, get_statusCode: function () {
throw Error.notImplemented()
}, get_statusText: function () {
throw Error.notImplemented()
}, get_xml: function () {
throw Error.notImplemented()
}, get_object: function () {
if (!this._resultObject)this._resultObject = Sys.Serialization.JavaScriptSerializer.deserialize(this.get_responseData());
return this._resultObject
}, executeRequest: function () {
throw Error.notImplemented()
}, abort: function () {
throw Error.notImplemented()
}, getResponseHeader: function () {
throw Error.notImplemented()
}, getAllResponseHeaders: function () {
throw Error.notImplemented()
}
};
Sys.Net.WebRequestExecutor.registerClass("Sys.Net.WebRequestExecutor");
Sys.Net.XMLDOM = function (d) {
if (!window.DOMParser) {
var c = ["Msxml2.DOMDocument.3.0", "Msxml2.DOMDocument"];
for (var b = 0, f = c.length; b < f; b++)try {
var a = new ActiveXObject(c[b]);
a.async = false;
a.loadXML(d);
a.setProperty("SelectionLanguage", "XPath");
return a
} catch (g) {
}
} else try {
var e = new window.DOMParser;
return e.parseFromString(d, "text/xml")
} catch (g) {
}
return null
};
Sys.Net.XMLHttpExecutor = function () {
Sys.Net.XMLHttpExecutor.initializeBase(this);
var a = this;
this._xmlHttpRequest = null;
this._webRequest = null;
this._responseAvailable = false;
this._timedOut = false;
this._timer = null;
this._aborted = false;
this._started = false;
this._onReadyStateChange = function () {
if (a._xmlHttpRequest.readyState === 4) {
try {
if (typeof a._xmlHttpRequest.status === "undefined")return
} catch (b) {
return
}
a._clearTimer();
a._responseAvailable = true;
try {
a._webRequest.completed(Sys.EventArgs.Empty)
} finally {
if (a._xmlHttpRequest != null) {
a._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
a._xmlHttpRequest = null
}
}
}
};
this._clearTimer = function () {
if (a._timer != null) {
window.clearTimeout(a._timer);
a._timer = null
}
};
this._onTimeout = function () {
if (!a._responseAvailable) {
a._clearTimer();
a._timedOut = true;
a._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
a._xmlHttpRequest.abort();
a._webRequest.completed(Sys.EventArgs.Empty);
a._xmlHttpRequest = null
}
}
};
Sys.Net.XMLHttpExecutor.prototype = {
get_timedOut: function () {
return this._timedOut
}, get_started: function () {
return this._started
}, get_responseAvailable: function () {
return this._responseAvailable
}, get_aborted: function () {
return this._aborted
}, executeRequest: function () {
this._webRequest = this.get_webRequest();
var c = this._webRequest.get_body(), a = this._webRequest.get_headers();
this._xmlHttpRequest = new XMLHttpRequest;
this._xmlHttpRequest.onreadystatechange = this._onReadyStateChange;
var e = this._webRequest.get_httpVerb();
this._xmlHttpRequest.open(e, this._webRequest.getResolvedUrl(), true);
this._xmlHttpRequest.setRequestHeader("X-Requested-With", "XMLHttpRequest");
if (a)for (var b in a) {
var f = a[b];
if (typeof f !== "function")this._xmlHttpRequest.setRequestHeader(b, f)
}
if (e.toLowerCase() === "post") {
if (a === null || !a["Content-Type"])this._xmlHttpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
if (!c)c = ""
}
var d = this._webRequest.get_timeout();
if (d > 0)this._timer = window.setTimeout(Function.createDelegate(this, this._onTimeout), d);
this._xmlHttpRequest.send(c);
this._started = true
}, getResponseHeader: function (b) {
var a;
try {
a = this._xmlHttpRequest.getResponseHeader(b)
} catch (c) {
}
if (!a)a = "";
return a
}, getAllResponseHeaders: function () {
return this._xmlHttpRequest.getAllResponseHeaders()
}, get_responseData: function () {
return this._xmlHttpRequest.responseText
}, get_statusCode: function () {
var a = 0;
try {
a = this._xmlHttpRequest.status
} catch (b) {
}
return a
}, get_statusText: function () {
return this._xmlHttpRequest.statusText
}, get_xml: function () {
var a = this._xmlHttpRequest.responseXML;
if (!a || !a.documentElement) {
a = Sys.Net.XMLDOM(this._xmlHttpRequest.responseText);
if (!a || !a.documentElement)return null
} else if (navigator.userAgent.indexOf("MSIE") !== -1 && typeof a.setProperty != "undefined")a.setProperty("SelectionLanguage", "XPath");
if (a.documentElement.namespaceURI === "http://www.mozilla.org/newlayout/xml/parsererror.xml" && a.documentElement.tagName === "parsererror")return null;
if (a.documentElement.firstChild && a.documentElement.firstChild.tagName === "parsererror")return null;
return a
}, abort: function () {
if (this._aborted || this._responseAvailable || this._timedOut)return;
this._aborted = true;
this._clearTimer();
if (this._xmlHttpRequest && !this._responseAvailable) {
this._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
this._xmlHttpRequest.abort();
this._xmlHttpRequest = null;
this._webRequest.completed(Sys.EventArgs.Empty)
}
}
};
Sys.Net.XMLHttpExecutor.registerClass("Sys.Net.XMLHttpExecutor", Sys.Net.WebRequestExecutor);
Sys.Net._WebRequestManager = function () {
this._defaultTimeout = 0;
this._defaultExecutorType = "Sys.Net.XMLHttpExecutor"
};
Sys.Net._WebRequestManager.prototype = {
add_invokingRequest: function (a) {
this._get_eventHandlerList().addHandler("invokingRequest", a)
}, remove_invokingRequest: function (a) {
this._get_eventHandlerList().removeHandler("invokingRequest", a)
}, add_completedRequest: function (a) {
this._get_eventHandlerList().addHandler("completedRequest", a)
}, remove_completedRequest: function (a) {
this._get_eventHandlerList().removeHandler("completedRequest", a)
}, _get_eventHandlerList: function () {
if (!this._events)this._events = new Sys.EventHandlerList;
return this._events
}, get_defaultTimeout: function () {
return this._defaultTimeout
}, set_defaultTimeout: function (a) {
this._defaultTimeout = a
}, get_defaultExecutorType: function () {
return this._defaultExecutorType
}, set_defaultExecutorType: function (a) {
this._defaultExecutorType = a
}, executeRequest: function (webRequest) {
var executor = webRequest.get_executor();
if (!executor) {
var failed = false;
try {
var executorType = eval(this._defaultExecutorType);
executor = new executorType
} catch (a) {
failed = true
}
webRequest.set_executor(executor)
}
if (executor.get_aborted())return;
var evArgs = new Sys.Net.NetworkRequestEventArgs(webRequest), handler = this._get_eventHandlerList().getHandler("invokingRequest");
if (handler)handler(this, evArgs);
if (!evArgs.get_cancel())executor.executeRequest()
}
};
Sys.Net._WebRequestManager.registerClass("Sys.Net._WebRequestManager");
Sys.Net.WebRequestManager = new Sys.Net._WebRequestManager;
Sys.Net.NetworkRequestEventArgs = function (a) {
Sys.Net.NetworkRequestEventArgs.initializeBase(this);
this._webRequest = a
};
Sys.Net.NetworkRequestEventArgs.prototype = {
get_webRequest: function () {
return this._webRequest
}
};
Sys.Net.NetworkRequestEventArgs.registerClass("Sys.Net.NetworkRequestEventArgs", Sys.CancelEventArgs);
Sys.Net.WebRequest = function () {
this._url = "";
this._headers = {};
this._body = null;
this._userContext = null;
this._httpVerb = null;
this._executor = null;
this._invokeCalled = false;
this._timeout = 0
};
Sys.Net.WebRequest.prototype = {
add_completed: function (a) {
this._get_eventHandlerList().addHandler("completed", a)
}, remove_completed: function (a) {
this._get_eventHandlerList().removeHandler("completed", a)
}, completed: function (b) {
var a = Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest");
if (a)a(this._executor, b);
a = this._get_eventHandlerList().getHandler("completed");
if (a)a(this._executor, b)
}, _get_eventHandlerList: function () {
if (!this._events)this._events = new Sys.EventHandlerList;
return this._events
}, get_url: function () {
return this._url
}, set_url: function (a) {
this._url = a
}, get_headers: function () {
return this._headers
}, get_httpVerb: function () {
if (this._httpVerb === null) {
if (this._body === null)return "GET";
return "POST"
}
return this._httpVerb
}, set_httpVerb: function (a) {
this._httpVerb = a
}, get_body: function () {
return this._body
}, set_body: function (a) {
this._body = a
}, get_userContext: function () {
return this._userContext
}, set_userContext: function (a) {
this._userContext = a
}, get_executor: function () {
return this._executor
}, set_executor: function (a) {
this._executor = a;
this._executor._set_webRequest(this)
}, get_timeout: function () {
if (this._timeout === 0)return Sys.Net.WebRequestManager.get_defaultTimeout();
return this._timeout
}, set_timeout: function (a) {
this._timeout = a
}, getResolvedUrl: function () {
return Sys.Net.WebRequest._resolveUrl(this._url)
}, invoke: function () {
Sys.Net.WebRequestManager.executeRequest(this);
this._invokeCalled = true
}
};
Sys.Net.WebRequest._resolveUrl = function (b, a) {
if (b && b.indexOf("://") !== -1)return b;
if (!a || a.length === 0) {
var d = document.getElementsByTagName("base")[0];
if (d && d.href && d.href.length > 0)a = d.href; else a = document.URL
}
var c = a.indexOf("?");
if (c !== -1)a = a.substr(0, c);
c = a.indexOf("#");
if (c !== -1)a = a.substr(0, c);
a = a.substr(0, a.lastIndexOf("/") + 1);
if (!b || b.length === 0)return a;
if (b.charAt(0) === "/") {
var e = a.indexOf("://"), g = a.indexOf("/", e + 3);
return a.substr(0, g) + b
} else {
var f = a.lastIndexOf("/");
return a.substr(0, f + 1) + b
}
};
Sys.Net.WebRequest._createQueryString = function (c, b, f) {
b = b || encodeURIComponent;
var h = 0, e, g, d, a = new Sys.StringBuilder;
if (c)for (d in c) {
e = c[d];
if (typeof e === "function")continue;
g = Sys.Serialization.JavaScriptSerializer.serialize(e);
if (h++)a.append("&");
a.append(d);
a.append("=");
a.append(b(g))
}
if (f) {
if (h)a.append("&");
a.append(f)
}
return a.toString()
};
Sys.Net.WebRequest._createUrl = function (a, b, c) {
if (!b && !c)return a;
var d = Sys.Net.WebRequest._createQueryString(b, null, c);
return d.length ? a + (a && a.indexOf("?") >= 0 ? "&" : "?") + d : a
};
Sys.Net.WebRequest.registerClass("Sys.Net.WebRequest");
Sys._ScriptLoaderTask = function (b, a) {
this._scriptElement = b;
this._completedCallback = a
};
Sys._ScriptLoaderTask.prototype = {
get_scriptElement: function () {
return this._scriptElement
}, dispose: function () {
if (this._disposed)return;
this._disposed = true;
this._removeScriptElementHandlers();
Sys._ScriptLoaderTask._clearScript(this._scriptElement);
this._scriptElement = null
}, execute: function () {
if (this._ensureReadyStateLoaded())this._executeInternal()
}, _executeInternal: function () {
this._addScriptElementHandlers();
document.getElementsByTagName("head")[0].appendChild(this._scriptElement)
}, _ensureReadyStateLoaded: function () {
if (this._useReadyState() && this._scriptElement.readyState !== "loaded" && this._scriptElement.readyState !== "complete") {
this._scriptDownloadDelegate = Function.createDelegate(this, this._executeInternal);
$addHandler(this._scriptElement, "readystatechange", this._scriptDownloadDelegate);
return false
}
return true
}, _addScriptElementHandlers: function () {
if (this._scriptDownloadDelegate) {
$removeHandler(this._scriptElement, "readystatechange", this._scriptDownloadDelegate);
this._scriptDownloadDelegate = null
}
this._scriptLoadDelegate = Function.createDelegate(this, this._scriptLoadHandler);
if (this._useReadyState())$addHandler(this._scriptElement, "readystatechange", this._scriptLoadDelegate); else $addHandler(this._scriptElement, "load", this._scriptLoadDelegate);
if (this._scriptElement.addEventListener) {
this._scriptErrorDelegate = Function.createDelegate(this, this._scriptErrorHandler);
this._scriptElement.addEventListener("error", this._scriptErrorDelegate, false)
}
}, _removeScriptElementHandlers: function () {
if (this._scriptLoadDelegate) {
var a = this.get_scriptElement();
if (this._scriptDownloadDelegate) {
$removeHandler(this._scriptElement, "readystatechange", this._scriptDownloadDelegate);
this._scriptDownloadDelegate = null
}
if (this._useReadyState() && this._scriptLoadDelegate)$removeHandler(a, "readystatechange", this._scriptLoadDelegate); else $removeHandler(a, "load", this._scriptLoadDelegate);
if (this._scriptErrorDelegate) {
this._scriptElement.removeEventListener("error", this._scriptErrorDelegate, false);
this._scriptErrorDelegate = null
}
this._scriptLoadDelegate = null
}
}, _scriptErrorHandler: function () {
if (this._disposed)return;
this._completedCallback(this.get_scriptElement(), false)
}, _scriptLoadHandler: function () {
if (this._disposed)return;
var a = this.get_scriptElement();
if (this._useReadyState() && a.readyState !== "complete")return;
this._completedCallback(a, true)
}, _useReadyState: function () {
return Sys.Browser.agent === Sys.Browser.InternetExplorer && (Sys.Browser.version < 9 || (document.documentMode || 0) < 9)
}
};
Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask", null, Sys.IDisposable);
Sys._ScriptLoaderTask._clearScript = function (a) {
if (!Sys.Debug.isDebug && a.parentNode)a.parentNode.removeChild(a)
};
Type.registerNamespace("Sys.Net");
Sys.Net.WebServiceProxy = function () {
};
Sys.Net.WebServiceProxy.prototype = {
get_timeout: function () {
return this._timeout || 0
}, set_timeout: function (a) {
if (a < 0)throw Error.argumentOutOfRange("value", a, Sys.Res.invalidTimeout);
this._timeout = a
}, get_defaultUserContext: function () {
return typeof this._userContext === "undefined" ? null : this._userContext
}, set_defaultUserContext: function (a) {
this._userContext = a
}, get_defaultSucceededCallback: function () {
return this._succeeded || null
}, set_defaultSucceededCallback: function (a) {
this._succeeded = a
}, get_defaultFailedCallback: function () {
return this._failed || null
}, set_defaultFailedCallback: function (a) {
this._failed = a
}, get_enableJsonp: function () {
return !!this._jsonp
}, set_enableJsonp: function (a) {
this._jsonp = a
}, get_path: function () {
return this._path || null
}, set_path: function (a) {
this._path = a
}, get_jsonpCallbackParameter: function () {
return this._callbackParameter || "callback"
}, set_jsonpCallbackParameter: function (a) {
this._callbackParameter = a
}, _invoke: function (d, e, g, f, c, b, a) {
c = c || this.get_defaultSucceededCallback();
b = b || this.get_defaultFailedCallback();
if (a === null || typeof a === "undefined")a = this.get_defaultUserContext();
return Sys.Net.WebServiceProxy.invoke(d, e, g, f, c, b, a, this.get_timeout(), this.get_enableJsonp(), this.get_jsonpCallbackParameter())
}
};
Sys.Net.WebServiceProxy.registerClass("Sys.Net.WebServiceProxy");
Sys.Net.WebServiceProxy.invoke = function (q, a, m, l, j, b, g, e, w, p) {
var i = w !== false ? Sys.Net.WebServiceProxy._xdomain.exec(q) : null, c, n = i && i.length === 3 && (i[1] !== location.protocol || i[2] !== location.host);
m = n || m;
if (n) {
p = p || "callback";
c = "_jsonp" + Sys._jsonp++
}
if (!l)l = {};
var r = l;
if (!m || !r)r = {};
var s, h, f = null, k, o = null, u = Sys.Net.WebRequest._createUrl(a ? q + "/" + encodeURIComponent(a) : q, r, n ? p + "=Sys." + c : null);
if (n) {
s = document.createElement("script");
s.src = u;
k = new Sys._ScriptLoaderTask(s, function (d, b) {
if (!b || c)t({Message: String.format(Sys.Res.webServiceFailedNoMsg, a)}, -1)
});
function v() {
if (f === null)return;
f = null;
h = new Sys.Net.WebServiceError(true, String.format(Sys.Res.webServiceTimedOut, a));
k.dispose();
delete Sys[c];
if (b)b(h, g, a)
}
function t(d, e) {
if (f !== null) {
window.clearTimeout(f);
f = null
}
k.dispose();
delete Sys[c];
c = null;
if (typeof e !== "undefined" && e !== 200) {
if (b) {
h = new Sys.Net.WebServiceError(false, d.Message || String.format(Sys.Res.webServiceFailedNoMsg, a), d.StackTrace || null, d.ExceptionType || null, d);
h._statusCode = e;
b(h, g, a)
}
} else if (j)j(d, g, a)
}
Sys[c] = t;
e = e || Sys.Net.WebRequestManager.get_defaultTimeout();
if (e > 0)f = window.setTimeout(v, e);
k.execute();
return null
}
var d = new Sys.Net.WebRequest;
d.set_url(u);
d.get_headers()["Content-Type"] = "application/json; charset=utf-8";
if (!m) {
o = Sys.Serialization.JavaScriptSerializer.serialize(l);
if (o === "{}")o = ""
}
d.set_body(o);
d.add_completed(x);
if (e && e > 0)d.set_timeout(e);
d.invoke();
function x(d) {
if (d.get_responseAvailable()) {
var f = d.get_statusCode(), c = null;
try {
var e = d.getResponseHeader("Content-Type");
if (e.startsWith("application/json"))c = d.get_object(); else if (e.startsWith("text/xml"))c = d.get_xml(); else c = d.get_responseData()
} catch (m) {
}
var k = d.getResponseHeader("jsonerror"), h = k === "true";
if (h) {
if (c)c = new Sys.Net.WebServiceError(false, c.Message, c.StackTrace, c.ExceptionType, c)
} else if (e.startsWith("application/json"))c = !c || typeof c.d === "undefined" ? c : c.d;
if (f < 200 || f >= 300 || h) {
if (b) {
if (!c || !h)c = new Sys.Net.WebServiceError(false, String.format(Sys.Res.webServiceFailedNoMsg, a));
c._statusCode = f;
b(c, g, a)
}
} else if (j)j(c, g, a)
} else {
var i;
if (d.get_timedOut())i = String.format(Sys.Res.webServiceTimedOut, a); else i = String.format(Sys.Res.webServiceFailedNoMsg, a);
if (b)b(new Sys.Net.WebServiceError(d.get_timedOut(), i, "", ""), g, a)
}
}
return d
};
Sys.Net.WebServiceProxy._generateTypedConstructor = function (a) {
return function (b) {
if (b)for (var c in b)this[c] = b[c];
this.__type = a
}
};
Sys._jsonp = 0;
Sys.Net.WebServiceProxy._xdomain = /^\s*([a-zA-Z0-9\+\-\.]+\:)\/\/([^?#\/]+)/;
Sys.Net.WebServiceError = function (d, e, c, a, b) {
this._timedOut = d;
this._message = e;
this._stackTrace = c;
this._exceptionType = a;
this._errorObject = b;
this._statusCode = -1
};
Sys.Net.WebServiceError.prototype = {
get_timedOut: function () {
return this._timedOut
}, get_statusCode: function () {
return this._statusCode
}, get_message: function () {
return this._message
}, get_stackTrace: function () {
return this._stackTrace || ""
}, get_exceptionType: function () {
return this._exceptionType || ""
}, get_errorObject: function () {
return this._errorObject || null
}
};
Sys.Net.WebServiceError.registerClass("Sys.Net.WebServiceError");
Type.registerNamespace('Sys');
Sys.Res = {
"argumentInteger": "Value must be an integer.",
"invokeCalledTwice": "Cannot call invoke more than once.",
"webServiceFailed": "The server method \u0027{0}\u0027 failed with the following error: {1}",
"argumentType": "Object cannot be converted to the required type.",
"argumentNull": "Value cannot be null.",
"scriptAlreadyLoaded": "The script \u0027{0}\u0027 has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit.",
"scriptDependencyNotFound": "The script \u0027{0}\u0027 failed to load because it is dependent on script \u0027{1}\u0027.",
"formatBadFormatSpecifier": "Format specifier was invalid.",
"requiredScriptReferenceNotIncluded": "\u0027{0}\u0027 requires that you have included a script reference to \u0027{1}\u0027.",
"webServiceFailedNoMsg": "The server method \u0027{0}\u0027 failed.",
"argumentDomElement": "Value must be a DOM element.",
"invalidExecutorType": "Could not create a valid Sys.Net.WebRequestExecutor from: {0}.",
"cannotCallBeforeResponse": "Cannot call {0} when responseAvailable is false.",
"actualValue": "Actual value was {0}.",
"enumInvalidValue": "\u0027{0}\u0027 is not a valid value for enum {1}.",
"scriptLoadFailed": "The script \u0027{0}\u0027 could not be loaded.",
"parameterCount": "Parameter count mismatch.",
"cannotDeserializeEmptyString": "Cannot deserialize empty string.",
"formatInvalidString": "Input string was not in a correct format.",
"invalidTimeout": "Value must be greater than or equal to zero.",
"cannotAbortBeforeStart": "Cannot abort when executor has not started.",
"argument": "Value does not fall within the expected range.",
"cannotDeserializeInvalidJson": "Cannot deserialize. The data does not correspond to valid JSON.",
"invalidHttpVerb": "httpVerb cannot be set to an empty or null string.",
"nullWebRequest": "Cannot call executeRequest with a null webRequest.",
"eventHandlerInvalid": "Handler was not added through the Sys.UI.DomEvent.addHandler method.",
"cannotSerializeNonFiniteNumbers": "Cannot serialize non finite numbers.",
"argumentUndefined": "Value cannot be undefined.",
"webServiceInvalidReturnType": "The server method \u0027{0}\u0027 returned an invalid type. Expected type: {1}",
"servicePathNotSet": "The path to the web service has not been set.",
"argumentTypeWithTypes": "Object of type \u0027{0}\u0027 cannot be converted to type \u0027{1}\u0027.",
"cannotCallOnceStarted": "Cannot call {0} once started.",
"badBaseUrl1": "Base URL does not contain ://.",
"badBaseUrl2": "Base URL does not contain another /.",
"badBaseUrl3": "Cannot find last / in base URL.",
"setExecutorAfterActive": "Cannot set executor after it has become active.",
"paramName": "Parameter name: {0}",
"nullReferenceInPath": "Null reference while evaluating data path: \u0027{0}\u0027.",
"cannotCallOutsideHandler": "Cannot call {0} outside of a completed event handler.",
"cannotSerializeObjectWithCycle": "Cannot serialize object with cyclic reference within child properties.",
"format": "One of the identified items was in an invalid format.",
"assertFailedCaller": "Assertion Failed: {0}\r\nat {1}",
"argumentOutOfRange": "Specified argument was out of the range of valid values.",
"webServiceTimedOut": "The server method \u0027{0}\u0027 timed out.",
"notImplemented": "The method or operation is not implemented.",
"assertFailed": "Assertion Failed: {0}",
"invalidOperation": "Operation is not valid due to the current state of the object.",
"breakIntoDebugger": "{0}\r\n\r\nBreak into debugger?"
};
/* END MicrosoftAjax.js */
/* START MicrosoftAjaxWebForms.js */
//----------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------
// MicrosoftAjaxWebForms.js
Type._registerScript("MicrosoftAjaxWebForms.js", ["MicrosoftAjaxCore.js", "MicrosoftAjaxSerialization.js", "MicrosoftAjaxNetwork.js", "MicrosoftAjaxComponentModel.js"]);
Type.registerNamespace("Sys.WebForms");
Sys.WebForms.BeginRequestEventArgs = function (c, b, a) {
Sys.WebForms.BeginRequestEventArgs.initializeBase(this);
this._request = c;
this._postBackElement = b;
this._updatePanelsToUpdate = a
};
Sys.WebForms.BeginRequestEventArgs.prototype = {
get_postBackElement: function () {
return this._postBackElement
}, get_request: function () {
return this._request
}, get_updatePanelsToUpdate: function () {
return this._updatePanelsToUpdate ? Array.clone(this._updatePanelsToUpdate) : []
}
};
Sys.WebForms.BeginRequestEventArgs.registerClass("Sys.WebForms.BeginRequestEventArgs", Sys.EventArgs);
Sys.WebForms.EndRequestEventArgs = function (c, a, b) {
Sys.WebForms.EndRequestEventArgs.initializeBase(this);
this._errorHandled = false;
this._error = c;
this._dataItems = a || {};
this._response = b
};
Sys.WebForms.EndRequestEventArgs.prototype = {
get_dataItems: function () {
return this._dataItems
}, get_error: function () {
return this._error
}, get_errorHandled: function () {
return this._errorHandled
}, set_errorHandled: function (a) {
this._errorHandled = a
}, get_response: function () {
return this._response
}
};
Sys.WebForms.EndRequestEventArgs.registerClass("Sys.WebForms.EndRequestEventArgs", Sys.EventArgs);
Sys.WebForms.InitializeRequestEventArgs = function (c, b, a) {
Sys.WebForms.InitializeRequestEventArgs.initializeBase(this);
this._request = c;
this._postBackElement = b;
this._updatePanelsToUpdate = a
};
Sys.WebForms.InitializeRequestEventArgs.prototype = {
get_postBackElement: function () {
return this._postBackElement
}, get_request: function () {
return this._request
}, get_updatePanelsToUpdate: function () {
return this._updatePanelsToUpdate ? Array.clone(this._updatePanelsToUpdate) : []
}, set_updatePanelsToUpdate: function (a) {
this._updated = true;
this._updatePanelsToUpdate = a
}
};
Sys.WebForms.InitializeRequestEventArgs.registerClass("Sys.WebForms.InitializeRequestEventArgs", Sys.CancelEventArgs);
Sys.WebForms.PageLoadedEventArgs = function (b, a, c) {
Sys.WebForms.PageLoadedEventArgs.initializeBase(this);
this._panelsUpdated = b;
this._panelsCreated = a;
this._dataItems = c || {}
};
Sys.WebForms.PageLoadedEventArgs.prototype = {
get_dataItems: function () {
return this._dataItems
}, get_panelsCreated: function () {
return this._panelsCreated
}, get_panelsUpdated: function () {
return this._panelsUpdated
}
};
Sys.WebForms.PageLoadedEventArgs.registerClass("Sys.WebForms.PageLoadedEventArgs", Sys.EventArgs);
Sys.WebForms.PageLoadingEventArgs = function (b, a, c) {
Sys.WebForms.PageLoadingEventArgs.initializeBase(this);
this._panelsUpdating = b;
this._panelsDeleting = a;
this._dataItems = c || {}
};
Sys.WebForms.PageLoadingEventArgs.prototype = {
get_dataItems: function () {
return this._dataItems
}, get_panelsDeleting: function () {
return this._panelsDeleting
}, get_panelsUpdating: function () {
return this._panelsUpdating
}
};
Sys.WebForms.PageLoadingEventArgs.registerClass("Sys.WebForms.PageLoadingEventArgs", Sys.EventArgs);
Sys._ScriptLoader = function () {
this._scriptsToLoad = null;
this._sessions = [];
this._scriptLoadedDelegate = Function.createDelegate(this, this._scriptLoadedHandler)
};
Sys._ScriptLoader.prototype = {
dispose: function () {
this._stopSession();
this._loading = false;
if (this._events)delete this._events;
this._sessions = null;
this._currentSession = null;
this._scriptLoadedDelegate = null
}, loadScripts: function (d, b, c, a) {
var e = {
allScriptsLoadedCallback: b,
scriptLoadFailedCallback: c,
scriptLoadTimeoutCallback: a,
scriptsToLoad: this._scriptsToLoad,
scriptTimeout: d
};
this._scriptsToLoad = null;
this._sessions[this._sessions.length] = e;
if (!this._loading)this._nextSession()
}, queueCustomScriptTag: function (a) {
if (!this._scriptsToLoad)this._scriptsToLoad = [];
Array.add(this._scriptsToLoad, a)
}, queueScriptBlock: function (a) {
if (!this._scriptsToLoad)this._scriptsToLoad = [];
Array.add(this._scriptsToLoad, {text: a})
}, queueScriptReference: function (a, b) {
if (!this._scriptsToLoad)this._scriptsToLoad = [];
Array.add(this._scriptsToLoad, {src: a, fallback: b})
}, _createScriptElement: function (c) {
var a = document.createElement("script");
a.type = "text/javascript";
for (var b in c)a[b] = c[b];
return a
}, _loadScriptsInternal: function () {
var c = this._currentSession;
if (c.scriptsToLoad && c.scriptsToLoad.length > 0) {
var b = Array.dequeue(c.scriptsToLoad), f = this._scriptLoadedDelegate;
if (b.fallback) {
var g = b.fallback;
delete b.fallback;
var d = this;
f = function (b, a) {
a || function () {
var a = d._createScriptElement({src: g});
d._currentTask = new Sys._ScriptLoaderTask(a, d._scriptLoadedDelegate);
d._currentTask.execute()
}()
}
}
var a = this._createScriptElement(b);
if (a.text && Sys.Browser.agent === Sys.Browser.Safari) {
a.innerHTML = a.text;
delete a.text
}
if (typeof b.src === "string") {
this._currentTask = new Sys._ScriptLoaderTask(a, f);
this._currentTask.execute()
} else {
document.getElementsByTagName("head")[0].appendChild(a);
Sys._ScriptLoaderTask._clearScript(a);
this._loadScriptsInternal()
}
} else {
this._stopSession();
var e = c.allScriptsLoadedCallback;
if (e)e(this);
this._nextSession()
}
}, _nextSession: function () {
if (this._sessions.length === 0) {
this._loading = false;
this._currentSession = null;
return
}
this._loading = true;
var a = Array.dequeue(this._sessions);
this._currentSession = a;
if (a.scriptTimeout > 0)this._timeoutCookie = window.setTimeout(Function.createDelegate(this, this._scriptLoadTimeoutHandler), a.scriptTimeout * 1000);
this._loadScriptsInternal()
}, _raiseError: function () {
var b = this._currentSession.scriptLoadFailedCallback, a = this._currentTask.get_scriptElement();
this._stopSession();
if (b) {
b(this, a);
this._nextSession()
} else {
this._loading = false;
throw Sys._ScriptLoader._errorScriptLoadFailed(a.src)
}
}, _scriptLoadedHandler: function (a, b) {
if (b) {
Array.add(Sys._ScriptLoader._getLoadedScripts(), a.src);
this._currentTask.dispose();
this._currentTask = null;
this._loadScriptsInternal()
} else this._raiseError()
}, _scriptLoadTimeoutHandler: function () {
var a = this._currentSession.scriptLoadTimeoutCallback;
this._stopSession();
if (a)a(this);
this._nextSession()
}, _stopSession: function () {
if (this._timeoutCookie) {
window.clearTimeout(this._timeoutCookie);
this._timeoutCookie = null
}
if (this._currentTask) {
this._currentTask.dispose();
this._currentTask = null
}
}
};
Sys._ScriptLoader.registerClass("Sys._ScriptLoader", null, Sys.IDisposable);
Sys._ScriptLoader.getInstance = function () {
var a = Sys._ScriptLoader._activeInstance;
if (!a)a = Sys._ScriptLoader._activeInstance = new Sys._ScriptLoader;
return a
};
Sys._ScriptLoader.isScriptLoaded = function (b) {
var a = document.createElement("script");
a.src = b;
return Array.contains(Sys._ScriptLoader._getLoadedScripts(), a.src)
};
Sys._ScriptLoader.readLoadedScripts = function () {
if (!Sys._ScriptLoader._referencedScripts) {
var c = Sys._ScriptLoader._referencedScripts = [], d = document.getElementsByTagName("script");
for (var b = d.length - 1; b >= 0; b--) {
var e = d[b], a = e.src;
if (a.length)if (!Array.contains(c, a))Array.add(c, a)
}
}
};
Sys._ScriptLoader._errorScriptLoadFailed = function (b) {
var a;
a = Sys.Res.scriptLoadFailed;
var d = "Sys.ScriptLoadFailedException: " + String.format(a, b), c = Error.create(d, {
name: "Sys.ScriptLoadFailedException",
"scriptUrl": b
});
c.popStackFrame();
return c
};
Sys._ScriptLoader._getLoadedScripts = function () {
if (!Sys._ScriptLoader._referencedScripts) {
Sys._ScriptLoader._referencedScripts = [];
Sys._ScriptLoader.readLoadedScripts()
}
return Sys._ScriptLoader._referencedScripts
};
Sys.WebForms.PageRequestManager = function () {
this._form = null;
this._activeDefaultButton = null;
this._activeDefaultButtonClicked = false;
this._updatePanelIDs = null;
this._updatePanelClientIDs = null;
this._updatePanelHasChildrenAsTriggers = null;
this._asyncPostBackControlIDs = null;
this._asyncPostBackControlClientIDs = null;
this._postBackControlIDs = null;
this._postBackControlClientIDs = null;
this._scriptManagerID = null;
this._pageLoadedHandler = null;
this._additionalInput = null;
this._onsubmit = null;
this._onSubmitStatements = [];
this._originalDoPostBack = null;
this._originalDoPostBackWithOptions = null;
this._originalFireDefaultButton = null;
this._originalDoCallback = null;
this._isCrossPost = false;
this._postBackSettings = null;
this._request = null;
this._onFormSubmitHandler = null;
this._onFormElementClickHandler = null;
this._onWindowUnloadHandler = null;
this._asyncPostBackTimeout = null;
this._controlIDToFocus = null;
this._scrollPosition = null;
this._processingRequest = false;
this._scriptDisposes = {};
this._transientFields = ["__VIEWSTATEENCRYPTED", "__VIEWSTATEFIELDCOUNT"];
this._textTypes = /^(text|password|hidden|search|tel|url|email|number|range|color|datetime|date|month|week|time|datetime-local)$/i
};
Sys.WebForms.PageRequestManager.prototype = {
_get_eventHandlerList: function () {
if (!this._events)this._events = new Sys.EventHandlerList;
return this._events
}, get_isInAsyncPostBack: function () {
return this._request !== null
}, add_beginRequest: function (a) {
this._get_eventHandlerList().addHandler("beginRequest", a)
}, remove_beginRequest: function (a) {
this._get_eventHandlerList().removeHandler("beginRequest", a)
}, add_endRequest: function (a) {
this._get_eventHandlerList().addHandler("endRequest", a)
}, remove_endRequest: function (a) {
this._get_eventHandlerList().removeHandler("endRequest", a)
}, add_initializeRequest: function (a) {
this._get_eventHandlerList().addHandler("initializeRequest", a)
}, remove_initializeRequest: function (a) {
this._get_eventHandlerList().removeHandler("initializeRequest", a)
}, add_pageLoaded: function (a) {
this._get_eventHandlerList().addHandler("pageLoaded", a)
}, remove_pageLoaded: function (a) {
this._get_eventHandlerList().removeHandler("pageLoaded", a)
}, add_pageLoading: function (a) {
this._get_eventHandlerList().addHandler("pageLoading", a)
}, remove_pageLoading: function (a) {
this._get_eventHandlerList().removeHandler("pageLoading", a)
}, abortPostBack: function () {
if (!this._processingRequest && this._request) {
this._request.get_executor().abort();
this._request = null
}
}, beginAsyncPostBack: function (c, a, f, d, e) {
if (d && typeof Page_ClientValidate === "function" && !Page_ClientValidate(e || null))return;
this._postBackSettings = this._createPostBackSettings(true, c, a);
var b = this._form;
b.__EVENTTARGET.value = a || "";
b.__EVENTARGUMENT.value = f || "";
this._isCrossPost = false;
this._additionalInput = null;
this._onFormSubmit()
}, _cancelPendingCallbacks: function () {
for (var a = 0, e = window.__pendingCallbacks.length; a < e; a++) {
var c = window.__pendingCallbacks[a];
if (c) {
if (!c.async)window.__synchronousCallBackIndex = -1;
window.__pendingCallbacks[a] = null;
var d = "__CALLBACKFRAME" + a, b = document.getElementById(d);
if (b)b.parentNode.removeChild(b)
}
}
}, _commitControls: function (a, b) {
if (a) {
this._updatePanelIDs = a.updatePanelIDs;
this._updatePanelClientIDs = a.updatePanelClientIDs;
this._updatePanelHasChildrenAsTriggers = a.updatePanelHasChildrenAsTriggers;
this._asyncPostBackControlIDs = a.asyncPostBackControlIDs;
this._asyncPostBackControlClientIDs = a.asyncPostBackControlClientIDs;
this._postBackControlIDs = a.postBackControlIDs;
this._postBackControlClientIDs = a.postBackControlClientIDs
}
if (typeof b !== "undefined" && b !== null)this._asyncPostBackTimeout = b * 1000
}, _createHiddenField: function (c, d) {
var b, a = document.getElementById(c);
if (a)if (!a._isContained)a.parentNode.removeChild(a); else b = a.parentNode;
if (!b) {
b = document.createElement("span");
b.style.cssText = "display:none !important";
this._form.appendChild(b)
}
b.innerHTML = "<input type='hidden' />";
a = b.childNodes[0];
a._isContained = true;
a.id = a.name = c;
a.value = d
}, _createPageRequestManagerTimeoutError: function () {
var b = "Sys.WebForms.PageRequestManagerTimeoutException: " + Sys.WebForms.Res.PRM_TimeoutError, a = Error.create(b, {name: "Sys.WebForms.PageRequestManagerTimeoutException"});
a.popStackFrame();
return a
}, _createPageRequestManagerServerError: function (a, d) {
var c = "Sys.WebForms.PageRequestManagerServerErrorException: " + (d || String.format(Sys.WebForms.Res.PRM_ServerError, a)), b = Error.create(c, {
name: "Sys.WebForms.PageRequestManagerServerErrorException",
httpStatusCode: a
});
b.popStackFrame();
return b
}, _createPageRequestManagerParserError: function (b) {
var c = "Sys.WebForms.PageRequestManagerParserErrorException: " + String.format(Sys.WebForms.Res.PRM_ParserError, b), a = Error.create(c, {name: "Sys.WebForms.PageRequestManagerParserErrorException"});
a.popStackFrame();
return a
}, _createPanelID: function (e, b) {
var c = b.asyncTarget, a = this._ensureUniqueIds(e || b.panelsToUpdate), d = a instanceof Array ? a.join(",") : a || this._scriptManagerID;
if (c)d += "|" + c;
return encodeURIComponent(this._scriptManagerID) + "=" + encodeURIComponent(d) + "&"
}, _createPostBackSettings: function (d, a, c, b) {
return {async: d, asyncTarget: c, panelsToUpdate: a, sourceElement: b}
}, _convertToClientIDs: function (a, f, e, d) {
if (a)for (var b = 0, h = a.length; b < h; b += d ? 2 : 1) {
var c = a[b], g = (d ? a[b + 1] : "") || this._uniqueIDToClientID(c);
Array.add(f, c);
Array.add(e, g)
}
}, dispose: function () {
if (this._form) {
Sys.UI.DomEvent.removeHandler(this._form, "submit", this._onFormSubmitHandler);
Sys.UI.DomEvent.removeHandler(this._form, "click", this._onFormElementClickHandler);
Sys.UI.DomEvent.removeHandler(window, "unload", this._onWindowUnloadHandler);
Sys.UI.DomEvent.removeHandler(window, "load", this._pageLoadedHandler)
}
if (this._originalDoPostBack) {
window.__doPostBack = this._originalDoPostBack;
this._originalDoPostBack = null
}
if (this._originalDoPostBackWithOptions) {
window.WebForm_DoPostBackWithOptions = this._originalDoPostBackWithOptions;
this._originalDoPostBackWithOptions = null
}
if (this._originalFireDefaultButton) {
window.WebForm_FireDefaultButton = this._originalFireDefaultButton;
this._originalFireDefaultButton = null
}
if (this._originalDoCallback) {
window.WebForm_DoCallback = this._originalDoCallback;
this._originalDoCallback = null
}
this._form = null;
this._updatePanelIDs = null;
this._updatePanelClientIDs = null;
this._asyncPostBackControlIDs = null;
this._asyncPostBackControlClientIDs = null;
this._postBackControlIDs = null;
this._postBackControlClientIDs = null;
this._asyncPostBackTimeout = null;
this._scrollPosition = null;
this._activeElement = null
}, _doCallback: function (d, b, c, f, a, e) {
if (!this.get_isInAsyncPostBack())this._originalDoCallback(d, b, c, f, a, e)
}, _doPostBack: function (a, k) {
var f = window.event;
if (!f) {
var d = arguments.callee ? arguments.callee.caller : null;
if (d) {
var j = 30;
while (d.arguments.callee.caller && --j)d = d.arguments.callee.caller;
f = j && d.arguments.length ? d.arguments[0] : null
}
}
this._additionalInput = null;
var h = this._form;
if (a === null || typeof a === "undefined" || this._isCrossPost) {
this._postBackSettings = this._createPostBackSettings(false);
this._isCrossPost = false
} else {
var c = this._masterPageUniqueID, l = this._uniqueIDToClientID(a), g = document.getElementById(l);
if (!g && c)if (a.indexOf(c + "$") === 0)g = document.getElementById(l.substr(c.length + 1));
if (!g)if (Array.contains(this._asyncPostBackControlIDs, a))this._postBackSettings = this._createPostBackSettings(true, null, a); else if (Array.contains(this._postBackControlIDs, a))this._postBackSettings = this._createPostBackSettings(false); else {
var e = this._findNearestElement(a);
if (e)this._postBackSettings = this._getPostBackSettings(e, a); else {
if (c) {
c += "$";
if (a.indexOf(c) === 0)e = this._findNearestElement(a.substr(c.length))
}
if (e)this._postBackSettings = this._getPostBackSettings(e, a); else {
var b;
try {
b = f ? f.target || f.srcElement : null
} catch (n) {
}
b = b || this._activeElement;
var m = /__doPostBack\(|WebForm_DoPostBackWithOptions\(/;
function i(b) {
b = b ? b.toString() : "";
return m.test(b) && b.indexOf("'" + a + "'") !== -1 || b.indexOf('"' + a + '"') !== -1
}
if (b && (b.name === a || i(b.href) || i(b.onclick) || i(b.onchange)))this._postBackSettings = this._getPostBackSettings(b, a); else this._postBackSettings = this._createPostBackSettings(false)
}
}
} else this._postBackSettings = this._getPostBackSettings(g, a)
}
if (!this._postBackSettings.async) {
h.onsubmit = this._onsubmit;
this._originalDoPostBack(a, k);
h.onsubmit = null;
return
}
h.__EVENTTARGET.value = a;
h.__EVENTARGUMENT.value = k;
this._onFormSubmit()
}, _doPostBackWithOptions: function (a) {
this._isCrossPost = a && a.actionUrl;
var d = true;
if (a.validation)if (typeof Page_ClientValidate == "function")d = Page_ClientValidate(a.validationGroup);
if (d) {
if (typeof a.actionUrl != "undefined" && a.actionUrl != null && a.actionUrl.length > 0)theForm.action = a.actionUrl;
if (a.trackFocus) {
var c = theForm.elements["__LASTFOCUS"];
if (typeof c != "undefined" && c != null)if (typeof document.activeElement == "undefined")c.value = a.eventTarget; else {
var b = document.activeElement;
if (typeof b != "undefined" && b != null)if (typeof b.id != "undefined" && b.id != null && b.id.length > 0)c.value = b.id; else if (typeof b.name != "undefined")c.value = b.name
}
}
}
if (a.clientSubmit)this._doPostBack(a.eventTarget, a.eventArgument)
}, _elementContains: function (b, a) {
while (a) {
if (a === b)return true;
a = a.parentNode
}
return false
}, _endPostBack: function (a, d, f) {
if (this._request === d.get_webRequest()) {
this._processingRequest = false;
this._additionalInput = null;
this._request = null
}
var e = this._get_eventHandlerList().getHandler("endRequest"), b = false;
if (e) {
var c = new Sys.WebForms.EndRequestEventArgs(a, f ? f.dataItems : {}, d);
e(this, c);
b = c.get_errorHandled()
}
if (a && !b)throw a
}, _ensureUniqueIds: function (a) {
if (!a)return a;
a = a instanceof Array ? a : [a];
var c = [];
for (var b = 0, f = a.length; b < f; b++) {
var e = a[b], d = Array.indexOf(this._updatePanelClientIDs, e);
c.push(d > -1 ? this._updatePanelIDs[d] : e)
}
return c
}, _findNearestElement: function (a) {
while (a.length > 0) {
var d = this._uniqueIDToClientID(a), c = document.getElementById(d);
if (c)return c;
var b = a.lastIndexOf("$");
if (b === -1)return null;
a = a.substring(0, b)
}
return null
}, _findText: function (b, a) {
var c = Math.max(0, a - 20), d = Math.min(b.length, a + 20);
return b.substring(c, d)
}, _fireDefaultButton: function (a, d) {
if (a.keyCode === 13) {
var c = a.srcElement || a.target;
if (!c || c.tagName.toLowerCase() !== "textarea") {
var b = document.getElementById(d);
if (b && typeof b.click !== "undefined") {
this._activeDefaultButton = b;
this._activeDefaultButtonClicked = false;
try {
b.click()
} finally {
this._activeDefaultButton = null
}
a.cancelBubble = true;
if (typeof a.stopPropagation === "function")a.stopPropagation();
return false
}
}
}
return true
}, _getPageLoadedEventArgs: function (n, c) {
var m = [], l = [], k = c ? c.version4 : false, d = c ? c.updatePanelData : null, e, g, h, b;
if (!d) {
e = this._updatePanelIDs;
g = this._updatePanelClientIDs;
h = null;
b = null
} else {
e = d.updatePanelIDs;
g = d.updatePanelClientIDs;
h = d.childUpdatePanelIDs;
b = d.panelsToRefreshIDs
}
var a, f, j, i;
if (b)for (a = 0, f = b.length; a < f; a += k ? 2 : 1) {
j = b[a];
i = (k ? b[a + 1] : "") || this._uniqueIDToClientID(j);
Array.add(m, document.getElementById(i))
}
for (a = 0, f = e.length; a < f; a++)if (n || Array.indexOf(h, e[a]) !== -1)Array.add(l, document.getElementById(g[a]));
return new Sys.WebForms.PageLoadedEventArgs(m, l, c ? c.dataItems : {})
}, _getPageLoadingEventArgs: function (f) {
var j = [], i = [], c = f.updatePanelData, k = c.oldUpdatePanelIDs, l = c.oldUpdatePanelClientIDs, n = c.updatePanelIDs, m = c.childUpdatePanelIDs, d = c.panelsToRefreshIDs, a, e, b, g, h = f.version4;
for (a = 0, e = d.length; a < e; a += h ? 2 : 1) {
b = d[a];
g = (h ? d[a + 1] : "") || this._uniqueIDToClientID(b);
Array.add(j, document.getElementById(g))
}
for (a = 0, e = k.length; a < e; a++) {
b = k[a];
if (Array.indexOf(d, b) === -1 && (Array.indexOf(n, b) === -1 || Array.indexOf(m, b) > -1))Array.add(i, document.getElementById(l[a]))
}
return new Sys.WebForms.PageLoadingEventArgs(j, i, f.dataItems)
}, _getPostBackSettings: function (a, c) {
var d = a, b = null;
while (a) {
if (a.id) {
if (!b && Array.contains(this._asyncPostBackControlClientIDs, a.id))b = this._createPostBackSettings(true, null, c, d); else if (!b && Array.contains(this._postBackControlClientIDs, a.id))return this._createPostBackSettings(false); else {
var e = Array.indexOf(this._updatePanelClientIDs, a.id);
if (e !== -1)if (this._updatePanelHasChildrenAsTriggers[e])return this._createPostBackSettings(true, [this._updatePanelIDs[e]], c, d); else return this._createPostBackSettings(true, null, c, d)
}
if (!b && this._matchesParentIDInList(a.id, this._asyncPostBackControlClientIDs))b = this._createPostBackSettings(true, null, c, d); else if (!b && this._matchesParentIDInList(a.id, this._postBackControlClientIDs))return this._createPostBackSettings(false)
}
a = a.parentNode
}
if (!b)return this._createPostBackSettings(false); else return b
}, _getScrollPosition: function () {
var a = document.documentElement;
if (a && (this._validPosition(a.scrollLeft) || this._validPosition(a.scrollTop)))return {
x: a.scrollLeft,
y: a.scrollTop
}; else {
a = document.body;
if (a && (this._validPosition(a.scrollLeft) || this._validPosition(a.scrollTop)))return {
x: a.scrollLeft,
y: a.scrollTop
}; else if (this._validPosition(window.pageXOffset) || this._validPosition(window.pageYOffset))return {
x: window.pageXOffset,
y: window.pageYOffset
}; else return {x: 0, y: 0}
}
}, _initializeInternal: function (f, g, a, b, e, c, d) {
if (this._prmInitialized)throw Error.invalidOperation(Sys.WebForms.Res.PRM_CannotRegisterTwice);
this._prmInitialized = true;
this._masterPageUniqueID = d;
this._scriptManagerID = f;
this._form = Sys.UI.DomElement.resolveElement(g);
this._onsubmit = this._form.onsubmit;
this._form.onsubmit = null;
this._onFormSubmitHandler = Function.createDelegate(this, this._onFormSubmit);
this._onFormElementClickHandler = Function.createDelegate(this, this._onFormElementClick);
this._onWindowUnloadHandler = Function.createDelegate(this, this._onWindowUnload);
Sys.UI.DomEvent.addHandler(this._form, "submit", this._onFormSubmitHandler);
Sys.UI.DomEvent.addHandler(this._form, "click", this._onFormElementClickHandler);
Sys.UI.DomEvent.addHandler(window, "unload", this._onWindowUnloadHandler);
this._originalDoPostBack = window.__doPostBack;
if (this._originalDoPostBack)window.__doPostBack = Function.createDelegate(this, this._doPostBack);
this._originalDoPostBackWithOptions = window.WebForm_DoPostBackWithOptions;
if (this._originalDoPostBackWithOptions)window.WebForm_DoPostBackWithOptions = Function.createDelegate(this, this._doPostBackWithOptions);
this._originalFireDefaultButton = window.WebForm_FireDefaultButton;
if (this._originalFireDefaultButton)window.WebForm_FireDefaultButton = Function.createDelegate(this, this._fireDefaultButton);
this._originalDoCallback = window.WebForm_DoCallback;
if (this._originalDoCallback)window.WebForm_DoCallback = Function.createDelegate(this, this._doCallback);
this._pageLoadedHandler = Function.createDelegate(this, this._pageLoadedInitialLoad);
Sys.UI.DomEvent.addHandler(window, "load", this._pageLoadedHandler);
if (a)this._updateControls(a, b, e, c, true)
}, _matchesParentIDInList: function (c, b) {
for (var a = 0, d = b.length; a < d; a++)if (c.startsWith(b[a] + "_"))return true;
return false
}, _onFormElementActive: function (a, d, e) {
if (a.disabled)return;
this._activeElement = a;
this._postBackSettings = this._getPostBackSettings(a, a.name);
if (a.name) {
var b = a.tagName.toUpperCase();
if (b === "INPUT") {
var c = a.type;
if (c === "submit")this._additionalInput = encodeURIComponent(a.name) + "=" + encodeURIComponent(a.value); else if (c === "image")this._additionalInput = encodeURIComponent(a.name) + ".x=" + d + "&" + encodeURIComponent(a.name) + ".y=" + e
} else if (b === "BUTTON" && a.name.length !== 0 && a.type === "submit")this._additionalInput = encodeURIComponent(a.name) + "=" + encodeURIComponent(a.value)
}
}, _onFormElementClick: function (a) {
this._activeDefaultButtonClicked = a.target === this._activeDefaultButton;
this._onFormElementActive(a.target, a.offsetX, a.offsetY)
}, _onFormSubmit: function (i) {
var f, x, h = true, z = this._isCrossPost;
this._isCrossPost = false;
if (this._onsubmit)h = this._onsubmit();
if (h)for (f = 0, x = this._onSubmitStatements.length; f < x; f++)if (!this._onSubmitStatements[f]()) {
h = false;
break
}
if (!h) {
if (i)i.preventDefault();
return
}
var w = this._form;
if (z)return;
if (this._activeDefaultButton && !this._activeDefaultButtonClicked)this._onFormElementActive(this._activeDefaultButton, 0, 0);
if (!this._postBackSettings || !this._postBackSettings.async)return;
var b = new Sys.StringBuilder, s = w.elements, B = s.length, t = this._createPanelID(null, this._postBackSettings);
b.append(t);
for (f = 0; f < B; f++) {
var e = s[f], g = e.name;
if (typeof g === "undefined" || g === null || g.length === 0 || g === this._scriptManagerID)continue;
var n = e.tagName.toUpperCase();
if (n === "INPUT") {
var p = e.type;
if (this._textTypes.test(p) || (p === "checkbox" || p === "radio") && e.checked) {
b.append(encodeURIComponent(g));
b.append("=");
b.append(encodeURIComponent(e.value));
b.append("&")
}
} else if (n === "SELECT") {
var A = e.options.length;
for (var q = 0; q < A; q++) {
var u = e.options[q];
if (u.selected) {
b.append(encodeURIComponent(g));
b.append("=");
b.append(encodeURIComponent(u.value));
b.append("&")
}
}
} else if (n === "TEXTAREA") {
b.append(encodeURIComponent(g));
b.append("=");
b.append(encodeURIComponent(e.value));
b.append("&")
}
}
b.append("__ASYNCPOST=true&");
if (this._additionalInput) {
b.append(this._additionalInput);
this._additionalInput = null
}
var c = new Sys.Net.WebRequest, a = w.action;
if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
var r = a.indexOf("#");
if (r !== -1)a = a.substr(0, r);
var o = "", v = "", m = a.indexOf("?");
if (m !== -1) {
v = a.substr(m);
a = a.substr(0, m)
}
if (/^https?\:\/\/.*$/gi.test(a)) {
var y = a.indexOf("//") + 2, l = a.indexOf("/", y);
if (l === -1) {
o = a;
a = ""
} else {
o = a.substr(0, l);
a = a.substr(l)
}
}
a = o + encodeURI(decodeURI(a)) + v
}
c.set_url(a);
c.get_headers()["X-MicrosoftAjax"] = "Delta=true";
c.get_headers()["Cache-Control"] = "no-cache";
c.set_timeout(this._asyncPostBackTimeout);
c.add_completed(Function.createDelegate(this, this._onFormSubmitCompleted));
c.set_body(b.toString());
var j, d, k = this._get_eventHandlerList().getHandler("initializeRequest");
if (k) {
j = this._postBackSettings.panelsToUpdate;
d = new Sys.WebForms.InitializeRequestEventArgs(c, this._postBackSettings.sourceElement, j);
k(this, d);
h = !d.get_cancel()
}
if (!h) {
if (i)i.preventDefault();
return
}
if (d && d._updated) {
j = d.get_updatePanelsToUpdate();
c.set_body(c.get_body().replace(t, this._createPanelID(j, this._postBackSettings)))
}
this._scrollPosition = this._getScrollPosition();
this.abortPostBack();
k = this._get_eventHandlerList().getHandler("beginRequest");
if (k) {
d = new Sys.WebForms.BeginRequestEventArgs(c, this._postBackSettings.sourceElement, j || this._postBackSettings.panelsToUpdate);
k(this, d)
}
if (this._originalDoCallback)this._cancelPendingCallbacks();
this._request = c;
this._processingRequest = false;
c.invoke();
if (i)i.preventDefault()
}, _onFormSubmitCompleted: function (c) {
this._processingRequest = true;
if (c.get_timedOut()) {
this._endPostBack(this._createPageRequestManagerTimeoutError(), c, null);
return
}
if (c.get_aborted()) {
this._endPostBack(null, c, null);
return
}
if (!this._request || c.get_webRequest() !== this._request)return;
if (c.get_statusCode() !== 200) {
this._endPostBack(this._createPageRequestManagerServerError(c.get_statusCode()), c, null);
return
}
var a = this._parseDelta(c);
if (!a)return;
var b, e;
if (a.asyncPostBackControlIDsNode && a.postBackControlIDsNode && a.updatePanelIDsNode && a.panelsToRefreshNode && a.childUpdatePanelIDsNode) {
var r = this._updatePanelIDs, n = this._updatePanelClientIDs, i = a.childUpdatePanelIDsNode.content, p = i.length ? i.split(",") : [], m = this._splitNodeIntoArray(a.asyncPostBackControlIDsNode), o = this._splitNodeIntoArray(a.postBackControlIDsNode), q = this._splitNodeIntoArray(a.updatePanelIDsNode), g = this._splitNodeIntoArray(a.panelsToRefreshNode), h = a.version4;
for (b = 0, e = g.length; b < e; b += h ? 2 : 1) {
var j = (h ? g[b + 1] : "") || this._uniqueIDToClientID(g[b]);
if (!document.getElementById(j)) {
this._endPostBack(Error.invalidOperation(String.format(Sys.WebForms.Res.PRM_MissingPanel, j)), c, a);
return
}
}
var f = this._processUpdatePanelArrays(q, m, o, h);
f.oldUpdatePanelIDs = r;
f.oldUpdatePanelClientIDs = n;
f.childUpdatePanelIDs = p;
f.panelsToRefreshIDs = g;
a.updatePanelData = f
}
a.dataItems = {};
var d;
for (b = 0, e = a.dataItemNodes.length; b < e; b++) {
d = a.dataItemNodes[b];
a.dataItems[d.id] = d.content
}
for (b = 0, e = a.dataItemJsonNodes.length; b < e; b++) {
d = a.dataItemJsonNodes[b];
a.dataItems[d.id] = Sys.Serialization.JavaScriptSerializer.deserialize(d.content)
}
var l = this._get_eventHandlerList().getHandler("pageLoading");
if (l)l(this, this._getPageLoadingEventArgs(a));
Sys._ScriptLoader.readLoadedScripts();
Sys.Application.beginCreateComponents();
var k = Sys._ScriptLoader.getInstance();
this._queueScripts(k, a.scriptBlockNodes, true, false);
this._processingRequest = true;
k.loadScripts(0, Function.createDelegate(this, Function.createCallback(this._scriptIncludesLoadComplete, a)), Function.createDelegate(this, Function.createCallback(this._scriptIncludesLoadFailed, a)), null)
}, _onWindowUnload: function () {
this.dispose()
}, _pageLoaded: function (a, c) {
var b = this._get_eventHandlerList().getHandler("pageLoaded");
if (b)b(this, this._getPageLoadedEventArgs(a, c));
if (!a)Sys.Application.raiseLoad()
}, _pageLoadedInitialLoad: function () {
this._pageLoaded(true, null)
}, _parseDelta: function (h) {
var c = h.get_responseData(), d, i, E, F, D, b = 0, e = null, k = [];
while (b < c.length) {
d = c.indexOf("|", b);
if (d === -1) {
e = this._findText(c, b);
break
}
i = parseInt(c.substring(b, d), 10);
if (i % 1 !== 0) {
e = this._findText(c, b);
break
}
b = d + 1;
d = c.indexOf("|", b);
if (d === -1) {
e = this._findText(c, b);
break
}
E = c.substring(b, d);
b = d + 1;
d = c.indexOf("|", b);
if (d === -1) {
e = this._findText(c, b);
break
}
F = c.substring(b, d);
b = d + 1;
if (b + i >= c.length) {
e = this._findText(c, c.length);
break
}
D = c.substr(b, i);
b += i;
if (c.charAt(b) !== "|") {
e = this._findText(c, b);
break
}
b++;
Array.add(k, {type: E, id: F, content: D})
}
if (e) {
this._endPostBack(this._createPageRequestManagerParserError(String.format(Sys.WebForms.Res.PRM_ParserErrorDetails, e)), h, null);
return null
}
var x = [], w = [], q = [], j = [], t = [], C = [], A = [], z = [], v = [], s = [], m, p, u, n, o, r, y, g;
for (var l = 0, G = k.length; l < G; l++) {
var a = k[l];
switch (a.type) {
case "#":
g = a;
break;
case "updatePanel":
Array.add(x, a);
break;
case "hiddenField":
Array.add(w, a);
break;
case "arrayDeclaration":
Array.add(q, a);
break;
case "scriptBlock":
Array.add(j, a);
break;
case "fallbackScript":
j[j.length - 1].fallback = a.id;
case "scriptStartupBlock":
Array.add(t, a);
break;
case "expando":
Array.add(C, a);
break;
case "onSubmit":
Array.add(A, a);
break;
case "asyncPostBackControlIDs":
m = a;
break;
case "postBackControlIDs":
p = a;
break;
case "updatePanelIDs":
u = a;
break;
case "asyncPostBackTimeout":
n = a;
break;
case "childUpdatePanelIDs":
o = a;
break;
case "panelsToRefreshIDs":
r = a;
break;
case "formAction":
y = a;
break;
case "dataItem":
Array.add(z, a);
break;
case "dataItemJson":
Array.add(v, a);
break;
case "scriptDispose":
Array.add(s, a);
break;
case "pageRedirect":
if (g && parseFloat(g.content) >= 4)a.content = unescape(a.content);
if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
var f = document.createElement("a");
f.style.display = "none";
f.attachEvent("onclick", B);
f.href = a.content;
this._form.parentNode.insertBefore(f, this._form);
f.click();
f.detachEvent("onclick", B);
this._form.parentNode.removeChild(f);
function B(a) {
a.cancelBubble = true
}
} else window.location.href = a.content;
return null;
case "error":
this._endPostBack(this._createPageRequestManagerServerError(Number.parseInvariant(a.id), a.content), h, null);
return null;
case "pageTitle":
document.title = a.content;
break;
case "focus":
this._controlIDToFocus = a.content;
break;
default:
this._endPostBack(this._createPageRequestManagerParserError(String.format(Sys.WebForms.Res.PRM_UnknownToken, a.type)), h, null);
return null
}
}
return {
version4: g ? parseFloat(g.content) >= 4 : false,
executor: h,
updatePanelNodes: x,
hiddenFieldNodes: w,
arrayDeclarationNodes: q,
scriptBlockNodes: j,
scriptStartupNodes: t,
expandoNodes: C,
onSubmitNodes: A,
dataItemNodes: z,
dataItemJsonNodes: v,
scriptDisposeNodes: s,
asyncPostBackControlIDsNode: m,
postBackControlIDsNode: p,
updatePanelIDsNode: u,
asyncPostBackTimeoutNode: n,
childUpdatePanelIDsNode: o,
panelsToRefreshNode: r,
formActionNode: y
}
}, _processUpdatePanelArrays: function (e, q, r, f) {
var d, c, b;
if (e) {
var i = e.length, j = f ? 2 : 1;
d = new Array(i / j);
c = new Array(i / j);
b = new Array(i / j);
for (var g = 0, h = 0; g < i; g += j, h++) {
var p, a = e[g], k = f ? e[g + 1] : "";
p = a.charAt(0) === "t";
a = a.substr(1);
if (!k)k = this._uniqueIDToClientID(a);
b[h] = p;
d[h] = a;
c[h] = k
}
} else {
d = [];
c = [];
b = []
}
var n = [], l = [];
this._convertToClientIDs(q, n, l, f);
var o = [], m = [];
this._convertToClientIDs(r, o, m, f);
return {
updatePanelIDs: d,
updatePanelClientIDs: c,
updatePanelHasChildrenAsTriggers: b,
asyncPostBackControlIDs: n,
asyncPostBackControlClientIDs: l,
postBackControlIDs: o,
postBackControlClientIDs: m
}
}, _queueScripts: function (scriptLoader, scriptBlockNodes, queueIncludes, queueBlocks) {
for (var i = 0, l = scriptBlockNodes.length; i < l; i++) {
var scriptBlockType = scriptBlockNodes[i].id;
switch (scriptBlockType) {
case "ScriptContentNoTags":
if (!queueBlocks)continue;
scriptLoader.queueScriptBlock(scriptBlockNodes[i].content);
break;
case "ScriptContentWithTags":
var scriptTagAttributes;
eval("scriptTagAttributes = " + scriptBlockNodes[i].content);
if (scriptTagAttributes.src) {
if (!queueIncludes || Sys._ScriptLoader.isScriptLoaded(scriptTagAttributes.src))continue
} else if (!queueBlocks)continue;
scriptLoader.queueCustomScriptTag(scriptTagAttributes);
break;
case "ScriptPath":
var script = scriptBlockNodes[i];
if (!queueIncludes || Sys._ScriptLoader.isScriptLoaded(script.content))continue;
scriptLoader.queueScriptReference(script.content, script.fallback)
}
}
}, _registerDisposeScript: function (a, b) {
if (!this._scriptDisposes[a])this._scriptDisposes[a] = [b]; else Array.add(this._scriptDisposes[a], b)
}, _scriptIncludesLoadComplete: function (e, b) {
if (b.executor.get_webRequest() !== this._request)return;
this._commitControls(b.updatePanelData, b.asyncPostBackTimeoutNode ? b.asyncPostBackTimeoutNode.content : null);
if (b.formActionNode)this._form.action = b.formActionNode.content;
var a, d, c;
for (a = 0, d = b.updatePanelNodes.length; a < d; a++) {
c = b.updatePanelNodes[a];
var j = document.getElementById(c.id);
if (!j) {
this._endPostBack(Error.invalidOperation(String.format(Sys.WebForms.Res.PRM_MissingPanel, c.id)), b.executor, b);
return
}
this._updatePanel(j, c.content)
}
for (a = 0, d = b.scriptDisposeNodes.length; a < d; a++) {
c = b.scriptDisposeNodes[a];
this._registerDisposeScript(c.id, c.content)
}
for (a = 0, d = this._transientFields.length; a < d; a++) {
var g = document.getElementById(this._transientFields[a]);
if (g) {
var k = g._isContained ? g.parentNode : g;
k.parentNode.removeChild(k)
}
}
for (a = 0, d = b.hiddenFieldNodes.length; a < d; a++) {
c = b.hiddenFieldNodes[a];
this._createHiddenField(c.id, c.content)
}
if (b.scriptsFailed)throw Sys._ScriptLoader._errorScriptLoadFailed(b.scriptsFailed.src, b.scriptsFailed.multipleCallbacks);
this._queueScripts(e, b.scriptBlockNodes, false, true);
var i = "";
for (a = 0, d = b.arrayDeclarationNodes.length; a < d; a++) {
c = b.arrayDeclarationNodes[a];
i += "Sys.WebForms.PageRequestManager._addArrayElement('" + c.id + "', " + c.content + ");\r\n"
}
var h = "";
for (a = 0, d = b.expandoNodes.length; a < d; a++) {
c = b.expandoNodes[a];
h += c.id + " = " + c.content + "\r\n"
}
if (i.length)e.queueScriptBlock(i);
if (h.length)e.queueScriptBlock(h);
this._queueScripts(e, b.scriptStartupNodes, true, true);
var f = "";
for (a = 0, d = b.onSubmitNodes.length; a < d; a++) {
if (a === 0)f = "Array.add(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, function() {\r\n";
f += b.onSubmitNodes[a].content + "\r\n"
}
if (f.length) {
f += "\r\nreturn true;\r\n});\r\n";
e.queueScriptBlock(f)
}
e.loadScripts(0, Function.createDelegate(this, Function.createCallback(this._scriptsLoadComplete, b)), null, null)
}, _scriptIncludesLoadFailed: function (d, c, b, a) {
a.scriptsFailed = {src: c.src, multipleCallbacks: b};
this._scriptIncludesLoadComplete(d, a)
}, _scriptsLoadComplete: function (f, c) {
var e = c.executor;
if (window.__theFormPostData)window.__theFormPostData = "";
if (window.__theFormPostCollection)window.__theFormPostCollection = [];
if (window.WebForm_InitCallback)window.WebForm_InitCallback();
if (this._scrollPosition) {
if (window.scrollTo)window.scrollTo(this._scrollPosition.x, this._scrollPosition.y);
this._scrollPosition = null
}
Sys.Application.endCreateComponents();
this._pageLoaded(false, c);
this._endPostBack(null, e, c);
if (this._controlIDToFocus) {
var a, d;
if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
var b = $get(this._controlIDToFocus);
a = b;
if (b && !WebForm_CanFocus(b))a = WebForm_FindFirstFocusableChild(b);
if (a && typeof a.contentEditable !== "undefined") {
d = a.contentEditable;
a.contentEditable = false
} else a = null
}
WebForm_AutoFocus(this._controlIDToFocus);
if (a)a.contentEditable = d;
this._controlIDToFocus = null
}
}, _splitNodeIntoArray: function (b) {
var a = b.content, c = a.length ? a.split(",") : [];
return c
}, _uniqueIDToClientID: function (a) {
return a.replace(/\$/g, "_")
}, _updateControls: function (d, a, c, b, e) {
this._commitControls(this._processUpdatePanelArrays(d, a, c, e), b)
}, _updatePanel: function (updatePanelElement, rendering) {
for (var updatePanelID in this._scriptDisposes)if (this._elementContains(updatePanelElement, document.getElementById(updatePanelID))) {
var disposeScripts = this._scriptDisposes[updatePanelID];
for (var i = 0, l = disposeScripts.length; i < l; i++)eval(disposeScripts[i]);
delete this._scriptDisposes[updatePanelID]
}
Sys.Application.disposeElement(updatePanelElement, true);
updatePanelElement.innerHTML = rendering
}, _validPosition: function (a) {
return typeof a !== "undefined" && a !== null && a !== 0
}
};
Sys.WebForms.PageRequestManager.getInstance = function () {
var a = Sys.WebForms.PageRequestManager._instance;
if (!a)a = Sys.WebForms.PageRequestManager._instance = new Sys.WebForms.PageRequestManager;
return a
};
Sys.WebForms.PageRequestManager._addArrayElement = function (a) {
if (!window[a])window[a] = [];
for (var b = 1, c = arguments.length; b < c; b++)Array.add(window[a], arguments[b])
};
Sys.WebForms.PageRequestManager._initialize = function () {
var a = Sys.WebForms.PageRequestManager.getInstance();
a._initializeInternal.apply(a, arguments)
};
Sys.WebForms.PageRequestManager.registerClass("Sys.WebForms.PageRequestManager");
Sys.UI._UpdateProgress = function (a) {
Sys.UI._UpdateProgress.initializeBase(this, [a]);
this._displayAfter = 500;
this._dynamicLayout = true;
this._associatedUpdatePanelId = null;
this._beginRequestHandlerDelegate = null;
this._startDelegate = null;
this._endRequestHandlerDelegate = null;
this._pageRequestManager = null;
this._timerCookie = null
};
Sys.UI._UpdateProgress.prototype = {
get_displayAfter: function () {
return this._displayAfter
}, set_displayAfter: function (a) {
this._displayAfter = a
}, get_dynamicLayout: function () {
return this._dynamicLayout
}, set_dynamicLayout: function (a) {
this._dynamicLayout = a
}, get_associatedUpdatePanelId: function () {
return this._associatedUpdatePanelId
}, set_associatedUpdatePanelId: function (a) {
this._associatedUpdatePanelId = a
}, get_role: function () {
return "status"
}, _clearTimeout: function () {
if (this._timerCookie) {
window.clearTimeout(this._timerCookie);
this._timerCookie = null
}
}, _getUniqueID: function (b) {
var a = Array.indexOf(this._pageRequestManager._updatePanelClientIDs, b);
return a === -1 ? null : this._pageRequestManager._updatePanelIDs[a]
}, _handleBeginRequest: function (f, e) {
var b = e.get_postBackElement(), a = true, d = this._associatedUpdatePanelId;
if (this._associatedUpdatePanelId) {
var c = e.get_updatePanelsToUpdate();
if (c && c.length)a = Array.contains(c, d) || Array.contains(c, this._getUniqueID(d)); else a = false
}
while (!a && b) {
if (b.id && this._associatedUpdatePanelId === b.id)a = true;
b = b.parentNode
}
if (a)this._timerCookie = window.setTimeout(this._startDelegate, this._displayAfter)
}, _startRequest: function () {
if (this._pageRequestManager.get_isInAsyncPostBack()) {
var a = this.get_element();
if (this._dynamicLayout)a.style.display = "block"; else a.style.visibility = "visible";
if (this.get_role() === "status")a.setAttribute("aria-hidden", "false")
}
this._timerCookie = null
}, _handleEndRequest: function () {
var a = this.get_element();
if (this._dynamicLayout)a.style.display = "none"; else a.style.visibility = "hidden";
if (this.get_role() === "status")a.setAttribute("aria-hidden", "true");
this._clearTimeout()
}, dispose: function () {
if (this._beginRequestHandlerDelegate !== null) {
this._pageRequestManager.remove_beginRequest(this._beginRequestHandlerDelegate);
this._pageRequestManager.remove_endRequest(this._endRequestHandlerDelegate);
this._beginRequestHandlerDelegate = null;
this._endRequestHandlerDelegate = null
}
this._clearTimeout();
Sys.UI._UpdateProgress.callBaseMethod(this, "dispose")
}, initialize: function () {
Sys.UI._UpdateProgress.callBaseMethod(this, "initialize");
if (this.get_role() === "status")this.get_element().setAttribute("aria-hidden", "true");
this._beginRequestHandlerDelegate = Function.createDelegate(this, this._handleBeginRequest);
this._endRequestHandlerDelegate = Function.createDelegate(this, this._handleEndRequest);
this._startDelegate = Function.createDelegate(this, this._startRequest);
if (Sys.WebForms && Sys.WebForms.PageRequestManager)this._pageRequestManager = Sys.WebForms.PageRequestManager.getInstance();
if (this._pageRequestManager !== null) {
this._pageRequestManager.add_beginRequest(this._beginRequestHandlerDelegate);
this._pageRequestManager.add_endRequest(this._endRequestHandlerDelegate)
}
}
};
Sys.UI._UpdateProgress.registerClass("Sys.UI._UpdateProgress", Sys.UI.Control);
Type.registerNamespace('Sys.WebForms');
Sys.WebForms.Res = {
"PRM_UnknownToken": "Unknown token: \u0027{0}\u0027.",
"PRM_MissingPanel": "Could not find UpdatePanel with ID \u0027{0}\u0027. If it is being updated dynamically then it must be inside another UpdatePanel.",
"PRM_ServerError": "An unknown error occurred while processing the request on the server. The status code returned from the server was: {0}",
"PRM_ParserError": "The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.\r\nDetails: {0}",
"PRM_TimeoutError": "The server request timed out.",
"PRM_ParserErrorDetails": "Error parsing near \u0027{0}\u0027.",
"PRM_CannotRegisterTwice": "The PageRequestManager cannot be initialized more than once."
};
/* END MicrosoftAjaxWebForms.js */
/* START Telerik.Web.UI.Common.Core.js */
(function (A, j, z) {
var s, t = Object.prototype, b = t.toString, l = "[object Function]", i = "div", n = "input", u = "ontouchstart", y = "touchEvents", w = "PointerEvent", x = "pointerEvents", q = "MSPointerEvent", r = "msPointerEvents";
function o(B) {
return b.call(B) === l;
}
function a(B, C) {
C();
}
function h(B) {
return j.createElement(B);
}
function m(C, B) {
return C.indexOf(B);
}
function p(B, C) {
return B.match(C);
}
var k = function () {
};
k.prototype = {
addTest: function d(B, E, D) {
var C = this;
D = D || C;
if (D[B] !== z) {
return;
}
E = o(E) ? E() : E;
D[B] = E;
}, addSuite: function c(D, E) {
var C = this;
D = C[D] = {};
for (var B in E) {
if (E.hasOwnProperty(B)) {
C.addTest(B, E[B], D);
}
}
}
};
var v = new k();
var e = new k();
var f = new k();
var g = new k();
a("Platform", function () {
var B = A.navigator, C = B.userAgent;
v.addTest("windows", function () {
return (m(C, "Windows") > -1);
});
v.addTest("mac", function () {
return (m(C, "Macintosh") > -1);
});
v.addTest("linux", function () {
return (m(C, "Linux") > -1 && m(C, "Android") == -1);
});
v.addTest("android", function () {
return (m(C, "Android") > -1);
});
v.addTest("ios", function () {
return (m(C, "iPad") > -1 || m(C, "iPhone") > -1);
});
v.addTest("ipad", function () {
return (m(C, "iPad") > -1);
});
v.addTest("iphone", function () {
return (m(C, "iPhone") > -1);
});
});
a("Browser", function () {
var B = A.navigator, C = B.userAgent;
e.addTest("ie", function () {
return (m(C, " MSIE ") > -1 || m(C, " IE ") > -1 || m(C, " Trident/") > -1);
});
e.addTest("ff", function () {
return (!e.ie && m(C, " Firefox/") > -1);
});
e.addTest("opera", function () {
return (m(C, " OPR/") > -1);
});
e.addTest("operaPresto", function () {
return (m(C, "Opera/") > -1);
});
e.addTest("operaMini", function () {
return (m(C, " Opera Mini/") > -1);
});
e.addTest("webkit", function () {
return (m(C, " AppleWebKit/") > -1);
});
e.addTest("safari", function () {
return (e.webkit && m(C, " Version/") > -1);
});
e.addTest("chrome", function () {
return (e.webkit && !e.opera && m(C, " Chrome/") > -1);
});
e.addTest("fullVersion", function () {
var D = null;
if (e.ie) {
D = m(C, " rv:") > -1 ? /rv:([\d\.]+)/ : /MSIE ([\d\.]+)/;
}
if (e.ff) {
D = /Firefox\/([\d\.]+)/;
}
if (e.opera) {
D = /OPR\/([\d\.]+)/;
}
if (e.operaPresto) {
D = /Version\/([\d\.]+)/;
}
if (e.safari) {
D = /Version\/([\d\.]+)/;
}
if (e.chrome) {
D = /Chrome\/([\d\.]+)/;
}
if (D === null) {
return null;
}
return p(C, D)[1];
});
e.addTest("version", function () {
var D = e.fullVersion;
if (D === null) {
return null;
}
return parseFloat(D);
});
e.addTest("documentMode", j.documentMode || null);
e.addTest("quirksMode", e.ie && j.compatMode !== "CSS1Compat");
e.addTest("standardsMode", !e.quirksMode);
});
a("Canvas", function () {
var B = h("canvas");
f.addTest("canvas", !!(B.getContext && B.getContext("2d")));
});
a("Input", function () {
var B = h(n);
f.addSuite("input", {
autocomplete: !!("autocomplete" in B),
autofocus: !!("autofocus" in B),
list: !!("list" in B),
max: !!("max" in B),
min: !!("min" in B),
multiple: !!("multiple" in B),
pattern: !!("pattern" in B),
placeholder: !!("placeholder" in B),
required: !!("required" in B),
step: !!("step" in B)
});
});
a("Input types", function () {
var B = h(n);
function C(D) {
B.setAttribute("type", D);
return B.type !== "text";
}
f.addSuite("inputTypes", {
color: C("color"),
date: C("date"),
datetime: C("datetime"),
"datetime-local": C("datetime-local"),
email: C("email"),
month: C("month"),
number: C("number"),
range: C("range"),
search: C("search"),
tel: C("tel"),
time: C("time"),
url: C("url"),
week: C("week")
});
});
a("Observers", function () {
f.addTest("propertychange", "onpropertychange" in j);
});
a("CSS Features", function () {
function B() {
var F = j.documentElement, E = j.createElement(i), C = j.body, D = C || j.createElement("body"), G;
E.style.cssText = "overflow:scroll;overflow-x:hidden;zoom:1;clear:both";
E.innerHTML = "&nbsp;";
D.appendChild(E);
if (!C) {
F.appendChild(D);
}
G = E.offsetWidth - E.scrollWidth;
E.parentNode.removeChild(E);
if (!C) {
D.parentNode.removeChild(D);
}
return G;
}
e.addTest("scrollBarWidth", B);
});
a("Events", function () {
f.addTest(y, function () {
return u in A;
});
f.addTest(x, function () {
return w in A;
});
f.addTest(r, function () {
return q in A;
});
});
Type.registerNamespace("Telerik.Web");
s = Telerik.Web;
s.Platform = v;
s.Browser = e;
s.BrowserFeatures = f;
s.BrowserPlugins = g;
})(window, document);
try {
if (Sys.Browser.agent == Sys.Browser.InternetExplorer) {
document.execCommand("BackgroundImageCache", false, true);
}
} catch (err) {
}
Type.registerNamespace("Telerik.Web.UI");
var commonScripts = {
cloneJsObject: function (c, d) {
if (!d) {
d = {};
}
for (var a in c) {
var b = c[a];
d[a] = (b instanceof Array) ? Array.clone(b) : b;
}
return d;
},
isCloned: function () {
return this._isCloned;
},
cloneControl: function (f, d, a) {
if (!f) {
return null;
}
if (!d) {
d = Object.getType(f);
}
var e = f.__clonedProperties__;
if (null == e) {
e = f.__clonedProperties__ = $telerik._getPropertiesParameter(f, d);
}
if (!a) {
a = f.get_element().cloneNode(true);
a.removeAttribute("control");
a.removeAttribute("id");
}
var c = $create(d, e, null, null, a);
if (f._observerContext) {
c._observerContext = f._observerContext;
}
var b = $telerik.cloneJsObject(f.get_events());
c._events = b;
c._events._list = $telerik.cloneJsObject(c._events._list);
c._isCloned = true;
c.isCloned = $telerik.isCloned;
return c;
},
_getPropertiesParameter: function (h, d) {
var c = {};
var f = d.prototype;
for (var b in f) {
var a = h[b];
if (typeof(a) == "function" && b.indexOf("get_") == 0) {
var e = b.substring(4);
if (null == h["set_" + e]) {
continue;
}
var g = a.call(h);
if (null == g) {
continue;
}
c[e] = g;
}
}
delete c.clientStateFieldID;
delete c.id;
return c;
},
getOuterSize: function (a) {
var c = $telerik.getSize(a);
var b = $telerik.getMarginBox(a);
return {width: c.width + b.left + b.right, height: c.height + b.top + b.bottom};
},
getOuterBounds: function (a) {
var c = $telerik.getBounds(a);
var b = $telerik.getMarginBox(a);
return {
x: c.x - b.left,
y: c.y - b.top,
width: c.width + b.left + b.right,
height: c.height + b.top + b.bottom
};
},
getInvisibleParent: function (a) {
while (a && a != document) {
if ("none" == $telerik.getCurrentStyle(a, "display", "")) {
return a;
}
a = a.parentNode;
}
return null;
},
isScrolledIntoView: function (d) {
var a = d.ownerDocument;
var g = (a.defaultView) ? a.defaultView : a.parentWindow;
var c = $telerik.$(g).scrollTop(), b = c + $telerik.$(g).height(), f = $telerik.$(d).offset().top, e = f + $telerik.$(d).height();
return ((f + ((e - f) / 4)) >= c && ((f + ((e - f) / 4)) <= b));
},
scrollIntoView: function (b) {
if (!b || !b.parentNode) {
return;
}
var g = null, c = b.offsetParent, h = b.offsetTop, f = 0;
var e = b.parentNode;
while (e != null) {
var d = $telerik.getCurrentStyle(e, "overflowY");
if (d == "scroll" || d == "auto") {
g = e;
break;
}
if (e == c) {
h += e.offsetTop;
c = e.offsetParent;
}
if (e.tagName == "BODY") {
var a = e.ownerDocument;
if (!$telerik.isIE && a.defaultView && a.defaultView.frameElement) {
f = a.defaultView.frameElement.offsetHeight;
}
g = e;
break;
}
e = e.parentNode;
}
if (!g) {
return;
}
if (!f) {
f = g.offsetHeight;
}
if ((g.scrollTop + f) < (h + b.offsetHeight)) {
g.scrollTop = (h + b.offsetHeight) - f;
} else {
if (h < (g.scrollTop)) {
g.scrollTop = h;
}
}
},
getScrollableParent: function (a) {
var c = a.parentNode, d = null, b;
while (c != null) {
b = $telerik.getCurrentStyle(c, "overflowY");
if (b == "scroll" || b == "auto") {
d = c;
break;
}
c = c.parentNode;
}
return d;
},
getScrollableParents: function (a) {
var c = a.parentNode, d = [], b;
while (c != null && c.nodeType === 1) {
b = $telerik.getCurrentStyle(c, "overflowY");
if (b == "scroll" || b == "auto") {
d.push(c);
}
c = c.parentNode;
}
return d;
},
fixScrollableParentBehavior_OldIE: function (a) {
if (!($telerik.isIE6 || $telerik.isIE7) || (!a || a.nodeType !== 1)) {
return;
}
var c = $telerik.getScrollableParent(a), b = $telerik.getComputedStyle(c, "position");
if (b == "static") {
c.style.position = "relative";
}
},
isRightToLeft: function (b) {
while (b && b.nodeType !== 9) {
var a = $telerik.getCurrentStyle(b, "direction");
if (b.dir == "rtl" || a == "rtl") {
return true;
}
if (b.dir == "ltr" || a == "ltr") {
return false;
}
b = b.parentNode;
}
return false;
},
getCorrectScrollLeft: function (a) {
if ($telerik.isRightToLeft(a)) {
return -(a.scrollWidth - a.offsetWidth - Math.abs(a.scrollLeft));
} else {
return a.scrollLeft;
}
},
_borderStyleNames: ["borderTopStyle", "borderRightStyle", "borderBottomStyle", "borderLeftStyle"],
_borderWidthNames: ["borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"],
_paddingWidthNames: ["paddingTop", "paddingRight", "paddingBottom", "paddingLeft"],
_marginWidthNames: ["marginTop", "marginRight", "marginBottom", "marginLeft"],
radControls: [],
registerControl: function (a) {
if (!Array.contains(this.radControls, a)) {
Array.add(this.radControls, a);
}
},
unregisterControl: function (a) {
Array.remove(this.radControls, a);
},
repaintChildren: function (d) {
var e = d.get_element ? d.get_element() : d;
for (var b = 0, c = this.radControls.length;
b < c;
b++) {
var a = this.radControls[b];
if (a.repaint && this.isDescendant(e, a.get_element())) {
a.repaint();
}
}
},
_borderThickness: function () {
$telerik._borderThicknesses = {};
var b = document.createElement("div");
var d = document.createElement("div");
b.style.visibility = "hidden";
b.style.position = "absolute";
b.style.top = "-9999px";
b.style.fontSize = "1px";
d.style.height = "0px";
d.style.overflow = "hidden";
document.body.appendChild(b).appendChild(d);
var a = b.offsetHeight;
d.style.borderTop = "solid black";
b.style.borderLeft = "1px solid red";
d.style.borderTopWidth = "thin";
$telerik._borderThicknesses.thin = b.offsetHeight - a;
d.style.borderTopWidth = "medium";
$telerik._borderThicknesses.medium = b.offsetHeight - a;
d.style.borderTopWidth = "thick";
$telerik._borderThicknesses.thick = b.offsetHeight - a;
var c = $telerik.getComputedStyle(b, "border-left-color", null);
var e = $telerik.getComputedStyle(d, "border-top-color", null);
if (c && e && c == e) {
document.documentElement.className += " _Telerik_a11y";
}
if (typeof(b.removeChild) !== "undefined") {
b.removeChild(d);
}
document.body.removeChild(b);
if (!$telerik.isSafari && !$telerik.isIE10Mode) {
d.outerHTML = null;
}
if (!$telerik.isSafari && !$telerik.isIE10Mode) {
b.outerHTML = null;
}
b = null;
d = null;
},
getCurrentStyle: function (d, a, c) {
var b = null;
if (d) {
if (d.currentStyle) {
b = d.currentStyle[a];
} else {
if (document.defaultView && document.defaultView.getComputedStyle) {
var e = document.defaultView.getComputedStyle(d, null);
if (e) {
b = e[a];
}
}
}
if (!b && d.style) {
if (d.style.getPropertyValue) {
b = d.style.getPropertyValue(a);
} else {
if (d.style.getAttribute) {
b = d.style.getAttribute(a);
}
}
}
}
if ((!b || b == "" || typeof(b) === "undefined")) {
if (typeof(c) != "undefined") {
b = c;
} else {
b = null;
}
}
return b;
},
getComputedStyle: function (d, a, c) {
var b = null;
if (d) {
if (d.currentStyle) {
b = d.currentStyle[a];
} else {
if (document.defaultView && document.defaultView.getComputedStyle) {
var e = document.defaultView.getComputedStyle(d, null);
if (e) {
if (e.getPropertyValue) {
b = e.getPropertyValue(a);
} else {
b = e[a];
}
}
}
}
if (!b && d.style) {
if (d.style.getPropertyValue) {
b = d.style.getPropertyValue(a);
} else {
if (d.style.getAttribute) {
b = d.style.getAttribute(a);
}
}
}
}
if ((!b || b == "" || typeof(b) === "undefined")) {
if (typeof(c) != "undefined") {
b = c;
} else {
b = null;
}
}
return b;
},
getLocation: function (g) {
var d = g && g.ownerDocument ? g.ownerDocument : document;
if (g === d.documentElement) {
return new Sys.UI.Point(0, 0);
}
var C;
if (Sys.Browser.agent == Sys.Browser.InternetExplorer) {
if (g.window === g || g.nodeType === 9 || !g.getClientRects || !g.getBoundingClientRect || g.parentElement == null) {
return new Sys.UI.Point(0, 0);
}
var H = g.getClientRects();
if (!H || !H.length) {
return new Sys.UI.Point(0, 0);
}
var k = H[0];
var c = 0;
var f = 0;
var p = false;
try {
p = d.parentWindow.frameElement;
} catch (j) {
p = true;
}
if (p) {
var b = g.getBoundingClientRect();
if (!b) {
return new Sys.UI.Point(0, 0);
}
var t = k.left;
var u = k.top;
for (var o = 1;
o < H.length;
o++) {
var F = H[o];
if (F.left < t) {
t = F.left;
}
if (F.top < u) {
u = F.top;
}
}
c = t - b.left;
f = u - b.top;
}
var I = 0;
if (($telerik.isIE6 || $telerik.isIE7) || $telerik.quirksMode) {
var n = 1;
if (p && p.getAttribute) {
var a = p.getAttribute("frameborder");
if (a != null) {
n = parseInt(a, 10);
if (isNaN(n)) {
n = a.toLowerCase() == "no" ? 0 : 1;
}
}
}
I = 2 * n;
}
var e = d.documentElement;
var D = k.left - I - c + $telerik.getCorrectScrollLeft(e);
var E = k.top - I - f + e.scrollTop;
C = new Sys.UI.Point(Math.round(D), Math.round(E));
if ($telerik.quirksMode) {
C.x += $telerik.getCorrectScrollLeft(d.body);
C.y += d.body.scrollTop;
}
return C;
}
C = $telerik.originalGetLocation(g);
if ($telerik.isOpera) {
var z = null;
var h = $telerik.getCurrentStyle(g, "display");
if (h != "inline") {
z = g.parentNode;
} else {
z = g.offsetParent;
}
while (z) {
var B = z.tagName.toUpperCase();
if (B == "BODY" || B == "HTML") {
break;
}
if (B == "TABLE" && z.parentNode && z.parentNode.style.display == "inline-block") {
var w = z.offsetLeft;
var v = z.style.display;
z.style.display = "inline-block";
if (z.offsetLeft > w) {
C.x += z.offsetLeft - w;
}
z.style.display = v;
}
C.x -= $telerik.getCorrectScrollLeft(z);
C.y -= z.scrollTop;
if (h != "inline") {
z = z.parentNode;
} else {
z = z.offsetParent;
}
}
}
var y = Math.max(d.documentElement.scrollTop, d.body.scrollTop);
var x = Math.max(d.documentElement.scrollLeft, d.body.scrollLeft);
if ($telerik.isSafari) {
if (y > 0 || x > 0) {
var m = d.documentElement.getElementsByTagName("form");
if (m && m.length > 0) {
var l = $telerik.originalGetLocation(m[0]);
if (l.y && l.y < 0) {
C.y += y;
}
if (l.x && l.x < 0) {
C.x += x;
}
} else {
var G = g.parentNode, s = false, q = false;
while (G && G.tagName) {
var A = $telerik.originalGetLocation(G);
if (A.y < 0) {
s = true;
}
if (A.x < 0) {
q = true;
}
G = G.parentNode;
}
if (s) {
C.y += y;
}
if (q) {
C.x += x;
}
}
}
}
return C;
},
setLocation: function (a, b) {
Sys.UI.DomElement.setLocation(a, b.x, b.y);
},
findControl: function (f, d) {
var b = f.getElementsByTagName("*");
for (var c = 0, e = b.length;
c < e;
c++) {
var a = b[c].id;
if (a && a.endsWith(d)) {
return $find(a);
}
}
return null;
},
findElement: function (f, d) {
var b = f.getElementsByTagName("*");
for (var c = 0, e = b.length;
c < e;
c++) {
var a = b[c].id;
if (a && a.endsWith(d)) {
return $get(a);
}
}
return null;
},
getContentSize: function (b) {
if (!b) {
throw Error.argumentNull("element");
}
var d = $telerik.getSize(b);
var a = $telerik.getBorderBox(b);
var c = $telerik.getPaddingBox(b);
return {width: d.width - a.horizontal - c.horizontal, height: d.height - a.vertical - c.vertical};
},
getSize: function (a) {
if (!a) {
throw Error.argumentNull("element");
}
return {width: a.offsetWidth, height: a.offsetHeight};
},
setContentSize: function (b, d) {
if (!b) {
throw Error.argumentNull("element");
}
if (!d) {
throw Error.argumentNull("size");
}
if ($telerik.getCurrentStyle(b, "MozBoxSizing") == "border-box" || $telerik.getCurrentStyle(b, "BoxSizing") == "border-box") {
var a = $telerik.getBorderBox(b);
var c = $telerik.getPaddingBox(b);
d = {width: d.width + a.horizontal + c.horizontal, height: d.height + a.vertical + c.vertical};
}
b.style.width = d.width.toString() + "px";
b.style.height = d.height.toString() + "px";
},
setSize: function (c, e) {
if (!c) {
throw Error.argumentNull("element");
}
if (!e) {
throw Error.argumentNull("size");
}
var a = $telerik.getBorderBox(c);
var d = $telerik.getPaddingBox(c);
var b = {width: e.width - a.horizontal - d.horizontal, height: e.height - a.vertical - d.vertical};
$telerik.setContentSize(c, b);
},
getBounds: function (a) {
var b = $telerik.getLocation(a);
return new Sys.UI.Bounds(b.x, b.y, a.offsetWidth || 0, a.offsetHeight || 0);
},
setBounds: function (b, a) {
if (!b) {
throw Error.argumentNull("element");
}
if (!a) {
throw Error.argumentNull("bounds");
}
$telerik.setSize(b, a);
$telerik.setLocation(b, a);
},
getClientBounds: function () {
var b;
var a;
switch (Sys.Browser.agent) {
case Sys.Browser.InternetExplorer:
b = document.documentElement.clientWidth;
a = document.documentElement.clientHeight;
if (b == 0 && a == 0) {
b = document.body.clientWidth;
a = document.body.clientHeight;
}
break;
case Sys.Browser.Safari:
b = window.innerWidth;
a = window.innerHeight;
break;
case Sys.Browser.Opera:
if (Sys.Browser.version >= 9.5) {
b = Math.min(window.innerWidth, document.documentElement.clientWidth);
a = Math.min(window.innerHeight, document.documentElement.clientHeight);
} else {
b = Math.min(window.innerWidth, document.body.clientWidth);
a = Math.min(window.innerHeight, document.body.clientHeight);
}
break;
default:
b = Math.min(window.innerWidth, document.documentElement.clientWidth);
a = Math.min(window.innerHeight, document.documentElement.clientHeight);
break;
}
return new Sys.UI.Bounds(0, 0, b, a);
},
getMarginBox: function (b) {
if (!b) {
throw Error.argumentNull("element");
}
var a = {
top: $telerik.getMargin(b, Telerik.Web.BoxSide.Top),
right: $telerik.getMargin(b, Telerik.Web.BoxSide.Right),
bottom: $telerik.getMargin(b, Telerik.Web.BoxSide.Bottom),
left: $telerik.getMargin(b, Telerik.Web.BoxSide.Left)
};
a.horizontal = a.left + a.right;
a.vertical = a.top + a.bottom;
return a;
},
getPaddingBox: function (b) {
if (!b) {
throw Error.argumentNull("element");
}
var a = {
top: $telerik.getPadding(b, Telerik.Web.BoxSide.Top),
right: $telerik.getPadding(b, Telerik.Web.BoxSide.Right),
bottom: $telerik.getPadding(b, Telerik.Web.BoxSide.Bottom),
left: $telerik.getPadding(b, Telerik.Web.BoxSide.Left)
};
a.horizontal = a.left + a.right;
a.vertical = a.top + a.bottom;
return a;
},
getBorderBox: function (b) {
if (!b) {
throw Error.argumentNull("element");
}
var a = {
top: $telerik.getBorderWidth(b, Telerik.Web.BoxSide.Top),
right: $telerik.getBorderWidth(b, Telerik.Web.BoxSide.Right),
bottom: $telerik.getBorderWidth(b, Telerik.Web.BoxSide.Bottom),
left: $telerik.getBorderWidth(b, Telerik.Web.BoxSide.Left)
};
a.horizontal = a.left + a.right;
a.vertical = a.top + a.bottom;
return a;
},
isBorderVisible: function (b, a) {
if (!b) {
throw Error.argumentNull("element");
}
if (a < Telerik.Web.BoxSide.Top || a > Telerik.Web.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, a, "Telerik.Web.BoxSide"));
}
var c = $telerik._borderStyleNames[a];
var d = $telerik.getCurrentStyle(b, c);
return d != "none";
},
getMargin: function (b, a) {
if (!b) {
throw Error.argumentNull("element");
}
if (a < Telerik.Web.BoxSide.Top || a > Telerik.Web.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, a, "Telerik.Web.BoxSide"));
}
var d = $telerik._marginWidthNames[a];
var e = $telerik.getCurrentStyle(b, d);
try {
return $telerik.parsePadding(e);
} catch (c) {
return 0;
}
},
getBorderWidth: function (b, a) {
if (!b) {
throw Error.argumentNull("element");
}
if (a < Telerik.Web.BoxSide.Top || a > Telerik.Web.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, a, "Telerik.Web.BoxSide"));
}
if (!$telerik.isBorderVisible(b, a)) {
return 0;
}
var c = $telerik._borderWidthNames[a];
var d = $telerik.getCurrentStyle(b, c);
return $telerik.parseBorderWidth(d);
},
getPadding: function (b, a) {
if (!b) {
throw Error.argumentNull("element");
}
if (a < Telerik.Web.BoxSide.Top || a > Telerik.Web.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, a, "Telerik.Web.BoxSide"));
}
var c = $telerik._paddingWidthNames[a];
var d = $telerik.getCurrentStyle(b, c);
return $telerik.parsePadding(d);
},
parseBorderWidth: function (a) {
if (a) {
switch (a) {
case"thin":
case"medium":
case"thick":
return $telerik._borderThicknesses[a];
case"inherit":
return 0;
}
var b = $telerik.parseUnit(a);
return b.size;
}
return 0;
},
parsePadding: function (a) {
if (a) {
if (a == "auto" || a == "inherit") {
return 0;
}
var b = $telerik.parseUnit(a);
return b.size;
}
return 0;
},
parseUnit: function (g) {
if (!g) {
throw Error.argumentNull("value");
}
g = g.trim().toLowerCase();
var c = g.length;
var d = -1;
for (var b = 0;
b < c;
b++) {
var a = g.substr(b, 1);
if ((a < "0" || a > "9") && a != "-" && a != "." && a != ",") {
break;
}
d = b;
}
if (d == -1) {
throw Error.create("No digits");
}
var f;
var e;
if (d < (c - 1)) {
f = g.substring(d + 1).trim();
} else {
f = "px";
}
e = parseFloat(g.substr(0, d + 1));
if (f == "px") {
e = Math.floor(e);
}
return {size: e, type: f};
},
containsPoint: function (a, b, c) {
return b >= a.x && b <= (a.x + a.width) && c >= a.y && c <= (a.y + a.height);
},
isDescendant: function (a, b) {
try {
for (var d = b.parentNode;
d != null;
d = d.parentNode) {
if (d == a) {
return true;
}
}
} catch (c) {
}
return false;
},
isDescendantOrSelf: function (a, b) {
if (a === b) {
return true;
}
return $telerik.isDescendant(a, b);
},
addCssClasses: function (b, a) {
for (var c = 0;
c < a.length;
c++) {
Sys.UI.DomElement.addCssClass(b, a[c]);
}
},
removeCssClasses: function (b, a) {
for (var c = 0;
c < a.length;
c++) {
Sys.UI.DomElement.removeCssClass(b, a[c]);
}
},
getScrollOffset: function (b, e) {
var c = 0;
var f = 0;
var d = b;
var a = b && b.ownerDocument ? b.ownerDocument : document;
while (d != null && d.scrollLeft != null) {
c += $telerik.getCorrectScrollLeft(d);
f += d.scrollTop;
if (!e || (d == a.body && (d.scrollLeft != 0 || d.scrollTop != 0))) {
break;
}
d = d.parentNode;
}
return {x: c, y: f};
},
getElementByClassName: function (d, c, g) {
if (d.getElementsByClassName) {
return d.getElementsByClassName(c)[0];
}
var b = null;
if (g) {
b = d.getElementsByTagName(g);
} else {
b = d.getElementsByTagName("*");
}
for (var e = 0, f = b.length;
e < f;
e++) {
var a = b[e];
if (Sys.UI.DomElement.containsCssClass(a, c)) {
return a;
}
}
return null;
},
getElementsByClassName: function (b, a, c) {
b = b || document;
if (b.getElementsByClassName) {
getElementsByClassName = function (d, m, g) {
var f = g.getElementsByClassName(d), k = (m) ? new RegExp("\\b" + m + "\\b", "i") : null, l = [], e;
for (var h = 0, j = f.length;
h < j;
h += 1) {
e = f[h];
if (!k || k.test(e.nodeName)) {
l.push(e);
}
}
return l;
};
} else {
if (document.evaluate) {
getElementsByClassName = function (g, q, k) {
q = q || "*";
var d = g.split(" "), f = "", r = "http://www.w3.org/1999/xhtml", n = (document.documentElement.namespaceURI === r) ? r : null, p = [], i, o;
for (var l = 0, m = d.length;
l < m;
l += 1) {
f += "[contains(concat(' ', @class, ' '), ' " + d[l] + " ')]";
}
try {
i = document.evaluate(".//" + q + f, k, n, 0, null);
} catch (h) {
i = document.evaluate(".//" + q + f, k, null, 0, null);
}
while ((o = i.iterateNext())) {
p.push(o);
}
return p;
};
} else {
getElementsByClassName = function (f, u, i) {
u = u || "*";
var d = f.split(" "), e = [], h = (u === "*" && i.all) ? i.all : i.getElementsByTagName(u), g, t = [], r;
for (var j = 0, n = d.length;
j < n;
j += 1) {
e.push(new RegExp("(^|\\s)" + d[j] + "(\\s|$)"));
}
for (var o = 0, p = h.length;
o < p;
o += 1) {
g = h[o];
r = false;
for (var q = 0, s = e.length;
q < s;
q += 1) {
r = e[q].test(g.className);
if (!r) {
break;
}
}
if (r) {
t.push(g);
}
}
return t;
};
}
}
return getElementsByClassName(a, c, b);
},
nextElement: function (b) {
if (!b) {
return b;
}
var a = b.nextSibling;
while (a && a.nodeType != 1) {
a = a.nextSibling;
}
return a;
},
previousElement: function (b) {
if (!b) {
return b;
}
var a = b.previousSibling;
while (a && a.nodeType != 1) {
a = a.previousSibling;
}
return a;
},
_getWindow: function (b) {
var a = b.ownerDocument || b.document || b;
return a.defaultView || a.parentWindow;
},
useAttachEvent: function (a) {
return (a.attachEvent && !$telerik.isOpera);
},
useDetachEvent: function (a) {
return (a.detachEvent && !$telerik.isOpera);
},
addHandler: function (e, g, h, a) {
if (!e._events) {
e._events = {};
}
var f = e._events[g];
if (!f) {
e._events[g] = f = [];
}
var b;
if ($telerik.useAttachEvent(e)) {
b = function () {
var d = {};
try {
d = $telerik._getWindow(e).event;
} catch (i) {
}
return h.call(e, new Sys.UI.DomEvent(d));
};
e.attachEvent("on" + g, b);
} else {
if (e.addEventListener) {
b = function (d) {
return h.call(e, new Sys.UI.DomEvent(d));
};
e.addEventListener(g, b, false);
}
}
f[f.length] = {handler: h, browserHandler: b, autoRemove: a};
if (a) {
var c = e.dispose;
if (c !== $telerik._disposeHandlers) {
e.dispose = $telerik._disposeHandlers;
if (typeof(c) !== "undefined") {
e._chainDispose = c;
}
}
}
},
addHandlers: function (b, c, e, a) {
for (var f in c) {
var d = c[f];
if (e) {
d = Function.createDelegate(e, d);
}
$telerik.addHandler(b, f, d, a || false);
}
},
clearHandlers: function (a) {
$telerik._clearHandlers(a, false);
},
_clearHandlers: function (c, a) {
if (c._events) {
var b = c._events;
for (var g in b) {
var e = b[g];
for (var f = e.length - 1;
f >= 0;
f--) {
var d = e[f];
if (!a || d.autoRemove) {
$telerik.removeHandler(c, g, d.handler);
}
}
}
c._events = null;
}
},
_disposeHandlers: function () {
$telerik._clearHandlers(this, true);
var a = this._chainDispose, b = typeof(a);
if (b !== "undefined") {
this.dispose = a;
this._chainDispose = null;
if (b === "function") {
this.dispose();
}
}
},
removeHandler: function (a, b, c) {
$telerik._removeHandler(a, b, c);
},
_removeHandler: function (c, d, e) {
var a = null;
var b = c._events[d] || [];
for (var f = 0, g = b.length;
f < g;
f++) {
if (b[f].handler === e) {
a = b[f].browserHandler;
break;
}
}
if ($telerik.useDetachEvent(c)) {
c.detachEvent("on" + d, a);
} else {
if (c.removeEventListener) {
c.removeEventListener(d, a, false);
}
}
b.splice(f, 1);
},
_emptySrc: function () {
return "about:blank";
},
addExternalHandler: function (a, b, c) {
if (!a) {
return;
}
if ($telerik.useAttachEvent(a)) {
a.attachEvent("on" + b, c);
} else {
if (a.addEventListener) {
a.addEventListener(b, c, false);
}
}
},
removeExternalHandler: function (a, b, c) {
if (!a) {
return;
}
if ($telerik.useDetachEvent(a)) {
a.detachEvent("on" + b, c);
} else {
if (a.addEventListener) {
a.removeEventListener(b, c, false);
}
}
},
addMobileHandler: function (g, b, c, d, f, e) {
if (!b || !g) {
return;
}
var a = Function.createDelegate(g, $telerik.isTouchDevice ? (f || d) : d);
if ($telerik.isTouchDevice) {
if ($telerik.$) {
$telerik.$(b).bind($telerik.getMobileEventCounterpart(c), a);
} else {
$telerik.addExternalHandler(b, $telerik.getMobileEventCounterpart(c), a);
}
} else {
if (e) {
$telerik.addExternalHandler(b, c, a);
} else {
$addHandler(b, c, a);
}
}
return a;
},
removeMobileHandler: function (a, b, c, e, d) {
if (!a) {
return;
}
if ($telerik.isTouchDevice) {
if ($telerik.$) {
$telerik.$(a).unbind($telerik.getMobileEventCounterpart(b), (e || c));
} else {
$telerik.removeExternalHandler(a, $telerik.getMobileEventCounterpart(b), (e || c));
}
} else {
if (d) {
$telerik.removeExternalHandler(a, b, c);
} else {
$removeHandler(a, b, c);
}
}
},
getMobileEventCounterpart: function (a) {
switch (a) {
case"mousedown":
return $telerik.isMobileIE10 ? "MSPointerDown" : "touchstart";
case"mouseup":
return $telerik.isMobileIE10 ? "MSPointerUp" : "touchend";
case"mousemove":
return $telerik.isMobileIE10 ? "MSPointerMove" : "touchmove";
}
return a;
},
getTouchEventLocation: function (b) {
var d = arguments[1], f = d ? [d + "X"] : "pageX", g = d ? [d + "Y"] : "pageY", c = {
x: b[f],
y: b[g]
}, a = b.changedTouches || (b.originalEvent ? b.originalEvent.changedTouches : b.rawEvent ? b.rawEvent.changedTouches : false);
if ($telerik.isTouchDevice && a && a.length < 2) {
c.x = a[0][f];
c.y = a[0][g];
}
if ($telerik.isMobileIE10 && b.originalEvent) {
c.x = b.originalEvent[f];
c.y = b.originalEvent[g];
}
return c;
},
getTouchTarget: function (a) {
if ($telerik.isTouchDevice) {
var b = "originalEvent" in a ? a.originalEvent.changedTouches : "rawEvent" in a ? a.rawEvent.changedTouches : a.changedTouches;
return b ? document.elementFromPoint(b[0].clientX, b[0].clientY) : a.target;
} else {
return a.target;
}
},
cancelRawEvent: function (a) {
if (!a) {
return false;
}
if (a.preventDefault) {
a.preventDefault();
}
if (a.stopPropagation) {
a.stopPropagation();
}
a.cancelBubble = true;
a.returnValue = false;
return false;
},
preventDefault: function (a) {
if (a.preventDefault) {
a.preventDefault();
}
a.returnValue = false;
return false;
},
getOuterHtml: function (a) {
if (a.outerHTML) {
return a.outerHTML;
} else {
var b = a.cloneNode(true);
var c = a.ownerDocument.createElement("div");
c.appendChild(b);
return c.innerHTML;
}
},
setVisible: function (a, b) {
if (!a) {
return;
}
if (b != $telerik.getVisible(a)) {
if (b) {
if (a.style.removeAttribute) {
a.style.removeAttribute("display");
} else {
a.style.removeProperty("display");
}
} else {
a.style.display = "none";
}
a.style.visibility = b ? "visible" : "hidden";
}
},
getVisible: function (a) {
if (!a) {
return false;
}
return (("none" != $telerik.getCurrentStyle(a, "display")) && ("hidden" != $telerik.getCurrentStyle(a, "visibility")));
},
getViewPortSize: function () {
var c = 0;
var b = 0;
var a = document.body;
if (!$telerik.quirksMode && !$telerik.isSafari) {
a = document.documentElement;
}
if (window.innerWidth) {
c = Math.max(document.documentElement.clientWidth, document.body.clientWidth);
b = Math.max(document.documentElement.clientHeight, document.body.clientHeight);
if (c > window.innerWidth) {
c = document.documentElement.clientWidth;
}
if (b > window.innerHeight) {
b = document.documentElement.clientHeight;
}
} else {
c = a.clientWidth;
b = a.clientHeight;
}
c += a.scrollLeft;
b += a.scrollTop;
if ($telerik.isMobileSafari) {
c += window.pageXOffset;
b += window.pageYOffset;
}
return {width: c - 6, height: b - 6};
},
elementOverflowsTop: function (b, a) {
var c = a || $telerik.getLocation(b);
return c.y < 0;
},
elementOverflowsLeft: function (b, a) {
var c = a || $telerik.getLocation(b);
return c.x < 0;
},
elementOverflowsBottom: function (e, c, b) {
var d = b || $telerik.getLocation(c);
var a = d.y + c.offsetHeight;
return a > e.height;
},
elementOverflowsRight: function (e, b, a) {
var c = a || $telerik.getLocation(b);
var d = c.x + b.offsetWidth;
return d > e.width;
},
getDocumentRelativeCursorPosition: function (c) {
var b = document.documentElement, a = document.body, f = ($telerik.quirksMode || a.scrollLeft > b.scrollLeft) ? $telerik.getCorrectScrollLeft(a) : $telerik.getCorrectScrollLeft(b), d = c.clientX + f, g = c.clientY + $telerik.getDocumentElementScrollTop();
if ($telerik.isIE6 || $telerik.isIE7) {
d -= 2;
g -= 2;
}
return {left: d, top: g};
},
getDocumentElementScrollTop: function () {
var b = document.documentElement, a = document.body;
return ($telerik.quirksMode || a.scrollTop > b.scrollTop) ? a.scrollTop : b.scrollTop;
},
getDocumentElementScrollLeft: function () {
var b = document.documentElement, a = document.body;
return ($telerik.quirksMode || a.scrollLeft > b.scrollLeft) ? a.scrollLeft : b.scrollLeft;
},
evalScriptCode: function (b) {
if ($telerik.isSafari) {
b = b.replace(/^\s*<!--((.|\n)*)-->\s*$/mi, "$1");
}
var a = document.createElement("script");
a.setAttribute("type", "text/javascript");
a.text = b;
var c = document.getElementsByTagName("head")[0];
c.appendChild(a);
a.parentNode.removeChild(a);
},
isScriptRegistered: function (k, a) {
if (!k) {
return 0;
}
if (!a) {
a = document;
}
if ($telerik._uniqueScripts == null) {
$telerik._uniqueScripts = {};
}
var h = document.getElementsByTagName("script");
var f = 0;
var c = k.indexOf("?d=");
var d = k.indexOf("&");
var j = c > 0 && d > c ? k.substring(c + 3, d) : k;
if ($telerik._uniqueScripts[j] != null) {
return 2;
}
for (var b = 0, e = h.length;
b < e;
b++) {
var g = h[b];
if (g.src) {
if (g.getAttribute("src", 2).indexOf(j) != -1) {
$telerik._uniqueScripts[j] = true;
if (!$telerik.isDescendant(a, g)) {
f++;
}
}
}
}
return f;
},
evalScripts: function (b, a) {
$telerik.registerSkins(b);
var g = b.getElementsByTagName("script");
var j = 0, h = 0;
var e = function (n, o) {
if (n - h > 0 && ($telerik.isIE || $telerik.isSafari)) {
window.setTimeout(function () {
e(n, o);
}, 5);
} else {
var i = document.createElement("script");
i.setAttribute("type", "text/javascript");
document.getElementsByTagName("head")[0].appendChild(i);
i.loadFinished = false;
i.onload = function () {
if (!this.loadFinished) {
this.loadFinished = true;
h++;
}
};
i.onreadystatechange = function () {
if ("loaded" === this.readyState && !this.loadFinished) {
this.loadFinished = true;
h++;
}
};
i.setAttribute("src", o);
}
};
var k = [];
for (var c = 0, d = g.length;
c < d;
c++) {
var f = g[c];
if (f.src) {
var m = f.getAttribute("src", 2);
if (!$telerik.isScriptRegistered(m, b)) {
e(j++, m);
}
} else {
Array.add(k, f.innerHTML);
}
}
var l = function () {
if (j - h > 0) {
window.setTimeout(l, 20);
} else {
for (var i = 0;
i < k.length;
i++) {
$telerik.evalScriptCode(k[i]);
}
if (a) {
a();
}
}
};
l();
},
registerSkins: function (c) {
if (!c) {
c = document.body;
}
var h = c.getElementsByTagName("link");
if (h && h.length > 0) {
var a = document.getElementsByTagName("head")[0];
if (a) {
for (var d = 0, g = h.length;
d < g;
d++) {
var k = h[d];
if (k.className == "Telerik_stylesheet") {
var l = a.getElementsByTagName("link");
if (k.href.indexOf("ie7CacheFix") >= 0) {
try {
k.href = k.href.replace("&ie7CacheFix", "");
k.href = k.href.replace("?ie7CacheFix", "");
} catch (b) {
}
}
if (l && l.length > 0) {
var f = l.length - 1;
while (f >= 0 && l[f--].href != k.href) {
}
if (f >= 0) {
continue;
}
}
if ($telerik.isIE && !$telerik.isIE9Mode) {
k.parentNode.removeChild(k);
k = k.cloneNode(true);
}
a.appendChild(k);
if (g > h.length) {
g = h.length;
d--;
}
}
}
}
}
},
getFirstChildByTagName: function (b, d, c) {
if (!b || !b.childNodes) {
return null;
}
var a = b.childNodes[c] || b.firstChild;
while (a) {
if (a.nodeType == 1 && a.tagName.toLowerCase() == d) {
return a;
}
a = a.nextSibling;
}
return null;
},
getChildByClassName: function (c, a, d) {
var b = c.childNodes[d] || c.firstChild;
while (b) {
if (b.nodeType == 1 && b.className.indexOf(a) > -1) {
return b;
}
b = b.nextSibling;
}
return null;
},
getChildrenByTagName: function (d, g) {
var c = [];
var b = d.childNodes;
if ($telerik.isIE) {
b = d.children;
}
for (var e = 0, f = b.length;
e < f;
e++) {
var a = b[e];
if (a.nodeType == 1 && a.tagName.toLowerCase() == g) {
Array.add(c, a);
}
}
return c;
},
getChildrenByClassName: function (e, d) {
var c = [];
var b = e.childNodes;
if ($telerik.isIE) {
b = e.children;
}
for (var f = 0, g = b.length;
f < g;
f++) {
var a = b[f];
if (a.nodeType == 1 && a.className.indexOf(d) > -1) {
Array.add(c, a);
}
}
return c;
},
mergeElementAttributes: function (d, e, b) {
if (!d || !e) {
return;
}
if (d.mergeAttributes) {
e.mergeAttributes(d, b);
} else {
for (var a = 0;
a < d.attributes.length;
a++) {
var c = d.attributes[a].nodeValue;
e.setAttribute(d.attributes[a].nodeName, c);
}
if ("" == e.getAttribute("style")) {
e.removeAttribute("style");
}
}
},
isMouseOverElement: function (c, b) {
var d = $telerik.getBounds(c);
var a = $telerik.getDocumentRelativeCursorPosition(b);
return $telerik.containsPoint(d, a.left, a.top);
},
isMouseOverElementEx: function (b, a) {
var f = null;
try {
f = $telerik.getOuterBounds(b);
} catch (c) {
return false;
}
if (a && a.target) {
var g = a.target.tagName;
if (g == "SELECT" || g == "OPTION") {
return true;
}
if (a.clientX < 0 || a.clientY < 0) {
return true;
}
}
var d = $telerik.getDocumentRelativeCursorPosition(a);
f.x += 2;
f.y += 2;
f.width -= 4;
f.height -= 4;
return $telerik.containsPoint(f, d.left, d.top);
},
getPreviousHtmlNode: function (a) {
if (!a || !a.previousSibling) {
return null;
}
while (a.previousSibling) {
if (a.previousSibling.nodeType == 1) {
return a.previousSibling;
}
a = a.previousSibling;
}
},
getNextHtmlNode: function (a) {
if (!a || !a.nextSibling) {
return null;
}
while (a.nextSibling) {
if (a.nextSibling.nodeType == 1) {
return a.nextSibling;
}
a = a.nextSibling;
}
},
disposeElement: function (a) {
if (typeof(Sys.WebForms) == "undefined") {
return;
}
var b = Sys.WebForms.PageRequestManager.getInstance();
if (b && b._destroyTree) {
b._destroyTree(a);
} else {
if (Sys.Application.disposeElement) {
Sys.Application.disposeElement(a, true);
}
}
},
htmlEncode: function (d) {
var a = /&/g, c = /</g, b = />/g;
return ("" + d).replace(a, "&amp;").replace(c, "&lt;").replace(b, "&gt;");
},
htmlDecode: function (d) {
var a = /&amp;/g, c = /&lt;/g, b = /&gt;/g;
return ("" + d).replace(b, ">").replace(c, "<").replace(a, "&");
}
};
if (window.$telerik == undefined) {
window.$telerik = commonScripts;
} else {
if ($telerik.$ != undefined && $telerik.$.extend) {
$telerik.$.extend(window.$telerik, commonScripts);
}
}
window.TelerikCommonScripts = Telerik.Web.CommonScripts = window.$telerik;
(function (i, g) {
function b(k, j) {
return k.indexOf(j);
}
function c(j, k) {
return j.match(k);
}
var e = i.navigator, h = e.userAgent, f, d, a;
$telerik.isTrident = b(h, " Trident/") > -1;
$telerik.isIE = (b(h, " MSIE ") > -1 || $telerik.isTrident);
$telerik.isFirefox = b(h, " Firefox/") > -1 && !$telerik.isIE;
if ($telerik.isIE) {
f = /MSIE ([\d\.]+)/;
d = c(h, f);
if (d) {
a = d[1];
} else {
f = /rv:([\d\.]+)/;
d = c(h, f);
if (d) {
a = d[1];
}
}
$telerik.isIE6 = a < 7;
$telerik.isIE7 = a == 7 || (document.documentMode && document.documentMode == 7);
$telerik.isIE8 = document.documentMode && document.documentMode == 8;
$telerik.isIE9 = document.documentMode && document.documentMode == 9;
$telerik.isIE9Mode = document.documentMode && document.documentMode >= 9;
$telerik.isIE10 = document.documentMode && document.documentMode == 10;
$telerik.isIE10Mode = document.documentMode && document.documentMode >= 10;
}
})(window);
if (typeof(Sys.Browser.WebKit) == "undefined") {
Sys.Browser.WebKit = {};
}
if (typeof(Sys.Browser.Chrome) == "undefined") {
Sys.Browser.Chrome = {};
}
if (navigator.userAgent.indexOf("Chrome") > -1) {
Sys.Browser.version = parseFloat(navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]);
Sys.Browser.agent = Sys.Browser.Chrome;
Sys.Browser.name = "Chrome";
} else {
if (navigator.userAgent.indexOf("WebKit/") > -1) {
Sys.Browser.version = parseFloat(navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]);
if (Sys.Browser.version < 500) {
Sys.Browser.agent = Sys.Browser.Safari;
Sys.Browser.name = "Safari";
} else {
Sys.Browser.agent = Sys.Browser.WebKit;
Sys.Browser.name = "WebKit";
}
}
}
$telerik.isMobileSafari = (navigator.userAgent.search(/like\sMac\sOS\sX.*Mobile\/\S+/) != -1);
$telerik.isChrome = Sys.Browser.agent == Sys.Browser.Chrome;
$telerik.isSafari6 = Sys.Browser.agent == Sys.Browser.WebKit && Sys.Browser.version >= 536;
$telerik.isSafari5 = Sys.Browser.agent == Sys.Browser.WebKit && Sys.Browser.version >= 534 && Sys.Browser.version < 536;
$telerik.isSafari4 = Sys.Browser.agent == Sys.Browser.WebKit && Sys.Browser.version >= 526 && Sys.Browser.version < 534;
$telerik.isSafari3 = Sys.Browser.agent == Sys.Browser.WebKit && Sys.Browser.version < 526 && Sys.Browser.version > 500;
$telerik.isSafari2 = Sys.Browser.agent == Sys.Browser.Safari;
$telerik.isSafari = $telerik.isSafari2 || $telerik.isSafari3 || $telerik.isSafari4 || $telerik.isSafari5 || $telerik.isSafari6 || $telerik.isChrome;
$telerik.isAndroid = (navigator.userAgent.search(/Android/i) != -1);
$telerik.isBlackBerry4 = (navigator.userAgent.search(/BlackBerry\d+\/4[\d\.]+/i) != -1);
$telerik.isBlackBerry5 = (navigator.userAgent.search(/BlackBerry\d+\/5[\d\.]+/i) != -1);
$telerik.isBlackBerry6 = (navigator.userAgent.search(/BlackBerry.*Safari\/\S+/i) != -1);
$telerik.isBlackBerry = $telerik.isBlackBerry4 || $telerik.isBlackBerry5 || $telerik.isBlackBerry6;
$telerik.isOpera = Sys.Browser.agent == Sys.Browser.Opera;
$telerik.isFirefox2 = $telerik.isFirefox && Sys.Browser.version < 3;
$telerik.isFirefox3 = $telerik.isFirefox && Sys.Browser.version >= 3;
$telerik.quirksMode = $telerik.isIE && document.compatMode != "CSS1Compat";
$telerik.standardsMode = !$telerik.quirksMode;
$telerik.OperaEngine = 0;
$telerik.OperaVersionString = window.opera ? window.opera.version() : 0;
$telerik.OperaVersion = $telerik.OperaVersionString ? (parseInt($telerik.OperaVersionString * 10, 10) / 10) : 0;
if ($telerik.isOpera) {
$telerik._prestoVersion = navigator.userAgent.match(/Presto\/(\d+\.(\d+)?)/);
if ($telerik._prestoVersion) {
$telerik.OperaEngine = parseInt($telerik._prestoVersion[1], 10) + (parseInt($telerik._prestoVersion[2], 10) / 100);
}
}
$telerik.isOpera9 = $telerik.isOpera && $telerik.OperaVerNumber < 10;
$telerik.isOpera10 = $telerik.isOpera && $telerik.OperaVersion >= 10 && $telerik.OperaVersion < 10.5;
$telerik.isOpera105 = $telerik.isOpera && $telerik.OperaVersion >= 10.5;
$telerik.isOpera11 = $telerik.isOpera && $telerik.OperaVersion > 11;
$telerik.isMobileOpera = $telerik.isOpera && (navigator.userAgent.search(/opera (?:mobi|tablet)/i) != -1);
$telerik.isMobileIE10 = $telerik.isIE10 && (navigator.userAgent.search(/\bARM\b;|\bTouch\b/i) != -1);
$telerik.isTouchDevice = $telerik.isMobileSafari || $telerik.isAndroid || $telerik.isBlackBerry6 || $telerik.isMobileOpera;
if ($telerik.isIE9Mode) {
document.documentElement.className += " _Telerik_IE9";
}
if ($telerik.isOpera11) {
document.documentElement.className += " _Telerik_Opera11";
} else {
if ($telerik.isOpera105) {
document.documentElement.className += " _Telerik_Opera105";
}
}
if (document.documentElement.getBoundingClientRect) {
$telerik.originalGetLocation = function (g) {
var d = Function._validateParams(arguments, [{name: "element", domElement: true}]);
if (d) {
throw d;
}
if (g.self || g.nodeType === 9 || (g === document.documentElement) || (g.parentNode === g.ownerDocument.documentElement)) {
return new Sys.UI.Point(0, 0);
}
var b = g.getBoundingClientRect();
if (!b) {
return new Sys.UI.Point(0, 0);
}
var c = g.ownerDocument.documentElement, k = Math.round(b.left) + c.scrollLeft, l = Math.round(b.top) + c.scrollTop;
if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
try {
var i = g.ownerDocument.parentWindow.frameElement || null;
if (i) {
var j = (i.frameBorder === "0" || i.frameBorder === "no") ? 2 : 0;
k += j;
l += j;
}
} catch (h) {
}
if (Sys.Browser.version === 7 && !document.documentMode) {
var a = document.body, m = a.getBoundingClientRect(), n = (m.right - m.left) / a.clientWidth;
n = Math.round(n * 100);
n = (n - n % 5) / 100;
if (!isNaN(n) && (n !== 1)) {
k = Math.round(k / n);
l = Math.round(l / n);
}
}
if ((document.documentMode || 0) < 8) {
k -= c.clientLeft;
l -= c.clientTop;
}
}
return new Sys.UI.Point(k, l);
};
} else {
if ($telerik.isSafari) {
$telerik.originalGetLocation = function (c) {
var b = Function._validateParams(arguments, [{name: "element", domElement: true}]);
if (b) {
throw b;
}
if ((c.window && (c.window === c)) || c.nodeType === 9) {
return new Sys.UI.Point(0, 0);
}
var f = 0, g = 0, h, j = null, k = null, a, l;
for (h = c;
h;
j = h, k = a, h = h.offsetParent) {
a = Sys.UI.DomElement._getCurrentStyle(h);
l = h.tagName ? h.tagName.toUpperCase() : null;
if ((h.offsetLeft || h.offsetTop) && ((l !== "BODY") || (!k || k.position !== "absolute"))) {
f += h.offsetLeft;
g += h.offsetTop;
}
if (j && Sys.Browser.version >= 3) {
f += parseInt(a.borderLeftWidth, 10);
g += parseInt(a.borderTopWidth, 10);
}
}
a = Sys.UI.DomElement._getCurrentStyle(c);
var d = a ? a.position : null;
if (!d || (d !== "absolute")) {
for (h = c.parentNode;
h;
h = h.parentNode) {
l = h.tagName ? h.tagName.toUpperCase() : null;
if ((l !== "BODY") && (l !== "HTML") && (h.scrollLeft || h.scrollTop)) {
f -= (h.scrollLeft || 0);
g -= (h.scrollTop || 0);
}
a = Sys.UI.DomElement._getCurrentStyle(h);
var i = a ? a.position : null;
if (i && (i === "absolute")) {
break;
}
}
}
return new Sys.UI.Point(f, g);
};
} else {
$telerik.originalGetLocation = function (c) {
var b = Function._validateParams(arguments, [{name: "element", domElement: true}]);
if (b) {
throw b;
}
if ((c.window && (c.window === c)) || c.nodeType === 9) {
return new Sys.UI.Point(0, 0);
}
var f = 0, g = 0, h, i = null, j = null, a = null, k;
for (h = c;
h;
i = h, j = a, h = h.offsetParent) {
k = h.tagName ? h.tagName.toUpperCase() : null;
a = Sys.UI.DomElement._getCurrentStyle(h);
if ((h.offsetLeft || h.offsetTop) && !((k === "BODY") && (!j || j.position !== "absolute"))) {
f += h.offsetLeft;
g += h.offsetTop;
}
if (i !== null && a) {
if ((k !== "TABLE") && (k !== "TD") && (k !== "HTML")) {
f += parseInt(a.borderLeftWidth, 10) || 0;
g += parseInt(a.borderTopWidth, 10) || 0;
}
if (k === "TABLE" && (a.position === "relative" || a.position === "absolute")) {
f += parseInt(a.marginLeft, 10) || 0;
g += parseInt(a.marginTop, 10) || 0;
}
}
}
a = Sys.UI.DomElement._getCurrentStyle(c);
var d = a ? a.position : null;
if (!d || (d !== "absolute")) {
for (h = c.parentNode;
h;
h = h.parentNode) {
k = h.tagName ? h.tagName.toUpperCase() : null;
if ((k !== "BODY") && (k !== "HTML") && (h.scrollLeft || h.scrollTop)) {
f -= (h.scrollLeft || 0);
g -= (h.scrollTop || 0);
a = Sys.UI.DomElement._getCurrentStyle(h);
if (a) {
f += parseInt(a.borderLeftWidth, 10) || 0;
g += parseInt(a.borderTopWidth, 10) || 0;
}
}
}
}
return new Sys.UI.Point(f, g);
};
}
}
Sys.Application.add_init(function () {
try {
$telerik._borderThickness();
} catch (a) {
}
});
Telerik.Web.UI.Orientation = function () {
throw Error.invalidOperation();
};
Telerik.Web.UI.Orientation.prototype = {Horizontal: 0, Vertical: 1};
Telerik.Web.UI.Orientation.registerEnum("Telerik.Web.UI.Orientation", false);
Telerik.Web.UI.RenderMode = function () {
throw Error.invalidOperation();
};
Telerik.Web.UI.RenderMode.prototype = {Auto: 0, Classic: 1, Lite: 2, Native: 3, Mobile: 4};
Telerik.Web.UI.RenderMode.registerEnum("Telerik.Web.UI.RenderMode", false);
Telerik.Web.UI.DayOfWeek = function () {
throw Error.invalidOperation();
};
Telerik.Web.UI.DayOfWeek.prototype = {
Sunday: 0,
Monday: 1,
Tuesday: 2,
Wednesday: 3,
Thursday: 4,
Friday: 5,
Saturday: 6
};
Telerik.Web.UI.DayOfWeek.registerEnum("Telerik.Web.UI.DayOfWeek", false);
Telerik.Web.UI.RadWebControl = function (a) {
Telerik.Web.UI.RadWebControl.initializeBase(this, [a]);
this._clientStateFieldID = null;
this._renderMode = Telerik.Web.UI.RenderMode.Classic;
this._shouldUpdateClientState = true;
this._invisibleParents = [];
};
Telerik.Web.UI.RadWebControl.prototype = {
initialize: function () {
Telerik.Web.UI.RadWebControl.callBaseMethod(this, "initialize");
$telerik.registerControl(this);
if (!this.get_clientStateFieldID()) {
return;
}
var a = $get(this.get_clientStateFieldID());
if (!a) {
return;
}
a.setAttribute("autocomplete", "off");
}, dispose: function () {
$telerik.unregisterControl(this);
var c = this.get_element();
this._clearParentShowHandlers();
Telerik.Web.UI.RadWebControl.callBaseMethod(this, "dispose");
if (c) {
c.control = null;
var a = true;
if (c._events) {
for (var b in c._events) {
if (c._events[b].length > 0) {
a = false;
break;
}
}
if (a) {
c._events = null;
}
}
}
}, raiseEvent: function (b, a) {
var c = this.get_events().getHandler(b);
if (c) {
if (!a) {
a = Sys.EventArgs.Empty;
}
c(this, a);
}
}, updateClientState: function () {
if (this._shouldUpdateClientState) {
this.set_clientState(this.saveClientState());
}
}, saveClientState: function () {
return null;
}, get_clientStateFieldID: function () {
return this._clientStateFieldID;
}, set_clientStateFieldID: function (a) {
if (this._clientStateFieldID != a) {
this._clientStateFieldID = a;
this.raisePropertyChanged("ClientStateFieldID");
}
}, get_renderMode: function () {
return this._renderMode;
}, set_renderMode: function (a) {
if (this._renderMode != a) {
this._renderMode = a;
this.raisePropertyChanged("RenderMode");
}
}, get_clientState: function () {
if (this._clientStateFieldID) {
var a = document.getElementById(this._clientStateFieldID);
if (a) {
return a.value;
}
}
return null;
}, set_clientState: function (b) {
if (this._clientStateFieldID) {
var a = document.getElementById(this._clientStateFieldID);
if (a) {
a.value = b;
}
}
}, repaint: function () {
}, canRepaint: function () {
return this.get_element().offsetWidth > 0;
}, add_parentShown: function (a) {
var b = $telerik.getInvisibleParent(a);
if (!b) {
return;
}
if (!Array.contains(this._invisibleParents, b)) {
Array.add(this._invisibleParents, b);
this._handleHiddenParent(true, b);
}
}, remove_parentShown: function (a) {
Array.remove(this._invisibleParents, a);
this._handleHiddenParent(false, a);
}, _handleHiddenParent: function (e, d) {
if (!d) {
return;
}
if (!this._parentShowDelegate) {
this._parentShowDelegate = Function.createDelegate(this, this._parentShowHandler);
}
var a = this._parentShowDelegate;
if (typeof(MutationObserver) !== "undefined") {
if (e) {
if (!this.parentShownObserver) {
this.parentShownObserver = new Telerik.Web.UI.NodeMutationObserver(a);
}
this.parentShownObserver.observe(d, {
attributes: true,
attributeOldValue: true,
attributeFilter: ["style", "class"],
subtree: false
});
} else {
if (this.parentShownObserver) {
this.parentShownObserver.disconnect(d);
if (this.parentShownObserver.isEmpty()) {
this.parentShownObserver.dispose();
this.parentShownObserver = null;
}
}
}
return;
}
var b = "DOMAttrModified";
if ($telerik.isIE) {
b = "propertychange";
}
var c = e ? $telerik.addExternalHandler : $telerik.removeExternalHandler;
c(d, b, a);
}, _parentShowHandler: function (c) {
if (c.length !== null && !isNaN(c.length)) {
var a = this;
Array.forEach(c, function (g) {
if (g.attributeName == "style" || g.attributeName == "class") {
var e = g.target;
if ("none" != $telerik.getCurrentStyle(e, "display")) {
a._runWhenParentShows(g);
}
}
});
} else {
if ($telerik.isIE) {
if (c.rawEvent) {
var c = c.rawEvent;
}
if (!c || !c.srcElement || !c.propertyName) {
return;
}
var f = c.srcElement;
if (c.propertyName == "style.display" || c.propertyName == "className") {
var b = $telerik.getCurrentStyle(f, "display");
if (b != "none") {
c.target = f;
this._runWhenParentShows(c);
}
}
} else {
if (c.attrName == "style" || c.attrName == "class") {
var d = c.target;
if ((c.currentTarget == c.target) && ("none" != $telerik.getCurrentStyle(d, "display"))) {
window.setTimeout(Function.createDelegate(this, function () {
this._runWhenParentShows(c);
}), 0);
}
}
}
}
}, _runWhenParentShows: function (a) {
var b = a.target;
this.remove_parentShown(b);
this.repaint();
}, _clearParentShowHandlers: function () {
var a = this._invisibleParents;
for (var b = 0;
b < a.length;
b++) {
this.remove_parentShown(a[b]);
}
this._invisibleParents = [];
this._parentShowDelegate = null;
}, _getChildElement: function (a) {
return $get(this.get_id() + "_" + a);
}, _findChildControl: function (a) {
return $find(this.get_id() + "_" + a);
}
};
Telerik.Web.UI.RadWebControl.registerClass("Telerik.Web.UI.RadWebControl", Sys.UI.Control);
Telerik.Web.Timer = function () {
Telerik.Web.Timer.initializeBase(this);
this._interval = 1000;
this._enabled = false;
this._timer = null;
this._timerCallbackDelegate = Function.createDelegate(this, this._timerCallback);
};
Telerik.Web.Timer.prototype = {
get_interval: function () {
return this._interval;
}, set_interval: function (a) {
if (this._interval !== a) {
this._interval = a;
this.raisePropertyChanged("interval");
if (!this.get_isUpdating() && (this._timer !== null)) {
this._stopTimer();
this._startTimer();
}
}
}, get_enabled: function () {
return this._enabled;
}, set_enabled: function (a) {
if (a !== this.get_enabled()) {
this._enabled = a;
this.raisePropertyChanged("enabled");
if (!this.get_isUpdating()) {
if (a) {
this._startTimer();
} else {
this._stopTimer();
}
}
}
}, add_tick: function (a) {
this.get_events().addHandler("tick", a);
}, remove_tick: function (a) {
this.get_events().removeHandler("tick", a);
}, dispose: function () {
this.set_enabled(false);
this._stopTimer();
Telerik.Web.Timer.callBaseMethod(this, "dispose");
}, updated: function () {
Telerik.Web.Timer.callBaseMethod(this, "updated");
if (this._enabled) {
this._stopTimer();
this._startTimer();
}
}, _timerCallback: function () {
var a = this.get_events().getHandler("tick");
if (a) {
a(this, Sys.EventArgs.Empty);
}
}, _startTimer: function () {
this._timer = window.setInterval(this._timerCallbackDelegate, this._interval);
}, _stopTimer: function () {
window.clearInterval(this._timer);
this._timer = null;
}
};
Telerik.Web.Timer.registerClass("Telerik.Web.Timer", Sys.Component);
Telerik.Web.BoxSide = function () {
};
Telerik.Web.BoxSide.prototype = {Top: 0, Right: 1, Bottom: 2, Left: 3};
Telerik.Web.BoxSide.registerEnum("Telerik.Web.BoxSide", false);
Telerik.Web.UI.WebServiceLoaderEventArgs = function (a) {
Telerik.Web.UI.WebServiceLoaderEventArgs.initializeBase(this);
this._context = a;
};
Telerik.Web.UI.WebServiceLoaderEventArgs.prototype = {
get_context: function () {
return this._context;
}
};
Telerik.Web.UI.WebServiceLoaderEventArgs.registerClass("Telerik.Web.UI.WebServiceLoaderEventArgs", Sys.EventArgs);
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs = function (b, a) {
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs.initializeBase(this, [a]);
this._data = b;
};
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs.prototype = {
get_data: function () {
return this._data;
}
};
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs.registerClass("Telerik.Web.UI.WebServiceLoaderSuccessEventArgs", Telerik.Web.UI.WebServiceLoaderEventArgs);
Telerik.Web.UI.WebServiceLoaderErrorEventArgs = function (b, a) {
Telerik.Web.UI.WebServiceLoaderErrorEventArgs.initializeBase(this, [a]);
this._message = b;
};
Telerik.Web.UI.WebServiceLoaderErrorEventArgs.prototype = {
get_message: function () {
return this._message;
}
};
Telerik.Web.UI.WebServiceLoaderErrorEventArgs.registerClass("Telerik.Web.UI.WebServiceLoaderErrorEventArgs", Telerik.Web.UI.WebServiceLoaderEventArgs);
Telerik.Web.UI.WebServiceLoader = function (a) {
this._webServiceSettings = a;
this._events = null;
this._onWebServiceSuccessDelegate = Function.createDelegate(this, this._onWebServiceSuccess);
this._onWebServiceErrorDelegate = Function.createDelegate(this, this._onWebServiceError);
this._currentRequest = null;
};
Telerik.Web.UI.WebServiceLoader.prototype = {
get_webServiceSettings: function () {
return this._webServiceSettings;
}, get_events: function () {
if (!this._events) {
this._events = new Sys.EventHandlerList();
}
return this._events;
}, loadData: function (b, a) {
var c = this.get_webServiceSettings();
this.invokeMethod(c.get_method(), b, a);
}, invokeMethod: function (d, b, a) {
var f = this.get_webServiceSettings();
if (f.get_isEmpty()) {
alert("Please, specify valid web service and method.");
return;
}
this._raiseEvent("loadingStarted", new Telerik.Web.UI.WebServiceLoaderEventArgs(a));
var e = f.get_path();
var c = f.get_useHttpGet();
this._currentRequest = Sys.Net.WebServiceProxy.invoke(e, d, c, b, this._onWebServiceSuccessDelegate, this._onWebServiceErrorDelegate, a);
}, add_loadingStarted: function (a) {
this.get_events().addHandler("loadingStarted", a);
}, add_loadingError: function (a) {
this.get_events().addHandler("loadingError", a);
}, add_loadingSuccess: function (a) {
this.get_events().addHandler("loadingSuccess", a);
}, _serializeDictionaryAsKeyValuePairs: function (a) {
var c = [];
for (var b in a) {
c[c.length] = {Key: b, Value: a[b]};
}
return c;
}, _onWebServiceSuccess: function (b, a) {
var c = new Telerik.Web.UI.WebServiceLoaderSuccessEventArgs(b, a);
this._raiseEvent("loadingSuccess", c);
}, _onWebServiceError: function (b, a) {
var c = new Telerik.Web.UI.WebServiceLoaderErrorEventArgs(b.get_message(), a);
this._raiseEvent("loadingError", c);
}, _raiseEvent: function (b, a) {
var c = this.get_events().getHandler(b);
if (c) {
if (!a) {
a = Sys.EventArgs.Empty;
}
c(this, a);
}
}
};
Telerik.Web.UI.WebServiceLoader.registerClass("Telerik.Web.UI.WebServiceLoader");
Telerik.Web.UI.WebServiceSettings = function (a) {
this._path = null;
this._method = null;
this._useHttpGet = false;
this._odata = false;
if (!a) {
a = {};
}
if (typeof(a.path) != "undefined") {
this._path = a.path;
}
if (typeof(a.method) != "undefined") {
this._method = a.method;
}
if (typeof(a.useHttpGet) != "undefined") {
this._useHttpGet = a.useHttpGet;
}
};
Telerik.Web.UI.WebServiceSettings.prototype = {
get_isWcf: function () {
return /\.svc($|\/)/.test(this._path) && !this.get_isOData();
}, get_isOData: function () {
return this._odata;
}, get_path: function () {
return this._path;
}, set_path: function (a) {
this._path = a;
}, get_method: function () {
return this._method;
}, set_method: function (a) {
this._method = a;
}, get_useHttpGet: function () {
return this._useHttpGet;
}, set_useHttpGet: function (a) {
this._useHttpGet = a;
}, get_isEmpty: function () {
var b = this.get_path();
var a = this.get_method();
return (!(b && a));
}
};
Telerik.Web.UI.WebServiceSettings.registerClass("Telerik.Web.UI.WebServiceSettings");
Telerik.Web.UI.CallbackLoader = function (a) {
this._callbackSettings = a;
};
Telerik.Web.UI.CallbackLoader.prototype = {
invokeCallbackMethod: function () {
WebForm_DoCallback(this._callbackSettings._id, this._callbackSettings._arguments, this._callbackSettings._onCallbackSuccess, this._callbackSettings._context, this._callbackSettings._onCallbackError, this._callbackSettings._isAsync);
}
};
Telerik.Web.UI.CallbackLoader.registerClass("Telerik.Web.UI.CallbackLoader");
Telerik.Web.UI.CallbackSettings = function (a) {
this._id = a.id;
this._arguments = a.arguments;
this._onCallbackSuccess = a.onCallbackSuccess;
this._context = a.context;
this._onCallbackError = a.onCallbackError;
this._isAsync = a.isAsync;
};
Telerik.Web.UI.CallbackSettings.registerClass("Telerik.Web.UI.CallbackSettings");
Telerik.Web.UI.ActionsManager = function (a) {
Telerik.Web.UI.ActionsManager.initializeBase(this);
this._actions = [];
this._currentActionIndex = -1;
};
Telerik.Web.UI.ActionsManager.prototype = {
get_actions: function () {
return this._actions;
}, shiftPointerLeft: function () {
this._currentActionIndex--;
}, shiftPointerRight: function () {
this._currentActionIndex++;
}, get_currentAction: function () {
return this.get_actions()[this._currentActionIndex];
}, get_nextAction: function () {
return this.get_actions()[this._currentActionIndex + 1];
}, addAction: function (a) {
if (a) {
var b = new Telerik.Web.UI.ActionsManagerEventArgs(a);
this.raiseEvent("executeAction", b);
this._clearActionsToRedo();
Array.add(this._actions, a);
this._currentActionIndex = this._actions.length - 1;
return true;
}
return false;
}, undo: function (d) {
if (d == null) {
d = 1;
}
if (d > this._actions.length) {
d = this._actions.length;
}
var c = 0;
var a = null;
while (0 < d-- && 0 <= this._currentActionIndex && this._currentActionIndex < this._actions.length) {
a = this._actions[this._currentActionIndex--];
if (a) {
var b = new Telerik.Web.UI.ActionsManagerEventArgs(a);
this.raiseEvent("undoAction", b);
c++;
}
}
}, redo: function (e) {
if (e == null) {
e = 1;
}
if (e > this._actions.length) {
e = this._actions.length;
}
var d = 0;
var a = null;
var b = this._currentActionIndex + 1;
while (0 < e-- && 0 <= b && b < this._actions.length) {
a = this._actions[b];
if (a) {
var c = new Telerik.Web.UI.ActionsManagerEventArgs(a);
this.raiseEvent("redoAction", c);
this._currentActionIndex = b;
d++;
}
b++;
}
}, removeActionAt: function (a) {
this._actions.splice(a, 1);
if (this._currentActionIndex >= a) {
this._currentActionIndex--;
}
}, canUndo: function () {
return (-1 < this._currentActionIndex);
}, canRedo: function () {
return (this._currentActionIndex < this._actions.length - 1);
}, getActionsToUndo: function () {
if (this.canUndo()) {
return (this._actions.slice(0, this._currentActionIndex + 1)).reverse();
}
return [];
}, getActionsToRedo: function () {
if (this.canRedo()) {
return this._actions.slice(this._currentActionIndex + 1);
}
return [];
}, _clearActionsToRedo: function () {
if (this.canRedo()) {
var a = this._currentActionIndex + 2;
if (a < this._actions.length) {
this._actions.splice(a, this._actions.length - a);
}
}
}, add_undoAction: function (a) {
this.get_events().addHandler("undoAction", a);
}, remove_undoAction: function (a) {
this.get_events().removeHandler("undoAction", a);
}, add_redoAction: function (a) {
this.get_events().addHandler("redoAction", a);
}, remove_redoAction: function (a) {
this.get_events().removeHandler("redoAction", a);
}, add_executeAction: function (a) {
this.get_events().addHandler("executeAction", a);
}, remove_executeAction: function (a) {
this.get_events().removeHandler("executeAction", a);
}, raiseEvent: function (b, a) {
var c = this.get_events().getHandler(b);
if (c) {
c(this, a);
}
}
};
Telerik.Web.UI.ActionsManager.registerClass("Telerik.Web.UI.ActionsManager", Sys.Component);
Telerik.Web.UI.ActionsManagerEventArgs = function (a) {
Telerik.Web.UI.ActionsManagerEventArgs.initializeBase(this);
this._action = a;
};
Telerik.Web.UI.ActionsManagerEventArgs.prototype = {
get_action: function () {
return this._action;
}
};
Telerik.Web.UI.ActionsManagerEventArgs.registerClass("Telerik.Web.UI.ActionsManagerEventArgs", Sys.CancelEventArgs);
Telerik.Web.StringBuilder = function (a) {
this._buffer = a || [];
};
Telerik.Web.StringBuilder.prototype = {
append: function (b) {
for (var a = 0;
a < arguments.length;
a++) {
this._buffer[this._buffer.length] = arguments[a];
}
return this;
}, toString: function () {
return this._buffer.join("");
}, get_buffer: function () {
return this._buffer;
}
};
Telerik.Web.UI.RadTemplateBoundEventArgs = function (a, c, b) {
Telerik.Web.UI.RadTemplateBoundEventArgs.initializeBase(this);
this._dataItem = a;
this._template = c;
this._html = b;
};
Telerik.Web.UI.RadTemplateBoundEventArgs.prototype = {
get_dataItem: function () {
return this._dataItem;
}, set_html: function (a) {
this._html = a;
}, get_html: function (a) {
return this._html;
}, get_template: function (a) {
return this._template;
}
};
Telerik.Web.UI.RadTemplateBoundEventArgs.registerClass("Telerik.Web.UI.RadTemplateBoundEventArgs", Sys.EventArgs);
(function () {
function g() {
if ($telerik.$) {
return $telerik.$.extend.apply($telerik.$, arguments);
}
var n = arguments[0] && typeof(arguments[0]) === "object" ? arguments[0] : {};
for (var k = 1;
k < arguments.length;
k++) {
var m = arguments[k];
if (m != null) {
for (var l in m) {
var j = m[l];
if (typeof(j) !== "undefined") {
n[l] = j;
}
}
}
}
return n;
}
function b(j, l) {
if (l) {
return "'" + j.split("'").join("\\'").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t") + "'";
} else {
var i = j.charAt(0), k = j.substring(1);
if (i === "=") {
return "+(" + k + ")+";
} else {
if (i === ":") {
return "+e(" + k + ")+";
} else {
return ";" + j + ";o+=";
}
}
}
}
var a = /^\w+/, d = /\${([^}]*)}/g, e = /\\}/g, c = /__CURLY__/g, f = /\\#/g, h = /__SHARP__/g;
Telerik.Web.UI.Template = {
paramName: "data", useWithBlock: true, render: function (m, i) {
var k, l, j = "";
for (k = 0, l = i.length;
k < l;
k++) {
j += m(i[k]);
}
return j;
}, compile: function (q, m) {
var p = g({}, this, m), n = p.paramName, i = n.match(a)[0], r = p.useWithBlock, k = "var o,e=$telerik.htmlEncode;", o, l;
if (typeof(q) === "function") {
if (q.length === 2) {
return function (s) {
return q($telerik.$ || jQuery, {data: s}).join("");
};
}
return q;
}
k += r ? "with(" + n + "){" : "";
k += "o=";
o = q.replace(e, "__CURLY__").replace(d, "#=e($1)#").replace(c, "}").replace(f, "__SHARP__").split("#");
for (l = 0;
l < o.length;
l++) {
k += b(o[l], l % 2 === 0);
}
k += r ? ";}" : ";";
k += "return o;";
k = k.replace(h, "#");
try {
return new Function(i, k);
} catch (j) {
throw new Error(String.format("Invalid template:'{0}' Generated code:'{1}'", q, k));
}
}
};
})();
(function () {
var a = $telerik;
var n = "touch";
var j = "pointer";
var f = "mouse";
var o = /touch/gi;
var k = /pointer/gi;
var g = /mouse/gi;
var d = 1;
var h = "pageX";
var i = "pageY";
var b = "clientX";
var c = "clientY";
var l = "screenX";
var m = "screenY";
var e = [h, i, b, c, l, m];
a.getEventLocation = function (q) {
var w = q.originalEvent || null;
var p = (w && w.changedTouches) ? w.changedTouches : [];
var s = w || q;
var r = {};
var u = e.length;
var t = null;
var v = null;
if (p && p.length === 1) {
s = p[0];
}
for (t = 0;
t < u;
t++) {
v = e[t];
r[v] = s[v] || q[v];
}
return r;
};
a.getTouchLocation = function (t) {
var q = {};
var s = null;
var r = e.length;
var p = null;
for (p = 0;
p < r;
p++) {
s = e[p];
q[s] = t[s];
}
return q;
};
a.getTouches = function (t) {
var w = t.type;
var v = null;
var u = t.currentTarget;
var y = t.originalEvent || null;
var z = [];
var p = null;
var s = null;
var q = (y && y.changedTouches) ? y.changedTouches : [];
var r = q.length;
var x = null;
v = a.getEventLocation(t);
if (w.match(o)) {
for (x = 0;
x < r;
x++) {
p = q[x];
s = a.getTouchLocation(p);
z.push({type: n, target: p.target, currentTarget: u, id: p.identifier, location: s, event: t});
}
} else {
if (w.match(k)) {
z.push({type: j, target: t.target, currentTarget: u, id: y.pointerId, location: v, event: t});
} else {
if (w.match(g)) {
z.push({type: f, target: t.target, currentTarget: u, id: d, location: v, event: t});
} else {
z.push({type: w, target: t.target, currentTarget: u, id: d, location: v, event: t});
}
}
}
return z;
};
})();
(function () {
if (Sys && Sys.WebForms && Sys.WebForms.PageRequestManager) {
Sys.WebForms.PageRequestManager.prototype._onFormElementClick = function (a) {
if (window.navigator.msPointerEnabled) {
this._activeDefaultButtonClicked = (a.target === this._activeDefaultButton);
this._onFormElementActive(a.target, parseInt(a.offsetX, 10), parseInt(a.offsetY, 10));
} else {
this._activeDefaultButtonClicked = (a.target === this._activeDefaultButton);
this._onFormElementActive(a.target, a.offsetX, a.offsetY);
}
};
}
}());
(function (b) {
Type.registerNamespace("Telerik.Web.UI");
var a = Telerik.Web.UI;
a.NodeMutationObserver = function (c) {
this.callback = c;
this.mutations = [];
};
a.NodeMutationObserver.prototype = {
observe: function (d, e) {
if (typeof(MutationObserver) === "undefined") {
return;
}
var c = new MutationObserver(this.callback);
c.observe(d, e);
this.mutations.push({node: d, mutation: c});
}, disconnect: function (d) {
var c = this.findMutationIndex(d);
if (c == -1) {
return;
}
var e = this.mutations[c];
e.mutation.disconnect();
Array.removeAt(this.mutations, c);
}, findMutationIndex: function (e) {
var d = this.mutations;
for (var c = 0;
c < d.length;
c++) {
var f = d[c];
if (f.node === e) {
return c;
}
}
return -1;
}, isEmpty: function () {
return this.mutations.length === 0;
}, dispose: function () {
while (this.mutations.length) {
this.mutations.pop().mutation.disconnect();
}
this.callback = null;
}
};
})();
/* END Telerik.Web.UI.Common.Core.js */
/* START Telerik.Web.UI.Grid.RadGridScripts.js */
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.GridColumn = function (a) {
Telerik.Web.UI.GridColumn.initializeBase(this, [a]);
this._owner = {};
this._data = {};
this._selected;
this._selectedCellsCount = 0;
this._resizeTolerance = $telerik.isTouchDevice ? 10 : 5;
this._onMouseUpDelegate = null;
this._columnResizer = null;
this._checkboxes = [];
this._onContextMenuItemClickingDelegate = null;
this._onContextMenuHiddenDelegate = null;
this._supportedStringAggregatesValues = {
"System.String": {
Count: true,
CountDistinct: true,
None: true,
Custom: true
},
"System.DateTime": {
None: true,
Min: true,
Max: true,
Last: true,
First: true,
Count: true,
CountDistinct: true,
Custom: true
}
};
this._supportedColumnTypesForAggregation = ["GridDateTimeColumn", "GridBoundColumn", "GridTemplateColumn", "GridMaskedColumn", "GridNumericColumn", "GridCalculatedColumn"];
this._oldTitle = null;
if (Sys.UI.DomElement.containsCssClass(a, "rgRotateHeader") && a.children.length == 0) {
var b = document.createElement("span");
b.innerHTML = a.innerHTML;
a.innerHTML = "";
a.appendChild(b);
}
};
Telerik.Web.UI.GridColumn.prototype = {
initialize: function () {
Telerik.Web.UI.GridColumn.callBaseMethod(this, "initialize");
this._onMouseDownDelegate = $telerik.addMobileHandler(this, this.get_element(), "mousedown", this._onMouseDownHandler);
this.get_element().UniqueName = this.get_uniqueName();
this._onLocalMouseMoveDelegate = $telerik.addMobileHandler(this, this.get_element(), "mousemove", this._onLocalMouseMoveHandler);
if (!$telerik.isTouchDevice) {
$addHandlers(this.get_element(), {click: Function.createDelegate(this, this._onClick)});
$addHandlers(this.get_element(), {dblclick: Function.createDelegate(this, this._onDblClick)});
$addHandlers(this.get_element(), {mouseover: Function.createDelegate(this, this._onMouseOver)});
$addHandlers(this.get_element(), {mouseout: Function.createDelegate(this, this._onMouseOut)});
}
var a = this._owner._owner;
var b = a.ClientSettings;
if ($telerik.isMobileIE10 && (b.AllowColumnsReorder || (b.Resizing && b.Resizing.AllowColumnResize))) {
this.get_element().style.msTouchAction = "none";
}
if ($telerik.isOpera) {
$addHandlers(this.get_element(), {mousedown: Function.createDelegate(this, this._onContextMenu)});
} else {
$addHandlers(this.get_element(), {contextmenu: Function.createDelegate(this, this._onContextMenu)});
}
this._selectedCellsCount = this._data.SelectedCellsCount;
this.Display = this._data.Display;
this._oldTitle = this.get_element().title;
if (this._data.ListOfFilterValues && this._data.ListOfFilterValues.length > 0) {
a._checkListFilterKeys[a._checkListFilterKeys.length] = this.get_owner()._data.UniqueID + "," + this.get_uniqueName();
a._checkListFilterValues[a._checkListFilterValues.length] = this._data.ListOfFilterValues;
}
this._initializeBindingMethods();
}, dispose: function () {
if (this._columnResizer) {
this._columnResizer.dispose();
}
this._owner._owner.raise_columnDestroying(Sys.EventArgs.Empty);
$clearHandlers(this.get_element());
this._checkboxes = [];
this._element.control = null;
this._owner = null;
Telerik.Web.UI.GridColumn.callBaseMethod(this, "dispose");
}, get_owner: function () {
return this._owner;
}, get_selected: function () {
var a = false;
if (this._owner._owner.get_allowColumnSelection() && this._selectedCellsCount > 0 && this._selectedCellsCount == this.get_realOwner().get_dataItems().length) {
a = true;
}
return a;
}, set_selected: function (a) {
if (this._owner._owner.get_allowColumnSelection()) {
if (a) {
if (!this._owner._owner.get_allowMultiColumnSelection()) {
this.get_realOwner().clearSelectedColumns();
}
this._owner._owner._cellSelection._selectColumnByHeaderElement(this.get_realOwner(), this.get_element());
this._selectedCellsCount = this._owner.get_dataItems().length;
} else {
this._owner._owner._cellSelection._deselectColumnByHeaderElement(this.get_realOwner(), this.get_element());
this._selectedCellsCount = 0;
}
}
}, get_realOwner: function () {
if (this._owner.get_id() == this._owner._owner.get_masterTableView().get_id() + "_Header") {
return this._owner._owner.get_masterTableView();
} else {
return $find(this._owner.get_id());
}
}, get_selectedCellsCount: function () {
return this._selectedCellsCount;
}, set_selectedCellsCount: function (a) {
this._selectedCellsCount = a;
}, _initializeBindingMethods: function () {
var a = Telerik.Web.UI.Grid[this._data.ColumnType] || Telerik.Web.UI.Grid.GridBoundColumn, c = (function () {
}), b;
if (a) {
for (b in a) {
this[b] = a[b];
}
this.initializeCell = this.initializeCell || c;
this.populateCell = this.populateCell || c;
this.populateEditCell = this.populateEditCell || c;
}
}, _onMouseDownHandler: function (a) {
if ((a.button != Sys.UI.MouseButton.leftButton || Telerik.Web.UI.Grid._moveHeaderDiv) && !($telerik.isTouchDevice)) {
return false;
}
var b = this.get_owner().get_owner();
var c = b._animation && b._animation.ColumnAnimation;
var f = $telerik.isTouchDevice && this._isTouchPointOverResizeHandle(a) && this._owner._owner.ClientSettings && this._owner._owner.ClientSettings.Resizing.AllowColumnResize && this.get_resizable();
if (!c) {
this._onMouseUpDelegate = $telerik.addMobileHandler(this, document, "mouseup", this._onMouseUpHandler, null, true);
}
if ($telerik.isTouchDevice) {
this._canDragDrop = true;
if (f) {
this._canResize = true;
}
}
if (b.ClientSettings.AllowDragToGroup || b.ClientSettings.AllowColumnsReorder) {
var d = b.ClientSettings.AllowColumnsReorder && c && b.ClientSettings.Animation.AllowColumnReorderAnimation && b.ClientSettings.ColumnsReorderMethod === 1;
if (!d) {
this._onMouseMoveDelegate = $telerik.addMobileHandler(this, document, "mousemove", this._onMouseMoveHandler, null, true);
}
if (this._canDragDrop && !f && ((this._data.Reorderable && b.ClientSettings.AllowColumnsReorder) || (this._data.Groupable && b.ClientSettings.AllowDragToGroup))) {
if (c) {
b._animation.ColumnAnimation._mouseDown(a, this);
} else {
Telerik.Web.UI.Grid.CreateDragDrop(a, this, true);
}
}
}
if (this._canResize && (a.button == 0 || $telerik.isTouchDevice)) {
if (this._isMouseOverResizeHandle(a)) {
this._columnResizer = new Telerik.Web.UI.GridColumnResizer(this, b.ClientSettings.Resizing.EnableRealTimeResize);
this._columnResizer._position(a);
this._owner._owner._isResize = true;
}
Telerik.Web.UI.Grid.ClearDocumentEvents();
}
}, _onMouseUpHandler: function (f) {
if (this._onMouseUpDelegate) {
$telerik.removeMobileHandler(document, "mouseup", this._onMouseUpDelegate, null, true);
this._onMouseUpDelegate = null;
}
if (this._onMouseMoveDelegate) {
$telerik.removeMobileHandler(document, "mousemove", this._onMouseMoveDelegate, null, true);
this._onMouseMoveDelegate = null;
}
if (!Telerik.Web.UI.Grid) {
return;
}
var d;
if ($telerik.isTouchDevice) {
d = $telerik.getTouchTarget(f);
} else {
d = Telerik.Web.UI.Grid.GetCurrentElement(f);
}
var k = false;
var i = this._owner;
if (d != null && this._canDragDrop && !this._owner._owner._isResize) {
var j = this._owner._owner.ClientSettings.PostBackFunction;
j = j.replace("{0}", this._owner._owner.UniqueID);
if (i._owner.ClientSettings.AllowDragToGroup && i._owner._groupPanel) {
var h = false;
if ($telerik.isMouseOverElement(i._owner._groupPanel.get_element(), f)) {
h = true;
}
if ((Telerik.Web.UI.Grid.IsChildOf(d, this._owner._owner._groupPanel.get_element()) || ($telerik.isTouchDevice && d == this._owner._owner._groupPanel.get_element())) || h) {
if (this._data.Groupable) {
k = true;
this._owner.groupColumn(this.get_element().UniqueName);
}
}
}
if (this._owner._owner.ClientSettings.AllowColumnsReorder && Telerik.Web.UI.Grid.IsChildOf(d, this.get_element().parentNode) && d != this.get_element()) {
var g = d.parentNode;
while (g != null && (typeof(g.UniqueName) == "undefined")) {
g = g.parentNode;
}
if (g != null && typeof(g.UniqueName) != "undefined" && g.UniqueName != this.get_uniqueName()) {
d = g;
}
if (typeof(d.UniqueName) != "undefined" && this._canDropOnThisColumn(d.UniqueName) && this.get_reorderable()) {
if (!this._owner._owner.ClientSettings.ReorderColumnsOnClient) {
var b = this._owner.getColumnByUniqueName(this.get_element().UniqueName);
var c = this._owner.getColumnByUniqueName(d.UniqueName);
var a = new Sys.CancelEventArgs();
a.get_gridSourceColumn = function () {
return b;
};
a.get_gridTargetColumn = function () {
return c;
};
this._owner._owner.raise_columnSwapping(a);
if (a.get_cancel()) {
return false;
}
k = true;
j = j.replace("{1}", "ReorderColumns," + this._owner._data.UniqueID + "," + this.get_element().UniqueName + "," + d.UniqueName);
eval(j);
} else {
if (this._owner._owner.ClientSettings.ColumnsReorderMethod == 1) {
this._owner.reorderColumns(this.get_element().UniqueName, d.UniqueName);
} else {
this._owner.swapColumns(this.get_element().UniqueName, d.UniqueName);
}
k = true;
}
}
}
}
if (!this._owner._owner._animation || !this._owner._owner.ClientSettings.Animation || !this._owner._owner.ClientSettings.Animation.AllowColumnRevertAnimation || k) {
Telerik.Web.UI.Grid.DestroyDragDrop();
}
this._owner._owner._isResize = null;
Telerik.Web.UI.Grid.RestoreDocumentEvents();
}, _onMouseMoveHandler: function (a) {
if (this._canDragDrop) {
if (!this.get_element()) {
return;
}
if ($telerik.isTouchDevice) {
a.preventDefault();
}
Telerik.Web.UI.Grid.MoveDragDrop(a, this, true);
}
}, _onLocalMouseMoveHandler: function (f) {
if (!Telerik.Web.UI.Grid || $telerik.isTouchDevice) {
return;
}
this._canDragDrop = true;
this._canResize = false;
if (this._owner._owner._isResize) {
return;
}
var d = Telerik.Web.UI.Grid.GetCurrentElement(f);
var g = Telerik.Web.UI.Grid.GetFirstParentByTagName(d, "th");
var h = Telerik.Web.UI.Grid.FindPosX(d);
var b = !!this._owner._owner.ClientSettings.AllowDragToGroup && this._data.Groupable;
var c = !!this._owner._owner.ClientSettings.AllowColumnsReorder && this.get_reorderable();
if (b || c) {
this.get_element().title = this._owner._owner.ClientSettings.ClientMessages.DragToGroupOrReorder;
this.get_element().style.cursor = "move";
}
if (this._owner._owner.ClientSettings.Resizing.AllowColumnResize && this.get_resizable() && Telerik.Web.UI.Grid.GetEventPosX(f) >= (h + g.offsetWidth - 5) && !Telerik.Web.UI.Grid._moveHeaderDiv) {
this._canDragDrop = false;
}
if (this._owner._owner.ClientSettings && this._owner._owner.ClientSettings.Resizing.AllowColumnResize && this.get_resizable() && this.get_element().tagName.toLowerCase() == "th") {
var d = Telerik.Web.UI.Grid.GetCurrentElement(f);
if (this._owner._owner.GridDataDiv && !this._owner._owner.GridHeaderDiv && !window.netscape) {
var a = 0;
if (document.body.currentStyle && document.body.currentStyle.margin && document.body.currentStyle.marginLeft.indexOf("px") != -1 && !window.opera) {
a = parseInt(document.body.currentStyle.marginLeft);
}
this._resizeTolerance = 10;
}
if (this._isMouseOverResizeHandle(f) && !Telerik.Web.UI.Grid._moveHeaderDiv) {
this.get_element().style.cursor = "e-resize";
if (this.get_element().title !== this._owner._owner.ClientSettings.ClientMessages.DragToResize) {
this._oldTitle = this.get_element().title;
}
this.get_element().title = this._owner._owner.ClientSettings.ClientMessages.DragToResize;
this._canResize = true;
d.style.cursor = "e-resize";
} else {
if (this.get_element().style.cursor != "move") {
this.get_element().style.cursor = "";
d.style.cursor = "";
this.get_element().title = this._oldTitle;
}
if (d.style.cursor == "e-resize") {
d.style.cursor = "";
}
this._canResize = false;
}
}
}, _canDropOnThisColumn: function (c) {
if (typeof(this._owner._columns) == "undefined") {
this._owner._columns = {};
for (var a = 0;
a < this._owner._data._columnsData.length;
a++) {
this._owner._columns[this._owner._data._columnsData[a].UniqueName] = this._owner._data._columnsData[a];
}
}
var b = true;
if (this._owner._hasMultiHeaders) {
b = this.get_columnGroupName() == this._owner._columns[c].ColumnGroupName;
}
return this._owner._columns[c].Reorderable && b;
}, showHeaderMenu: function (a, b, c) {
if (this._owner._data.enableHeaderContextMenu) {
this._initHeaderContextMenu(a, true, b, c);
}
}, _shouldShowAggregatesMenuForColumn: function () {
return this.get_owner()._data.enableHeaderContextAggregatesMenu && Array.contains(this._supportedColumnTypesForAggregation, this._data.ColumnType);
}, _initHeaderContextAggregatesMenu: function (d) {
if (d.findItemByValue("AggregatesContainer")) {
var a = d.findItemByValue("AggregatesContainer");
if (this._shouldShowAggregatesMenuForColumn()) {
a.set_visible(true);
var c = a.get_items();
for (var e = 0, f = c.get_count();
e < f;
e++) {
var b = c.getItem(e);
b._column = this;
if (this._supportedStringAggregatesValues[this.get_dataType()] && !this._supportedStringAggregatesValues[this.get_dataType()][b.get_value()]) {
b.set_visible(false);
} else {
b.set_visible(true);
}
}
} else {
a.set_visible(false);
}
}
}, _initHeaderContextMenu: function (m, r, z, A) {
if (this._owner._owner._getHeaderContextMenu()) {
var h = this._owner._owner._getHeaderContextMenu();
var k = this;
if (h._shown) {
h.hide();
}
var l = k._data.DataField;
if (k._data.DataTextField) {
l = k._data.DataTextField;
} else {
if (k._data.DataAlternateTextField) {
l = k._data.DataAlternateTextField;
}
}
this._onContextMenuItemClickingDelegate = Function.createDelegate(h, this._onContextMenuItemClicking);
h.add_itemClicking(this._onContextMenuItemClickingDelegate);
this._onContextMenuHiddenDelegate = Function.createDelegate(this, this._onContextMenuHidden);
h.add_hidden(this._onContextMenuHiddenDelegate);
this._initHeaderContextAggregatesMenu(h);
if (h.findItemByValue("SortAsc")) {
h.findItemByValue("SortAsc")._column = k;
}
if (h.findItemByValue("SortDesc")) {
h.findItemByValue("SortDesc")._column = k;
}
if (h.findItemByValue("SortNone")) {
h.findItemByValue("SortNone")._column = k;
}
if (h.findItemByValue("GroupBy")) {
var s = h.findItemByValue("GroupBy");
if (k._data.Groupable) {
h.findItemByValue("GroupBy")._column = k;
s.set_visible(true);
} else {
s.set_visible(false);
}
}
if (h.findItemByValue("UnGroupBy")) {
var s = h.findItemByValue("UnGroupBy");
if (k._data.Groupable) {
h.findItemByValue("UnGroupBy")._column = k;
s.set_visible(true);
} else {
s.set_visible(false);
}
}
if (h.findItemByValue("topGroupSeperator")) {
h.findItemByValue("topGroupSeperator").set_visible(k._data.Groupable);
}
if (h.findItemByValue("bottomGroupSeperator")) {
h.findItemByValue("bottomGroupSeperator").set_visible(k._data.Groupable);
}
if (this._owner._data.enableHeaderContextFilterMenu && this._owner._data.AllowFilteringByColumn && k._data.AllowFiltering) {
if (h.findItemByValue("FilterMenuParent")) {
h.findItemByValue("FilterMenuParent").set_enabled(true);
h.findItemByValue("FilterMenuParent").set_visible(true);
}
if (h.findItemByValue("filterMenuSeparator")) {
h.findItemByValue("filterMenuSeparator").set_visible(true);
}
if (h.FilterControlsIDsHelper == null || typeof(h.FilterControlsIDsHelper) == "undefined") {
h.FilterControlsIDsHelper = {
IdPrefix: "HCFM",
IdSuffix: {FirstCond: "FirstCond", SecondCond: "SecondCond"},
FilterControl: {
CheckBox: "CB",
RadComboBox: "RCMB",
RadTextBox: "RTB",
RadDateInput: "RDI",
RadDatePicker: "RDP",
RadDateTimePicker: "RDTP",
RadTimePicker: "RTP",
RadNumericBox: "RNTB",
RadMaskedBox: "RMTB",
FilterButton: "FilterButton",
ClearFilterButton: "ClearFilterButton"
},
FirstFilterValueControl: null,
SecondFilterValueControl: null,
FilterControlsType: null,
getFilterControlID: function (i, e) {
return this.IdPrefix + i + e;
}
};
}
if (h.findItemByValue("FilterMenuParent") && h.findItemByValue("FilterMenuContainer") && k._data.AllowFiltering) {
h.trackChanges();
this._onContextMenuItemClosingDelegate = Function.createDelegate(h, this._onContextMenuItemClosing);
h.add_itemClosing(this._onContextMenuItemClosingDelegate);
var o = h.findItemByValue("FilterMenuContainer");
h.commitChanges();
this._updateDisplayHCMenuFilterControls(o.get_element(), h.FilterControlsIDsHelper);
this._updateFilterFunctionsForHCMenu(o.get_element(), h.FilterControlsIDsHelper);
this._updateFilterValuesForHCMenu(h.FilterControlsIDsHelper);
var n = $telerik.findElement(h.findItemByValue("FilterMenuContainer").get_element(), "HCFMFilterButton");
this._filterButtonClickDelegate = Function.createDelegate(this, this._filterButtonClickHandler);
$addHandler(n, "click", this._filterButtonClickDelegate);
var d = $telerik.findElement(h.findItemByValue("FilterMenuContainer").get_element(), "HCFMClearFilterButton");
d.onclick = "";
this._clearFilterButtonClickDelegate = Function.createDelegate(this, this._clearFilterButtonClickHandler);
$addHandler(d, "click", this._clearFilterButtonClickDelegate);
}
} else {
if (h.findItemByValue("FilterMenuParent") && this._owner._data.AllowFilteringByColumn) {
h.findItemByValue("FilterMenuParent").set_enabled(false);
} else {
if (h.findItemByValue("FilterMenuParent")) {
h.findItemByValue("FilterMenuParent").set_visible(false);
}
}
if (h.findItemByValue("filterMenuSeparator") && !this._owner._data.AllowFilteringByColumn) {
h.findItemByValue("filterMenuSeparator").set_visible(false);
}
}
var b = h.findItemByValue("BestFit");
if (b) {
b.set_visible(this.get_resizable());
b._column = this.get_resizable() ? this : null;
}
var c = h.findItemByValue("bestFitSeparator");
if (c) {
c.set_visible(b.get_visible());
}
if ($telerik.isIE6 && !h._detached) {
h._detach();
h._getContextMenuElement().style.visibility = "hidden";
h._getContextMenuElement().style.display = "block";
h.repaint();
}
var t = null;
var g = h.findItemByValue("ColumnsContainer");
if (g) {
t = h.findItemByValue("ColumnsContainer").get_items();
}
if (t) {
for (var p = 0, w = t.get_count();
p < w;
p++) {
var s = t.getItem(p);
s.set_visible(false);
for (var u = 0, x = k.get_owner().get_columns().length;
u < x;
u++) {
var f = k.get_owner().get_columns()[u];
if (s.get_value() == String.format("{0}|{1}", k.get_owner()._data.ClientID, f.get_uniqueName())) {
s.set_visible(true);
var q = s.get_element().getElementsByTagName("input");
if (q && q.length && q[0].type == "checkbox") {
$addHandler(q[0], "click", this._checkBoxClickHandler);
if (f.get_visible() && (f._data.Display == null || f._data.Display) && (f.Display == null || f.Display)) {
q[0].checked = true;
} else {
q[0].checked = false;
}
q[0]._column = f;
q[0]._index = u;
Array.add(this._checkboxes, q[0]);
break;
}
}
}
}
this._handleColumnsCheckboxesState();
}
var a = new Telerik.Web.UI.GridHeaderMenuCancelEventArgs(this, m, h);
this._owner._owner.raise_headerMenuShowing(a);
if (a.get_cancel()) {
return;
}
if (r) {
var y = $telerik.getLocation(this.get_element());
if (y) {
var v = y.x;
var B = y.y;
if (z) {
v = v + parseInt(z);
}
if (A) {
B = B + parseInt(A);
}
h.showAt(v, B);
$telerik.cancelRawEvent(m);
}
} else {
h.show(m);
}
}
}, _updateFilterValuesForHCMenu: function (g) {
var c = this._data.CurrentFilterValue;
var a = this._data.AndCurrentFilterValue;
if (g.FirstFilterValueControl) {
if (g.FilterControlsType == g.FilterControl.CheckBox) {
if (c.toString().toLowerCase() == "true") {
g.FirstFilterValueControl.checked = true;
} else {
g.FirstFilterValueControl.checked = false;
}
} else {
if (g.FilterControlsType == g.FilterControl.RadTextBox || g.FilterControlsType == g.FilterControl.RadMaskedBox || g.FilterControlsType == g.FilterControl.RadNumericBox) {
g.FirstFilterValueControl.set_value(c);
} else {
if (g.FilterControlsType == g.FilterControl.RadDateInput || g.FilterControlsType == g.FilterControl.RadDatePicker || g.FilterControlsType == g.FilterControl.RadDateTimePicker || g.FilterControlsType == g.FilterControl.RadTimePicker) {
var d = Date.parseLocale(c);
if (!d) {
try {
d = new Date(c);
} catch (f) {
}
}
if (!isNaN(d) && d != null && typeof(d) != "undefined") {
g.FirstFilterValueControl.set_selectedDate(d);
}
}
}
}
}
if (g.SecondFilterValueControl) {
if (g.FilterControlsType == g.FilterControl.CheckBox) {
if (a.toString().toLowerCase() == "true") {
g.SecondFilterValueControl.checked = true;
} else {
g.SecondFilterValueControl.checked = false;
}
} else {
if (g.FilterControlsType == g.FilterControl.RadTextBox || g.FilterControlsType == g.FilterControl.RadMaskedBox || g.FilterControlsType == g.FilterControl.RadNumericBox) {
g.SecondFilterValueControl.set_value(a);
} else {
if (g.FilterControlsType == g.FilterControl.RadDateInput || g.FilterControlsType == g.FilterControl.RadDatePicker || g.FilterControlsType == g.FilterControl.RadDateTimePicker || g.FilterControlsType == g.FilterControl.RadTimePicker) {
var b = Date.parseLocale(a);
if (!b) {
try {
b = new Date(a);
} catch (f) {
}
}
if (!isNaN(b) && b != null && typeof(b) != "undefined") {
g.SecondFilterValueControl.set_selectedDate(b);
}
}
}
}
}
}, _updateFilterFunctionsForHCMenu: function (e, f) {
var d = this._data.CurrentFilterFunctionName;
var a = this._data.AndCurrentFilterFunctionName;
var c = f.getFilterControlID(f.FilterControl.RadComboBox, f.IdSuffix.FirstCond);
var b = $telerik.findControl(e, c);
this._setUpHeaderContextMenuFilterControls(b, d, this._data.DataTypeName, this._data.FilterListOptions);
c = f.getFilterControlID(f.FilterControl.RadComboBox, f.IdSuffix.SecondCond);
b = $telerik.findControl(e, c);
this._setUpHeaderContextMenuFilterControls(b, a, this._data.DataTypeName, this._data.FilterListOptions);
}, _updateDisplayHCMenuFilterControls: function (a, b) {
this._updateDisplayHCFilterBoundColumnControls(a, b, b.IdSuffix.FirstCond);
this._updateDisplayHCFilterBoundColumnControls(a, b, b.IdSuffix.SecondCond);
this._updateDisplayHCFilterCheckBoxColumnControls(a, b, b.IdSuffix.FirstCond);
this._updateDisplayHCFilterCheckBoxColumnControls(a, b, b.IdSuffix.SecondCond);
this._updateDisplayHCFilterPickerControls(a, b, b.FilterControl.RadDatePicker, "DatePicker", b.IdSuffix.FirstCond);
this._updateDisplayHCFilterPickerControls(a, b, b.FilterControl.RadDatePicker, "DatePicker", b.IdSuffix.SecondCond);
this._updateDisplayHCFilterPickerControls(a, b, b.FilterControl.RadDateTimePicker, "DateTimePicker", b.IdSuffix.FirstCond);
this._updateDisplayHCFilterPickerControls(a, b, b.FilterControl.RadDateTimePicker, "DateTimePicker", b.IdSuffix.SecondCond);
this._updateDisplayHCFilterPickerControls(a, b, b.FilterControl.RadTimePicker, "TimePicker", b.IdSuffix.FirstCond);
this._updateDisplayHCFilterPickerControls(a, b, b.FilterControl.RadTimePicker, "TimePicker", b.IdSuffix.SecondCond);
this._updateDisplayHCFilterPickerControls(a, b, b.FilterControl.RadDateInput, "None", b.IdSuffix.FirstCond);
this._updateDisplayHCFilterPickerControls(a, b, b.FilterControl.RadDateInput, "None", b.IdSuffix.SecondCond);
this._updateDisplayHCFilterMaskedBoxControls(a, b, b.IdSuffix.FirstCond);
this._updateDisplayHCFilterMaskedBoxControls(a, b, b.IdSuffix.SecondCond);
this._updateDisplayHCFilterNumericBoxControls(a, b, b.IdSuffix.FirstCond);
this._updateDisplayHCFilterNumericBoxControls(a, b, b.IdSuffix.SecondCond);
}, _updateDisplayHCFilterBoundColumnControls: function (b, c, d) {
var a = c.getFilterControlID(c.FilterControl.RadTextBox, d);
var e = $telerik.findControl(b, a);
if (e) {
if (this._data.ColumnType != "GridDateTimeColumn" && this._data.ColumnType != "GridMaskedColumn" && this._data.ColumnType != "GridNumericColumn" && this._data.ColumnType != "GridCheckBoxColumn" && this._data.DataTypeName != "System.Boolean" && this._data.ColumnType != "GridRatingColumn") {
if (d == c.IdSuffix.FirstCond) {
c.FirstFilterValueControl = e;
} else {
c.SecondFilterValueControl = e;
}
c.FilterControlsType = c.FilterControl.RadTextBox;
e.set_visible(true);
if (this._data.FilterControlWidth) {
e._originalTextBoxCssText = this._adjustHCFilterMenuInputControlsWidth(e._originalTextBoxCssText, this._data.FilterControlWidth.Value);
}
} else {
e.set_visible(false);
}
}
}, _updateDisplayHCFilterPickerControls: function (d, e, c, g, f) {
var a = e.getFilterControlID(c, f);
var b = $telerik.findControl(d, a);
if (b) {
if (this._data.PickerType != g) {
b.set_visible(false);
} else {
if (f == e.IdSuffix.FirstCond) {
e.FirstFilterValueControl = b;
} else {
e.SecondFilterValueControl = b;
}
e.FilterControlsType = c;
b.set_visible(true);
if (this._data.FilterControlWidth) {
if (c == e.FilterControl.RadDateInput) {
b._originalTextBoxCssText = this._adjustHCFilterMenuInputControlsWidth(b._originalTextBoxCssText, this._data.FilterControlWidth.Value);
} else {
this._adjustHCFilterMenuPickerControlsWidth(b, this._data.FilterControlWidth.Value);
}
}
if (this._data.MinDate) {
b.set_minDate(new Date(this._data.MinDate));
}
if (this._data.MaxDate) {
b.set_maxDate(new Date(this._data.MaxDate));
}
}
}
}, _updateDisplayHCFilterCheckBoxColumnControls: function (c, d, e) {
var b = d.getFilterControlID(d.FilterControl.CheckBox, e);
var a = $telerik.findElement(c, b);
if (a) {
if (this._data.ColumnType == "GridCheckBoxColumn" || this._data.DataTypeName == "System.Boolean") {
a.style.display = "block";
if (e == d.IdSuffix.FirstCond) {
d.FirstFilterValueControl = a;
d.FilterControlsType = d.FilterControl.CheckBox;
} else {
d.SecondFilterValueControl = a;
d.FilterControlsType = d.FilterControl.CheckBox;
}
} else {
a.style.display = "none";
}
}
}, _updateDisplayHCFilterMaskedBoxControls: function (c, e, f) {
var b = e.getFilterControlID(e.FilterControl.RadMaskedBox, f);
var a = $telerik.findControl(c, b);
if (a) {
if (this._data.ColumnType != "GridMaskedColumn") {
a.set_visible(false);
} else {
if (f == e.IdSuffix.FirstCond) {
e.FirstFilterValueControl = a;
} else {
e.SecondFilterValueControl = a;
}
e.FilterControlsType = e.FilterControl.RadMaskedBox;
a.set_visible(true);
if (this._data.Mask != null && typeof(this._data.Mask) != "undefined") {
var g = [];
var h = this._data.Mask.split(",");
for (var d = 0;
d < h.length;
d++) {
g.push(eval(h[d]));
}
a._length = 0;
a._setMask(g);
if (this._data.FilterControlWidth) {
a._originalTextBoxCssText = this._adjustHCFilterMenuInputControlsWidth(a._originalTextBoxCssText, this._data.FilterControlWidth.Value);
}
}
}
}
}, _updateDisplayHCFilterNumericBoxControls: function (c, d, e) {
var b = d.getFilterControlID(d.FilterControl.RadNumericBox, e);
var a = $telerik.findControl(c, b);
if (a) {
if (this._data.ColumnType != "GridNumericColumn" && this._data.ColumnType != "GridRatingColumn") {
a.set_visible(false);
} else {
d.FilterControlsType = d.FilterControl.RadNumericBox;
if (e == d.IdSuffix.FirstCond) {
d.FirstFilterValueControl = a;
} else {
d.SecondFilterValueControl = a;
}
var f = a.get_numberFormat();
if (this._data.NegativePattern != null && typeof(this._data.NegativePattern) != "undefined") {
f.NegativePattern = this._data.NegativePattern;
}
if (this._data.PositivePattern != null && typeof(this._data.PositivePattern) != "undefined") {
f.PositivePattern = this._data.PositivePattern;
}
if (this._data.AllowRounding != null && typeof(this._data.AllowRounding) != "undefined") {
f.AllowRounding = this._data.AllowRounding;
}
if (this._data.KeepNotRoundedValue != null && typeof(this._data.KeepNotRoundedValue) != "undefined") {
f.KeepNotRoundedValue = this._data.KeepNotRoundedValue;
}
a.set_numberFormat(f);
a.set_visible(true);
}
}
}, _adjustHCFilterMenuInputControlsWidth: function (a, b) {
if (a.search(/(^|[^-])width/i) != -1) {
a = a.replace(/(^|[^-])width(\s*):(\s*)([^;]+);/i, "$1WIDTH:" + b + "px;");
} else {
a += "WIDTH:" + b + "px;";
}
return a;
}, _adjustHCFilterMenuPickerControlsWidth: function (b, a) {
$get(b.get_id() + "_wrapper").style.width = a;
}, _setUpHeaderContextMenuFilterControls: function (c, d, b, e) {
var a = c.get_items().toArray();
for (var f = 0;
f < a.length;
f++) {
var g = a[f];
if (b == "System.Boolean") {
if ((g.get_value() == "GreaterThan") || (g.get_value() == "LessThan") || (g.get_value() == "GreaterThanOrEqualTo") || (g.get_value() == "LessThanOrEqualTo")) {
g.set_visible(false);
continue;
}
}
if (b != "System.String") {
if ((g.get_value() == "StartsWith") || (g.get_value() == "EndsWith") || (g.get_value() == "Contains") || (g.get_value() == "DoesNotContain") || (g.get_value() == "IsEmpty") || (g.get_value() == "NotIsEmpty")) {
g.set_visible(false);
continue;
}
}
if (e == 0) {
if (g.get_value() == "Custom") {
g.set_visible(false);
continue;
}
}
if (g.get_value() == d) {
g.select();
}
g.set_visible(true);
}
}, _filterButtonClickHandler: function (a) {
var c = this._owner._owner._getHeaderContextMenu();
var d = this;
var l = c.FilterControlsIDsHelper;
var e = d._data.DataField;
if (d._data.DataTextField) {
e = d._data.DataTextField;
} else {
if (d._data.DataAlternateTextField) {
e = d._data.DataAlternateTextField;
}
}
var i = l.getFilterControlID(l.FilterControl.RadComboBox, l.IdSuffix.FirstCond);
var j = c.findItemByValue("FilterMenuContainer").findControl(i).get_selectedItem().get_value();
var o = l.getFilterControlID(l.FilterControl.RadComboBox, l.IdSuffix.SecondCond);
var p = c.findItemByValue("FilterMenuContainer").findControl(o).get_selectedItem().get_value();
var k;
var q;
var r = true;
if (l.FilterControlsType == l.FilterControl.RadTextBox || l.FilterControlsType == l.FilterControl.RadMaskedBox || l.FilterControlsType == l.FilterControl.RadNumericBox) {
k = l.FirstFilterValueControl.get_value();
q = l.SecondFilterValueControl.get_value();
} else {
if (l.FilterControlsType == l.FilterControl.CheckBox) {
k = l.FirstFilterValueControl.checked;
q = l.SecondFilterValueControl.checked;
r = false;
} else {
var f = function (s) {
return function (t) {
return (s == l.FilterControl.RadDateInput) ? t._dateFormat : t._dateInput._dateFormat;
};
}(l.FilterControlsType);
var h = l.FirstFilterValueControl.get_selectedDate();
if (!!h) {
k = h.localeFormat(f(l.FirstFilterValueControl));
}
var n = l.SecondFilterValueControl.get_selectedDate();
if (!!n) {
q = n.localeFormat(f(l.SecondFilterValueControl));
}
}
}
if (r) {
if (typeof(k) == "undefined" || k == null) {
k = "";
} else {
k = k.toString();
}
if (typeof(q) == "undefined" || q == null) {
q = "";
} else {
q = q.toString();
}
}
a.preventDefault();
var m = this._owner;
var b = d._data.UniqueName + "|?" + j + "|" + k + "|?" + p + "|" + q;
if ($find(m.get_owner().get_id())._dataBindingWithSelectMethod) {
while (m._filterExpressions.get_count() != 0) {
var g = m._filterExpressions.getItem(0);
if (g.get_columnUniqueName() == d._data.UniqueName) {
m._filterExpressions.remove(g);
}
}
if (j != "NoFilter" && k !== "") {
m.filter(d._data.UniqueName, k, j, true, true);
}
if (p != "NoFilter" && q !== "") {
m.filter(d._data.UniqueName, q, p, false, true);
}
d._data.CurrentFilterFunction = j;
d._data.AndCurrentFilterFunction = p;
d._data.CurrentFilterValue = k;
d._data.AndCurrentFilterValue = q;
if (j == "NoFilter") {
d._data.CurrentFilterValue = "";
}
if (p == "NoFilter") {
d._data.AndCurrentFilterValue = "";
}
if (j == "NoFilter" || p == "NoFilter") {
var c = m._owner._getHeaderContextMenu();
this._updateFilterValuesForHCMenu(c.FilterControlsIDsHelper);
if (j == "NoFilter") {
m._updateFilterControlValue("", this._data.UniqueName, "NoFilter");
}
}
m.fireCommand("HeaderContextMenuFilter", b);
} else {
m.fireCommand("HeaderContextMenuFilter", b);
}
return false;
}, _clearFilterButtonClickHandler: function (a) {
var c = this._owner._owner._getHeaderContextMenu();
var b = this._data.UniqueName + "|?NoFilter||?NoFilter|";
a.preventDefault();
var f = this._owner;
if ($find(f.get_owner().get_id())._dataBindingWithSelectMethod) {
var c = f._owner._getHeaderContextMenu();
var d = this;
d._data.CurrentFilterFunction = "NoFilter";
d._data.AndCurrentFilterFunction = "NoFilter";
d._data.CurrentFilterValue = "";
d._data.AndCurrentFilterValue = "";
f._updateFilterControlValue("", d._data.UniqueName, "NoFilter");
this.set_filterFunction("NoFilter");
f._filterExpressions.clear();
var e = c.findItemByValue("FilterMenuContainer");
this._updateDisplayHCMenuFilterControls(e.get_element(), c.FilterControlsIDsHelper);
this._updateFilterFunctionsForHCMenu(e.get_element(), c.FilterControlsIDsHelper);
this._updateFilterValuesForHCMenu(c.FilterControlsIDsHelper);
}
f.fireCommand("HeaderContextMenuFilter", b);
return false;
}, _checkBoxClickHandler: function (a) {
var b = $find(this._column.get_owner().get_id());
if (!b) {
return;
}
if (!this.checked) {
b.hideColumn(this._index);
} else {
b.showColumn(this._index);
}
this._column._handleColumnsCheckboxesState();
}, _handleColumnsCheckboxesState: function () {
var d = this.get_owner().get_owner();
if (d) {
var f = d.get_headerMenu().findItemByValue("ColumnsContainer");
if (!f) {
return;
}
var c = f.get_items();
if (!c) {
return;
}
var b = null;
var a = null;
var g;
for (var e = 0;
len = c.get_count(), e < len;
e++) {
b = c.getItem(e);
if (!b.get_visible()) {
continue;
}
a = b.get_element().getElementsByTagName("input")[0];
a.removeAttribute("disabled");
if (a.checked) {
if (g) {
g = null;
break;
}
g = a;
}
}
if (g) {
g.disabled = "disabled";
}
}
}, _onContextMenuItemClosing: function (b, a) {
if (a.get_item().get_value() == "FilterMenuParent" && a.get_item()._popUpOpened) {
a.set_cancel(true);
}
}, _onContextMenuItemClicking: function (n, a) {
var k = a.get_item();
var j = !!n.get_parent()._clientDataSourceID;
if (k.get_value() == "FilterMenuContainer" || k.get_value() == "AggregatesContainer" || (Telerik.Web.UI.RadMenuItem.isInstanceOfType(k.get_parent()) && k.get_parent().get_value() == "ColumnsContainer")) {
a.set_cancel(true);
} else {
if (k.get_value() == "SortAsc" || k.get_value() == "SortDesc" || k.get_value() == "SortNone") {
var l = $find(k._column.get_owner().get_id()), m = l.get_owner(), a;
if ((typeof(m.ClientSettings.DataBinding.Location) != "undefined" && m.ClientSettings.DataBinding.Location != "") || j) {
var e = k._column._data.SortExpression;
if (k.get_value() == "SortNone") {
a = l._raiseAction("ClearSort", {sortExpression: e});
if (!a.get_cancel()) {
e = a.get_sortExpression();
l.clearSort(e);
}
} else {
e += k.get_value() == "SortAsc" ? " ASC" : " DESC";
a = l._raiseAction("Sort", {sortExpression: e});
if (!a.get_cancel()) {
e = a.get_sortExpression();
l.sort(e);
}
}
} else {
n.trackChanges();
var d = k._column._data.DataField;
if (k._column._data.DataTextField) {
d = k._column._data.DataTextField;
} else {
if (k._column._data.DataAlternateTextField) {
d = k._column._data.DataAlternateTextField;
}
}
k.get_attributes().setAttribute("ColumnName", d);
k.get_attributes().setAttribute("TableID", k._column.get_owner()._data.UniqueID);
n.commitChanges();
}
} else {
if (k.get_value() == "GroupBy") {
if (j) {
k._column.get_owner().fireCommand("GroupByColumn", k._column.get_uniqueName());
n.hide();
} else {
k._column.get_owner().groupColumn(k._column.get_uniqueName());
a.set_cancel(true);
}
} else {
if (k.get_value() == "UnGroupBy") {
if (j) {
var f = k._column.get_owner().get_owner()._groupPanel;
var g = f._items;
var b = k._column.get_dataField();
var c = null;
for (var h = 0;
h < g.length;
h++) {
if (g[h]._dataField == b) {
c = g[h];
}
}
if (c) {
f._ungroup(c.get_element().childNodes[0]);
}
n.hide();
} else {
k._column.get_owner().ungroupColumn(k._column.get_uniqueName());
a.set_cancel(true);
}
} else {
if (k.get_value() == "BestFit") {
k._column.resizeToFit();
} else {
if (k.get_isSeparator()) {
a.set_cancel(true);
} else {
if (k.get_parent() != null && k.get_parent().get_value && k.get_parent().get_value() == "AggregatesContainer") {
k._column.get_owner().fireCommand("SetColumnAggregate", String.format("{0}|{1}|{2}", k.get_value(), k._column.get_owner()._data.UniqueID, k._column.get_uniqueName()));
}
}
}
}
}
}
}
}, _onContextMenuHidden: function (g, a) {
var c = g;
if (this._checkboxes) {
for (var e = 0, f = this._checkboxes.length;
e < f;
e++) {
$removeHandler(this._checkboxes[e], "click", this._checkBoxClickHandler);
this._checkboxes[e]._column = null;
this._checkboxes[e]._index = null;
}
}
if (this._onContextMenuItemClickingDelegate) {
g.remove_itemClicking(this._onContextMenuItemClickingDelegate);
this._onContextMenuItemClickingDelegate = null;
}
if (this._onContextMenuItemClosingDelegate) {
g.remove_itemClosing(this._onContextMenuItemClosingDelegate);
this._onContextMenuItemClosingDelegate = null;
}
if (this._onContextMenuHiddenDelegate) {
g.remove_hidden(this._onContextMenuHiddenDelegate);
this._onContextMenuHiddenDelegate = null;
}
if (this._filterButtonClickDelegate) {
var d = $telerik.findElement(c.findItemByValue("FilterMenuContainer").get_element(), "HCFMFilterButton");
$removeHandler(d, "click", this._filterButtonClickDelegate);
this._filterButtonClickDelegate = null;
}
if (this._clearFilterButtonClickDelegate) {
var b = $telerik.findElement(c.findItemByValue("FilterMenuContainer").get_element(), "HCFMClearFilterButton");
$removeHandler(b, "click", this._clearFilterButtonClickDelegate);
this._clearFilterButtonClickDelegate = null;
}
this._checkboxes = [];
}, _onContextMenu: function (a) {
if ($telerik.isOpera && a.button != 2) {
return;
}
this._owner._owner.raise_columnContextMenu(new Telerik.Web.UI.GridColumnEventArgs(this, a));
if (this._owner._owner.get_events().getHandler("columnContextMenu") || this._owner._data.enableHeaderContextMenu) {
this._initHeaderContextMenu(a);
if (a.preventDefault) {
a.preventDefault();
} else {
a.returnValue = false;
return false;
}
}
}, resizeToFit: function (d, c) {
if (!this._canResizeToFit()) {
return;
}
if (typeof c != "undefined") {
this.get_realOwner()._includeAllHeaderRows = c;
}
var e = this._getItemContainerTableView();
var a = Array.indexOf(e.get_columns(), this);
if (this._cachedBestFitSize) {
this.get_owner().resizeColumn(a, this._cachedBestFitSize);
return;
}
var b = this._createFitTestContainer(e.get_element(), d);
this._cacheBestFitSizes(b);
this._removeFitTestContainer(e.get_element());
this.get_owner().resizeColumn(a, this._cachedBestFitSize || this.get_element().offsetWidth);
}, _isMouseOverResizeHandle: function (a) {
var c = Telerik.Web.UI.Grid.GetEventPosX(a);
var d = Telerik.Web.UI.Grid.FindPosX(this.get_element());
var b = d + this.get_element().offsetWidth;
if ((c >= b - this._resizeTolerance) && (c <= b + this._resizeTolerance)) {
return true;
}
return false;
}, _isTouchPointOverResizeHandle: function (a) {
var c = $telerik.getTouchEventLocation(a).x;
var d = Telerik.Web.UI.Grid.FindPosX(this.get_element());
var b = d + this.get_element().offsetWidth;
if (c >= b - this._resizeTolerance) {
return true;
}
return false;
}, _canResizeToFit: function () {
var a = this.get_visible() && (this._data.Display == null || this._data.Display) && (this.Display == null || this.Display);
var b = this.get_owner().get_owner().ClientSettings.Resizing;
return a && this.get_resizable() && b && b.AllowColumnResize && b.AllowResizeToFit;
}, _getItemContainerTableView: function () {
var a = this.get_owner();
if (a.get_id().endsWith("_Header")) {
return $find(a.get_owner().get_id()).get_masterTableView();
}
return a;
}, _cacheBestFitSizes: function (c) {
var f = c.tBodies[0].getElementsByTagName("tr")[0];
if (!f) {
return;
}
var b = this.get_owner().get_columns();
for (var d = 0, e = b.length;
d < e;
d++) {
if (b[d]._canResizeToFit()) {
var a = f.cells[d];
if (a) {
b[d]._cachedBestFitSize = a.offsetWidth;
if (($telerik.isIE && Sys.Browser.version >= 9) || ($telerik.isFirefox && Sys.Browser.version >= 6)) {
b[d]._cachedBestFitSize++;
}
}
}
}
}, _createFitTestContainer: function (n, m) {
var h = n.parentNode;
var b = h.id + "_FitTestContainer";
var d = b + "_FitTestTable";
var e = document.createDocumentFragment();
var a = document.createElement("div");
e.appendChild(a);
a.id = b;
a.style.position = "absolute";
a.style.visibility = "hidden";
if (n.tBodies.length > 0) {
a.innerHTML = "<table class='" + n.className + "' cellspacing='0' border='0' style='" + n.style.cssText + ";table-layout:auto;white-space:nowrap;width:auto;'><tbody>" + n.tBodies[n.tBodies.length - 1].innerHTML + "</tbody></table>";
}
var c = a.childNodes[0];
c.id = d;
var k = [];
for (var f = 0, g = c.rows.length;
f < g;
f++) {
var j = c.rows[f];
if (!(j.id && j.id.indexOf(n.id) > -1)) {
k.push(j);
}
}
var l = k.pop();
while (l) {
c.deleteRow(l.rowIndex);
l = k.pop();
}
if (!m) {
this._insertHeaderCells(c);
}
h.appendChild(e.childNodes[0]);
return document.getElementById(d);
}, _insertHeaderCells: function (b) {
var f = b.createTHead();
var c;
var e;
var a;
if (this._owner._hasMultiHeaders) {
this.get_realOwner()._includeAllHeaderRows = true;
}
if (!this.get_realOwner()._includeAllHeaderRows) {
c = f.insertRow(-1);
e = this.get_element().parentNode;
a = e.cells;
this._insertCellsInRows(a, c);
} else {
origRows = $telerik.$(">tr:not(.rgCommandRow)", this.get_element().parentNode.parentNode);
for (var d = 0;
d < origRows.length;
d++) {
e = origRows[d];
c = f.insertRow(-1);
c.className = e.className;
this._insertCellsInRows(e.cells, c);
}
}
}, _insertCellsInRows: function (a, c) {
var b;
for (var d = 0, e = a.length;
d < e;
d++) {
b = c.insertCell(d);
b.className = a[d].className;
b.colSpan = a[d].colSpan;
b.rowSpan = a[d].rowSpan;
b.style.cssText = a[d].style.cssText;
b.style.width = "auto";
if ($telerik.isIE && Sys.Browser.version <= 7) {
b.innerHTML = "<nobr>" + a[d].innerHTML + "</nobr>";
} else {
b.innerHTML = a[d].innerHTML;
}
}
}, _removeFitTestContainer: function (b) {
var a = document.getElementById(b.parentNode.id + "_FitTestContainer");
if (a) {
a.parentNode.removeChild(a);
}
}, _clearBestFitCache: function () {
var a = this.get_owner().get_columns();
for (var b = 0, c = a.length;
b < c;
b++) {
a[b]._cachedBestFitSize = null;
}
}, _onClick: function (a) {
this._owner._owner.raise_columnClick(new Telerik.Web.UI.GridColumnEventArgs(this, a));
}, _onDblClick: function (a) {
this._owner._owner.raise_columnDblClick(new Telerik.Web.UI.GridColumnEventArgs(this, a));
if (this._isMouseOverResizeHandle(a)) {
this.resizeToFit();
}
}, _onMouseOver: function (a) {
this._owner._owner.raise_columnMouseOver(new Telerik.Web.UI.GridColumnEventArgs(this, a));
if (this._owner._owner.Skin != "") {
Sys.UI.DomElement.addCssClass(this.get_element(), "rgHeaderOver");
}
}, _onMouseOut: function (a) {
this._owner._owner.raise_columnMouseOut(new Telerik.Web.UI.GridColumnEventArgs(this, a));
if (this._owner._owner.Skin != "") {
Sys.UI.DomElement.removeCssClass(this.get_element(), "rgHeaderOver");
}
}, get_resizable: function () {
return this._data.Resizable;
}, set_resizable: function (a) {
if (this._data.Resizable != a) {
this._data.Resizable = a;
}
}, get_reorderable: function () {
return this._data.Reorderable;
}, get_columnGroupName: function () {
return this._data.ColumnGroupName;
}, get_selectable: function () {
return this._data.Selectable;
}, set_reorderable: function (a) {
if (this._data.Reorderable != a) {
this._data.Reorderable = a;
}
}, get_uniqueName: function () {
return this._data.UniqueName;
}, get_dataField: function () {
return this._data.DataField;
}, get_readOnly: function () {
return (typeof(this._data.ReadOnly) != "undefined") ? true : false;
}, get_dataType: function () {
return this._data.DataTypeName;
}, get_filterFunction: function () {
return this._data.CurrentFilterFunctionName;
}, set_filterFunction: function (a) {
if (this._data.CurrentFilterFunctionName != a) {
this._data.CurrentFilterFunctionName = a;
}
}, get_filterDelay: function () {
return (typeof(this._data.FilterDelay) == "undefined") ? null : this._data.FilterDelay;
}, set_filterDelay: function (a) {
if (this._data.FilterDelay != a) {
this._data.FilterDelay = a;
}
}
};
Telerik.Web.UI.GridColumn.registerClass("Telerik.Web.UI.GridColumn", Sys.UI.Control);
Telerik.Web.UI.GridColumnEventArgs = function (b, a) {
Telerik.Web.UI.GridColumnEventArgs.initializeBase(this);
this._gridColumn = b;
this._domEvent = a;
};
Telerik.Web.UI.GridColumnEventArgs.prototype = {
get_gridColumn: function () {
return this._gridColumn;
}, get_domEvent: function () {
return this._domEvent;
}
};
Telerik.Web.UI.GridColumnEventArgs.registerClass("Telerik.Web.UI.GridColumnEventArgs", Sys.EventArgs);
Telerik.Web.UI.GridColumnCancelEventArgs = function (b, a) {
Telerik.Web.UI.GridColumnCancelEventArgs.initializeBase(this);
this._gridColumn = b;
this._domEvent = a;
};
Telerik.Web.UI.GridColumnCancelEventArgs.prototype = {
get_gridColumn: function () {
return this._gridColumn;
}, get_domEvent: function () {
return this._domEvent;
}
};
Telerik.Web.UI.GridColumnCancelEventArgs.registerClass("Telerik.Web.UI.GridColumnCancelEventArgs", Sys.CancelEventArgs);
Telerik.Web.UI.GridHeaderMenuCancelEventArgs = function (b, a, c) {
Telerik.Web.UI.GridHeaderMenuCancelEventArgs.initializeBase(this, [b, a]);
this._menu = c;
};
Telerik.Web.UI.GridHeaderMenuCancelEventArgs.prototype = {
get_menu: function () {
return this._menu;
}
};
Telerik.Web.UI.GridHeaderMenuCancelEventArgs.registerClass("Telerik.Web.UI.GridHeaderMenuCancelEventArgs", Telerik.Web.UI.GridColumnCancelEventArgs);
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.Grid");
(function (a) {
a.Grid.GridBoundColumn = {
populateCell: function (c, e, g) {
var f = this._owner._owner, d = this._data.DataFormatString;
if (typeof(d) != "undefined" && d != "") {
if (g.toString().indexOf("/Date(") != -1) {
g = new Date(parseInt(g.replace("/Date(", "").replace(")/", "")));
}
c.innerHTML = String.localeFormat(d, g) || "&nbsp;";
} else {
if (g.toString().indexOf("/Date(") != -1) {
c.innerHTML = String.localeFormat("{0:" + f._defaultDateTimeFormat + "}", new Date(parseInt(g.replace("/Date(", "").replace(")/", ""))));
} else {
c.innerHTML = (g !== "") ? g : "&nbsp;";
}
}
}, populateEditCell: function (c, d, f, e) {
this.get_realOwner()._fillEditorsData(e, this, f);
}
};
a.Grid.GridTemplateColumn = {
populateCell: function (d, e, h, f) {
if (this._data.ClientItemTemplate) {
var c = this.get_realOwner()._getBindingContext(e, f.get_itemIndex()), g = Telerik.Web.UI.Template.compile(this._data.ClientItemTemplate);
if (g) {
d.innerHTML = g(c);
}
}
}, populateEditCell: function (c, d, f, e) {
this.get_realOwner()._fillTemplateEditorsData(e, d, c);
}
};
a.Grid.GridCheckBoxColumn = {
initializeCell: function (c) {
c.innerHTML = '<span disabled="disabled"><input type="checkbox" disabled="disabled" /></span>';
}, populateCell: function (c, d, g) {
var f = c.getElementsByTagName("input"), e = f[0];
if (e && e.type == "checkbox") {
e.checked = g;
}
}, populateEditCell: function (c, d, f, e) {
this.get_realOwner()._fillTemplateEditorsData(e, d, c);
}
};
a.Grid.GridHyperLinkColumn = {
initializeCell: function (c) {
c.innerHTML = "<a />";
}, populateCell: function (c, e) {
if (!e) {
return;
}
var d = this._data, h = c.getElementsByTagName("a");
if (h.length > 0) {
var g = h[0];
if (d.NavigateUrl && d.NavigateUrl != "") {
g.href = d.NavigateUrl;
}
if (d.Target && d.Target != "") {
g.target = d.Target;
}
if (d.Text && d.Text != "") {
g.innerHTML = d.Text;
}
var f = d.DataTextFormatString;
var j = String.localeFormat((f == "") ? "{0}" : f, e[d.DataTextField]);
var l = b(d.DataNavigateUrlFields, e);
if (l && l.length > 0) {
var k = eval("String.format('" + d.DataNavigateUrlFormatString + "'," + l.join(",") + ")");
g.href = k;
}
if ((f && f != "") || (d.DataTextField && d.DataTextField != "")) {
g.innerHTML = j;
}
}
}
};
a.Grid.GridImageColumn = {
initializeCell: function (c) {
c.innerHTML = "<img />";
}, populateCell: function (c, e) {
if (!e) {
return;
}
var d = this._data, h = c.getElementsByTagName("img"), g = h[0];
if (g) {
if (d.ImageUrl && d.ImageUrl != "") {
g.src = d.ImageUrl;
}
if (d.AlternateText && d.AlternateText != "") {
g.alt = g.title = d.AlternateText;
}
var f = d.DataAlternateTextFormatString;
var j = String.localeFormat((f == "") ? "{0}" : f, e[d.DataAlternateTextField]);
var l = b(d.DataImageUrlFields, e);
if (l && l.length > 0) {
var k = eval("String.format('" + d.DataImageUrlFormatString + "'," + l.join(",") + ")");
g.src = k;
}
if (d.ImageHeight && d.ImageHeight != "") {
g.style.height = d.ImageHeight;
}
if (d.ImageWidth && d.ImageWidth != "") {
g.style.width = d.ImageWidth;
}
if ((f && f != "") || (d.DataAlternateTextField && d.DataAlternateTextField != "")) {
g.alt = g.title = j;
}
}
}
};
a.Grid.GridButtonColumn = {
initializeCell: function (d, h) {
var g = this._owner._owner, f = this._data, c;
switch (f.ButtonType) {
case"PushButton":
c = '<input type="submit" onclick="{0}"/>';
break;
case"LinkButton":
c = '<a href="#" onclick="{0}"></a>';
break;
case"ImageButton":
c = '<input type="image" src="' + f.ImageUrl + '" onclick="{0}"/>';
break;
}
var e = f.CommandArgument;
if (e == undefined || e == "") {
e = h._itemIndexHierarchical;
}
var j = String.format(this._getClickStatement(), g.get_id(), this.get_realOwner().get_id(), h.get_id(), f.CommandName, e);
d.innerHTML = String.format(c, j);
this.populateCell(d, {});
}, populateCell: function (d, e) {
var c = e[this._data.DataTextField];
if (c == undefined || c == "") {
c = this._data.Text;
}
switch (this._data.ButtonType) {
case"PushButton":
buttonControl = d.getElementsByTagName("input")[0];
buttonControl.value = c;
break;
case"LinkButton":
buttonControl = d.getElementsByTagName("a")[0];
buttonControl.innerHTML = c;
break;
case"ImageButton":
buttonControl = d.getElementsByTagName("input")[0];
buttonControl.title = c;
buttonControl.alt = c;
break;
}
}, _getClickStatement: function () {
return "if(!$find('{1}').fireCommand('{3}','{4}')) return false;";
}
};
a.Grid.GridEditCommandColumn = a.Grid.GridButtonColumn;
a.Grid.GridClientDeleteColumn = {
initializeCell: a.Grid.GridButtonColumn.initializeCell,
populateCell: a.Grid.GridButtonColumn.populateCell,
_getClickStatement: function () {
if (this.get_realOwner()._data.EditMode == "Batch") {
return "$find('{0}').get_batchEditingManager()._deleteRecord('{1}','{2}'); return false;";
} else {
return "$find('{1}')._clientDelete(event); return false;";
}
}
};
a.Grid.GridClientSelectColumn = {
initializeCell: function (c, e) {
var d = this._owner._owner;
c.innerHTML = String.format("<input type='checkbox' id='{0}_SelectCheckBox' />", d.get_id() + "__" + e._itemIndexHierarchical);
}
};
a.Grid.GridCalculatedColumn = {
populateCell: function () {
var d = this._data, c = "", h = [], g;
if (typeof(d.Expression) != "undefined" && d.Expression != "") {
h = [];
for (var l = 0;
l < d.DataFields.length;
l++) {
g = d.DataFields[l];
Array.add(h, this._dataSource[i][g]);
}
var m = eval("String.format('" + d.Expression + "'," + h.join(",") + ")");
var j = d.DataFormatString;
if (j == "") {
j = "{0}";
}
var e = "";
try {
e = eval(m);
} catch (f) {
}
c = String.localeFormat(j, e);
}
cell.innerHTML = (c !== "") ? c : "&nbsp;";
}
};
a.Grid.GridAttachmentColumn = {
initializeCell: function (c) {
c.innerHTML = "<a></a>";
}, populateCell: function (c, e, g) {
var f = c.getElementsByTagName("a")[0], d;
if (!f) {
this.initializeCell(c);
f = c.getElementsByTagName("a")[0];
}
if (g !== "") {
f.innerHTML = g;
d = '{"ColumnUniqueName":"' + this.get_uniqueName() + '","FileName":"' + g + '"}';
f.setAttribute("onclick", "if (!$find('" + this.get_id() + "').fireCommand('DownloadAttachment','" + d + "')) return false;");
f.href = "#";
} else {
f.href = "";
f.innerHTML = "&nbsp;";
f.onclick = function () {
};
}
}
};
a.Grid.GridRatingColumn = {
populateCell: function (c, d, g) {
var f = $telerik.getElementByClassName(c, "RadRating"), e = f ? $find(f.id) : null;
if (e) {
e.set_value(parseFloat(g));
}
}
};
a.Grid.GridGroupSplitterColumn = {
populateCell: function (c) {
Sys.UI.DomElement.addCssClass(c, "rgGroupCol");
}, populateEditCell: function (c) {
Sys.UI.DomElement.addCssClass(c, "rgGroupCol");
}
};
a.Grid.GridExpandColumn = {
initializeCell: function (c) {
Sys.UI.DomElement.addCssClass(c, "rgExpandCol");
}
};
function b(c, d) {
var g = [];
if (!c || !d) {
return g;
}
for (var f = 0;
f < c.length;
f++) {
var e = c[f];
if (typeof(d[e]) != "number") {
Array.add(g, String.format("'{0}'", d[e]));
} else {
Array.add(g, d[e]);
}
}
return g;
}
})(Telerik.Web.UI);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.GridColumnAnimation = function () {
Telerik.Web.UI.GridColumnAnimation.initializeBase(this);
this.$ = null;
this._owner = {};
this._mouseMoveDelegate = null;
this._moueUpDelegate = null;
this._$animatedContainer = null;
this._$innerContainer = null;
this._animatedHeaderOffset = 0;
this._dragToGroupColumn = null;
this._nextCellPosition = 0;
this._animatedHeaderCells = [];
this._revertPendingCells = [];
this._initialDraggedHeaderCellIndex = -1;
this._draggedHeaderCellIndex = -1;
this._reorderDuration = 300;
this._revertDuration = 300;
this._allowColumnsReorderAnimation = false;
this._allowColumnRevertAnimation = false;
this._allowDragToGroup = false;
this._allowFreeMove = false;
};
Telerik.Web.UI.GridColumnAnimation.prototype = {
initialize: function () {
Telerik.Web.UI.GridColumnAnimation.callBaseMethod(this, "initialize");
var a = this.get_owner().ClientSettings;
this._allowColumnsReorderAnimation = a.Animation.AllowColumnReorderAnimation && a.AllowColumnsReorder && a.ColumnsReorderMethod == 1;
this._allowColumnRevertAnimation = a.Animation.AllowColumnRevertAnimation;
this._allowDragToGroup = a.AllowDragToGroup;
this._allowFreeMove = this._allowDragToGroup;
this._mouseMoveDelegate = Function.createDelegate(this, this._mouseMove);
this._mouseUpDelegate = Function.createDelegate(this, this._mouseUp);
this.$ = $telerik.$;
(function (b) {
b.fn.outerHtml = function (d) {
if (!this[0]) {
return null;
}
var c = d ? this.eq(0).clone() : this.eq(0).clone().empty();
return b("<p>").append(c).html();
};
})(this.$);
}, _mouseDown: function (c, a) {
var d = c.target || c.srcElement, b = a.get_element();
if (!d) {
return;
}
if (d !== b && d.parentNode !== b) {
return;
}
this._dragToGroupColumn = a;
this._mouseDownPosition = [c.clientX, c.clientY];
if (this._allowColumnsReorderAnimation) {
this.$(document).mousemove(this._mouseMoveDelegate);
} else {
this._createDraggedHeaderCell(c);
}
this.$(document).mouseup(this._mouseUpDelegate);
Telerik.Web.UI.Grid.ClearDocumentEvents();
}, _createDraggedHeaderCell: function (a) {
Telerik.Web.UI.Grid.CreateDragDrop(a, this._dragToGroupColumn, true);
}, _createAnimatedContainer: function (d) {
var a = this.$(d);
var b = a.closest("table");
this._animatedHeaderOffset = b.offset();
this._animatedHeaderOffset.top = a.offset().top;
this._$innerContainer = this.$($("<div>", {id: b.attr("id"), "class": b.attr("class")})).css({
height: "100%",
overflow: this._allowFreeMove ? "visible" : "hidden",
padding: "0",
margin: "0",
position: "absolute",
border: "none",
width: "100%"
});
this._$animatedContainer = this.$(this.$(this.get_owner().get_element()).outerHtml()).append(this._$innerContainer).css({
left: this._animatedHeaderOffset.left + "px",
top: this._animatedHeaderOffset.top + "px",
width: b.parent().width() + "px",
height: a.outerHeight() - 1 + "px",
overflow: this._allowFreeMove ? "visible" : "hidden",
padding: "0",
margin: "0",
position: "absolute",
borderStyle: "none none solid none"
}).appendTo(document.body);
var c = this;
this.$("th", a.parent()).each(function (g) {
if (this.clientWidth === 0) {
return;
}
var e = c._createAnimatedCell(this);
if (this === d) {
e.addClass("rgDraggedHeader").attr("title", "").css({opacity: "0.8", zIndex: "9999"});
c._draggedHeaderCellIndex = c._animatedHeaderCells.length;
c._initialDraggedHeaderCellIndex = c._draggedHeaderCellIndex;
}
var f = this;
c._$innerContainer.append(e);
c._animatedHeaderCells.push(new Telerik.Web.UI.GridAnimatedHeaderCell(e, c.get_reorderDuration(), f.UniqueName));
});
}, _createAnimatedCell: function (b) {
var a = this.$(b);
return this._changeElementTag(b, "div").css({
position: "absolute",
left: this._getNextCellPosition(b),
width: a.width() + "px",
cursor: "default"
});
}, _getNextCellPosition: function (a) {
var b = this._nextCellPosition;
this._nextCellPosition += this.$(a).outerWidth();
return b;
}, _changeElementTag: function (a, e) {
a = a.jquery && a.length ? a[0] : a;
if (!a.tagName) {
return;
}
var c = this.$(a).html();
var b = this.$(a).outerHtml();
var d = a.tagName.toLowerCase();
b = b.replace("<" + a.tagName, "<" + d).replace(a.tagName + ">", d + ">");
return this.$(b.replace("<" + d, "<" + e).replace(d + ">", e + ">")).html(c);
}, _mouseMove: function (a) {
if (this._mouseDownPosition) {
if (Math.abs(this._mouseDownPosition[0] - a.clientX) > 0 || Math.abs(this._mouseDownPosition[1] - a.clientY) > 0) {
this._createAnimatedContainer(this._dragToGroupColumn.get_element());
this._mouseDownPosition = null;
} else {
return;
}
}
if ($telerik.isIE8) {
this._mouseMoveDelayed(a);
} else {
this._handleMouseMoveInternal(a);
}
}, _mouseMoveDelayed: function (b) {
if (!this._mouseMoveInProgress) {
this._mouseMoveInProgress = true;
var a = this;
this._mouseMoveTimeout = setTimeout(function () {
a._handleMouseMoveInternal(b);
a._mouseMoveInProgress = false;
}, 0);
}
}, _handleMouseMoveInternal: function (a) {
this._setMoveDirection(a);
this._getDraggedHeaderCell().moveWithCursor(a, this._allowFreeMove);
this._mouseTrackOrigin = this._getMouseTrackOrigin(a);
if (this._isTrackOriginOverHeader() && !this._getDraggedHeaderCell().isPointOverOrigin(this._mouseTrackOrigin)) {
this._reorderHeaderCells();
} else {
this._revertHeaderCellsToOrigin();
}
if (this._allowDragToGroup) {
this._updateGroupPanelIndicators(a);
}
}, _updateGroupPanelIndicators: function (a) {
if (this._isDraggedHeaderOverGroupPanel()) {
Telerik.Web.UI.Grid.CreateReorderIndicators(this.get_owner()._groupPanel.get_element(), this.get_owner().Skin, this.get_owner()._imagesPath, true, this.get_owner().get_id());
Telerik.Web.UI.Grid.MoveReorderIndicators(a, this.get_owner()._groupPanel.get_element(), true, this.get_owner().get_id());
} else {
this._hideReorderIndicators();
}
}, _hideReorderIndicators: function () {
if (Telerik.Web.UI.Grid.ReorderIndicator1) {
Telerik.Web.UI.Grid.ReorderIndicator1.style.visibility = "hidden";
Telerik.Web.UI.Grid.ReorderIndicator1.style.display = "none";
Telerik.Web.UI.Grid.ReorderIndicator1.style.position = "absolute";
Telerik.Web.UI.Grid.ReorderIndicator2.style.visibility = Telerik.Web.UI.Grid.ReorderIndicator1.style.visibility;
Telerik.Web.UI.Grid.ReorderIndicator2.style.display = Telerik.Web.UI.Grid.ReorderIndicator1.style.display;
Telerik.Web.UI.Grid.ReorderIndicator2.style.position = Telerik.Web.UI.Grid.ReorderIndicator1.style.position;
}
}, _getMoveDirection: function () {
return this._moveDirection || 0;
}, _setMoveDirection: function (a) {
var b = this._prevPageX || a.pageX;
this._moveDirection = a.pageX - b;
this._prevPageX = a.pageX;
}, _isTrackOriginOverHeader: function () {
var a = Telerik.Web.UI.Grid.Animation;
if (this._mouseTrackOrigin) {
return a.containsPoint(a.getBoundingRectangle(this._$animatedContainer), this._mouseTrackOrigin);
}
return false;
}, _getLastMovedHeaderWidth: function () {
if (!this._lastMovedCellWidth) {
this._lastMovedCellWidth = this._getDraggedHeaderCell().get_animationWidth();
}
return this._lastMovedCellWidth;
}, _updateLastMovedHeaderWidth: function (a) {
this._lastMovedCellWidth = Math.max(a.get_animationWidth(), this._getDraggedHeaderCell().get_animationWidth());
}, _reorderHeaderCells: function () {
var b = this._animatedHeaderOffset.left + this._getDraggedHeaderCell().get_draggedPosition();
var a = b;
var d = this._draggedHeaderCellIndex;
var c = null;
if (this._getMoveDirection() > 0 || a < this._mouseTrackOrigin.left) {
a += this._getLastMovedHeaderWidth();
while (a < this._mouseTrackOrigin.left && d < this._animatedHeaderCells.length - 1) {
d++;
c = this._animatedHeaderCells[d];
a += c.get_animationWidth();
if (c.canMove()) {
this._moveCell(d, "left");
}
}
} else {
if (this._getMoveDirection() < 0 || a >= this._mouseTrackOrigin.left) {
while (a > this._mouseTrackOrigin.left && d > 0) {
d--;
c = this._animatedHeaderCells[d];
a -= c.get_animationWidth();
if (c.canMove()) {
this._moveCell(d, "right");
}
}
}
}
}, _moveCell: function (c, a) {
var b = this._animatedHeaderCells[c];
if (b.isPointOver(this._mouseTrackOrigin)) {
this._updateLastMovedHeaderWidth(b);
this._getDraggedHeaderCell().set_draggedPosition(b.get_currentPosition());
} else {
if (b.isPointOverOrigin(this._mouseTrackOrigin)) {
this._updateLastMovedHeaderWidth(b);
this._getDraggedHeaderCell().set_draggedPosition(b.get_originalPosition());
}
}
this._exchangeCellPosition(c);
this._updateRevertState(b);
if (a === "left") {
b.moveLeft(this._getDraggedHeaderCell().get_animationWidth());
} else {
b.moveRight(this._getDraggedHeaderCell().get_animationWidth());
}
}, _updateRevertState: function (b) {
if (b.isAtOrigin()) {
this._revertPendingCells.push(b);
} else {
if (this._revertPendingCells.length > 0) {
var a = Array.indexOf(this._revertPendingCells, b);
if (a > -1) {
this._revertPendingCells.splice(a, 1);
}
}
}
}, _exchangeCellPosition: function (c) {
var b = this._draggedHeaderCellIndex;
var a = this._getDraggedHeaderCell();
this._animatedHeaderCells.splice(b, 1);
this._animatedHeaderCells.splice(c, 0, a);
this._draggedHeaderCellIndex = c;
}, _revertHeaderCellsToOrigin: function () {
if (this._revertPendingCells.length > 0) {
if (this._initialDraggedHeaderCellIndex !== this._draggedHeaderCellIndex) {
this._exchangeCellPosition(this._initialDraggedHeaderCellIndex);
}
var a = this._getDraggedHeaderCell();
if (a.get_draggedPosition() !== a.get_originalPosition()) {
this._updateLastMovedHeaderWidth(a);
a.set_draggedPosition(a.get_originalPosition());
}
while (this._revertPendingCells.length) {
this._revertPendingCells.pop().moveToOrigin();
}
}
}, _getMouseTrackOrigin: function (a) {
var b = {left: a.pageX, top: a.pageY};
var c = Telerik.Web.UI.Grid.Animation.getTrackedPoint();
if (!this._allowFreeMove && c) {
b.top = c.top;
}
return b;
}, _getDraggedHeaderCell: function () {
return this._animatedHeaderCells[this._draggedHeaderCellIndex];
}, _isDraggedHeaderOverGroupPanel: function () {
if (this._mouseTrackOrigin) {
return this._allowDragToGroup && this.get_owner()._groupPanel && Telerik.Web.UI.Grid.Animation.containsPoint(this._getGroupPanelBoundingRectangle(), this._mouseTrackOrigin);
}
return false;
}, _getGroupPanelBoundingRectangle: function () {
if (!this._cachedGroupPanelRect) {
this._cachedGroupPanelRect = Telerik.Web.UI.Grid.Animation.getBoundingRectangle(this.get_owner()._groupPanel.get_element());
}
return this._cachedGroupPanelRect;
}, _mouseUp: function (b) {
clearTimeout(this._mouseMoveTimeout);
if (!this._mouseDownPosition && this._allowColumnsReorderAnimation) {
var f = this._getDraggedHeaderCell().get_element().parent()[0].id;
var d = $find(f);
if (this.get_owner().ClientSettings.AllowColumnsReorder && this._isTrackOriginOverHeader()) {
var c = this._getReorderColumnNames();
if (c && d) {
d.reorderColumns(c.first, c.second);
}
this._clearAnimationData();
this._removeAnimatedContainer();
Telerik.Web.UI.Grid.RestoreDocumentEvents();
return;
}
this._revertHeaderCellsToOrigin();
if (this.get_owner().ClientSettings.AllowDragToGroup && this._isDraggedHeaderOverGroupPanel()) {
var a = d.getColumnByUniqueName(this._getDraggedHeaderCell().get_columnName());
if (a && a._data.Groupable) {
this._clearAnimationData();
this._removeAnimatedContainer();
this._hideReorderIndicators();
d.groupColumn(a.get_element().UniqueName);
}
} else {
this._moveDraggedCellToOrigin();
}
} else {
if (this._allowDragToGroup && this._dragToGroupColumn) {
this._dragToGroupColumn._onMouseUpHandler(b);
if (this._allowColumnRevertAnimation) {
Telerik.Web.UI.Grid.AnimateRevertDragDrop(this._dragToGroupColumn, this.get_revertDuration());
}
} else {
this._dragToGroupColumn._onMouseUpHandler(b);
if (this._dragToGroupColumn && this._allowColumnRevertAnimation) {
Telerik.Web.UI.Grid.AnimateRevertDragDrop(this._dragToGroupColumn, this.get_revertDuration());
} else {
Telerik.Web.UI.Grid.DestroyDragDrop();
}
}
}
this._clearAnimationData();
Telerik.Web.UI.Grid.RestoreDocumentEvents();
}, _getReorderColumnNames: function () {
var b = this._getDraggedHeaderCell().get_columnName();
var a = "";
for (var d = 0;
d < this._revertPendingCells.length;
d++) {
var c = this._revertPendingCells[d];
if (!c.isDragged() && c.get_originalPosition() === this._getDraggedHeaderCell().get_currentPosition()) {
a = c.get_columnName();
break;
}
}
if (b && a && b !== a) {
return {first: b, second: a};
}
return null;
}, _moveDraggedCellToOrigin: function () {
var b = this._getDraggedHeaderCell();
if (this._allowColumnRevertAnimation) {
var a = this;
b.get_element().animate({left: b.get_originalPosition(), top: 0}, this.get_revertDuration(), function () {
a._removeAnimatedContainer();
});
} else {
this._removeAnimatedContainer();
}
}, _clearAnimationData: function () {
this._mouseTrackOrigin = -1;
this._nextCellPosition = 0;
this._revertPendingCells = [];
this._animatedHeaderCells = [];
this._draggedHeaderCellIndex = -1;
this._initialDraggedHeaderCellIndex = -1;
this._lastMovedCellWidth = null;
this._moveDirection = 0;
this._prevPageX = 0;
this._mouseMoveInProgress = false;
this._dragToGroupColumn = null;
this._mouseDownPosition = null;
Telerik.Web.UI.Grid.Animation.clearElementRelativeMousePoint();
this._clearHandlers();
}, _clearHandlers: function () {
this.$(document).unbind("mousemove", this._mouseMoveDelegate);
this.$(document).unbind("mouseup", this._mouseUpDelegate);
}, _removeAnimatedContainer: function () {
this._$animatedContainer.remove();
}, get_reorderDuration: function () {
return this._reorderDuration;
}, set_reorderDuration: function (a) {
this._reorderDuration = a;
}, get_revertDuration: function () {
return this._revertDuration;
}, set_revertDuration: function (a) {
this._revertDuration = a;
}, get_owner: function () {
return this._owner;
}, set_owner: function (a) {
this._owner = a;
}
};
Telerik.Web.UI.GridColumnAnimation.registerClass("Telerik.Web.UI.GridColumnAnimation", Sys.Component);
Telerik.Web.UI.GridAnimatedHeaderCell = function (a, b, c) {
this._$element = a;
this._columnName = c;
this._originalPosition = parseInt(a.css("left"), 10);
this._currentPosition = this._originalPosition;
this.className = this._$element[0].className;
this._animated = false;
this._animationDuration = b;
this._originalOffset = this._$element.offset();
this._originalParentOffset = this._$element.parent().offset();
this._originBoundingRectangle = {
left: this._originalParentOffset.left + this.get_originalPosition(),
top: this._originalOffset.top,
width: this.get_animationWidth(),
height: this._$element.parent().height() - (this._$element.innerHeight() - this._$element.height())
};
this._$element[0].innerHTML = String.format("<span style='display:inline-block;vertical-align:middle;width:100%;'>{0}</span>", this._$element.html());
this._$element.prepend("<span style='display:inline-block;vertical-align:middle;height:100%;'></span>");
this._$element.height(this._originBoundingRectangle.height);
};
Telerik.Web.UI.GridAnimatedHeaderCell.prototype = {
isDragged: function () {
return this._$element[0].className.indexOf("rgDraggedHeader") > -1;
}, get_element: function () {
return this._$element;
}, get_columnName: function () {
return this._columnName;
}, isAtOrigin: function () {
return this.get_currentPosition() === this.get_originalPosition();
}, get_originalPosition: function () {
return this._originalPosition;
}, get_currentPosition: function () {
return this._currentPosition;
}, get_draggedPosition: function () {
return this._currentPosition;
}, set_draggedPosition: function (a) {
if (this.isDragged()) {
this._currentPosition = a;
}
}, get_animationWidth: function () {
return this._$element.outerWidth();
}, get_animationDuration: function () {
return this._animationDuration;
}, isPointOver: function (a) {
return Telerik.Web.UI.Grid.Animation.containsPoint(Telerik.Web.UI.Grid.Animation.getBoundingRectangle(this.get_element()), a);
}, isPointOverOrigin: function (a) {
return Telerik.Web.UI.Grid.Animation.containsPoint(this._originBoundingRectangle, a);
}, canMove: function () {
return this.className.indexOf("rgGroupCol") < 0 && this.className.indexOf("rgExpandCol") < 0;
}, canMoveLeft: function () {
return this.canMove() && this.get_currentPosition() > 0 && this.get_originalPosition() <= this.get_currentPosition();
}, canMoveRight: function () {
var a = this._$element.parent().width() - this._$element.outerWidth();
return this.canMove() && this.get_currentPosition() < a && this.get_originalPosition() >= this.get_currentPosition();
}, moveLeft: function (a) {
this.moveTo(a, "left");
}, moveRight: function (a) {
this.moveTo(a, "right");
}, moveToOrigin: function () {
this.moveTo(0, "origin");
}, moveTo: function (c, d) {
var b = {left: null};
switch (d) {
case"left":
if (this.canMoveLeft()) {
b.left = this.get_currentPosition() === this.get_originalPosition() ? this.get_originalPosition() - c : this.get_originalPosition();
}
break;
case"right":
if (this.canMoveRight()) {
b.left = this.get_currentPosition() === this.get_originalPosition() ? this.get_originalPosition() + c : this.get_originalPosition();
}
break;
case"origin":
if (this.get_currentPosition !== this.get_originalPosition()) {
b.left = this.get_originalPosition();
}
break;
}
if (b.left !== null) {
this._currentPosition = b.left;
var a = this;
setTimeout(function () {
a._$element.stop(false, false).animate(b, a.get_animationDuration());
}, 10);
}
}, moveWithCursor: function (c, a) {
if (this.isDragged()) {
var b = {};
if (a) {
b.left = c.pageX - this._originalParentOffset.left + "px";
b.top = c.pageY - this._originalParentOffset.top + "px";
} else {
if (!Telerik.Web.UI.Grid.Animation.getElementRelativeTrackedPoint()) {
Telerik.Web.UI.Grid.Animation.trackElementRelativeMousePoint(this.get_element(), c);
}
b.left = c.pageX - this._originalParentOffset.left - Telerik.Web.UI.Grid.Animation.getElementRelativeTrackedPoint().left + "px";
}
this.get_element().css(b);
}
}
};
Type.registerNamespace("Telerik.Web.UI.Grid");
Type.registerNamespace("Telerik.Web.UI.Grid.Animation");
Telerik.Web.UI.Grid.Animation.getBoundingRectangle = function (a) {
a = a.jquery ? a : $telerik.$(a);
var b = a.offset();
var c = {};
c.left = c.x = b.left;
c.width = a.outerWidth();
c.top = c.y = b.top;
c.height = a.outerHeight();
return c;
};
Telerik.Web.UI.Grid.Animation.containsPoint = function (b, a) {
if (typeof(b.x) === "undefined") {
b.x = b.left;
}
if (typeof(b.y) === "undefined") {
b.y = b.top;
}
if (typeof(a.x) === "undefined") {
a.x = a.left;
}
if (typeof(a.y) === "undefined") {
a.y = a.top;
}
return $telerik.containsPoint(b, a.x, a.y);
};
Telerik.Web.UI.Grid.Animation.trackElementRelativeMousePoint = function (b, a) {
if (!a.pageX) {
$telerik.$.event.fix(a);
}
b = b.jquery ? b : $telerik.$(b);
var c = b.offset();
Telerik.Web.UI.Grid.Animation._trackedElement = b;
var d = Telerik.Web.UI.Grid.Animation._trackedElementRelativeMousePoint = {};
d.left = d.x = a.pageX - c.left;
d.top = d.y = a.pageY - c.top;
};
Telerik.Web.UI.Grid.Animation.getTrackedPoint = function () {
var c = Telerik.Web.UI.Grid.Animation.getElementRelativeTrackedPoint();
if (!Telerik.Web.UI.Grid.Animation._trackedElement || !c) {
return null;
}
var a = Telerik.Web.UI.Grid.Animation._trackedElement.offset();
var b = {};
b.left = b.x = a.left + c.left;
b.top = b.y = a.top + c.top;
return b;
};
Telerik.Web.UI.Grid.Animation.getElementRelativeTrackedPoint = function () {
return Telerik.Web.UI.Grid.Animation._trackedElementRelativeMousePoint;
};
Telerik.Web.UI.Grid.Animation.clearElementRelativeMousePoint = function () {
Telerik.Web.UI.Grid.Animation._trackedElement = null;
Telerik.Web.UI.Grid.Animation._trackedElementRelativeMousePoint = null;
};
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.GridColumnResizer = function (c, b) {
Telerik.Web.UI.GridColumnResizer.initializeBase(this);
this._isRealTimeResize = b;
this._column = c;
this._isRealTimeResize = b;
this._currentWidth = null;
this._leftResizer = document.createElement("span");
this._leftResizer.style.backgroundColor = "navy";
this._leftResizer.style.width = "1px";
this._leftResizer.style.position = "absolute";
this._leftResizer.style.cursor = "e-resize";
this._rightResizer = document.createElement("span");
this._rightResizer.style.backgroundColor = "navy";
this._rightResizer.style.width = "1px";
this._rightResizer.style.position = "absolute";
this._rightResizer.style.cursor = "e-resize";
this._resizerToolTip = document.createElement("span");
this._resizerToolTip.style.position = "absolute";
this._resizerToolTip.style.zIndex = 10000;
this._resizerToolTip.style.display = (this._column._owner._owner.ClientSettings.ClientMessages.ColumnResizeTooltipFormatString == "") ? "none" : "";
this._resizerToolTipFormatString = this._column._owner._owner.ClientSettings.ClientMessages.ColumnResizeTooltipFormatString;
if (this._column._owner._owner.Skin != "") {
this._resizerToolTip.className = String.format("GridToolTip GridToolTip_{0}", this._column._owner._owner.Skin);
this._leftResizer.className = String.format("GridLeftResizer GridLeftResizer_{0}", this._column._owner._owner.Skin);
this._rightResizer.className = String.format("GridRightResizer GridRightResizer_{0}", this._column._owner._owner.Skin);
}
if (!this._column._owner._owner._embeddedSkin || this._column._owner._owner.Skin == "") {
this._resizerToolTip.style.backgroundColor = "#F5F5DC";
this._resizerToolTip.style.border = "1px solid";
this._resizerToolTip.style.font = "icon";
this._resizerToolTip.style.padding = "2px";
}
var a = this._column.get_element().offsetWidth;
this._resizerToolTip.innerHTML = this._applyTooltipText(a);
document.body.appendChild(this._leftResizer);
document.body.appendChild(this._rightResizer);
document.body.appendChild(this._resizerToolTip);
this._resizerToolTip.style.width = this._resizerToolTip.clientWidth + (parseInt(a, 10).toString().length >= 3 ? 0 : 10) + "px";
this.CanDestroy = true;
this._onMouseUpDelegate = $telerik.addMobileHandler(this, document, "mouseup", this._onMouseUpHandler, null, true);
this._onMouseMoveDelegate = $telerik.addMobileHandler(this, this._column._owner._owner.get_element(), "mousemove", this._onMouseMoveHandler);
};
Telerik.Web.UI.GridColumnResizer.prototype = {
dispose: function () {
try {
this._destroy();
} catch (a) {
}
if (this._onMouseUpDelegate) {
$telerik.removeMobileHandler(document, "mouseup", this._onMouseUpDelegate, null, true);
}
if (this._onMouseMoveDelegate) {
$telerik.removeMobileHandler(this._column._owner._owner.get_element(), "mousemove", this._onMouseMoveDelegate);
}
this._leftResizer = null;
this._rightResizer = null;
this._resizerToolTip = null;
}, _position: function (c) {
this._leftResizer.style.top = Telerik.Web.UI.Grid.FindPosY(this._column.get_element()) + "px";
this._leftResizer.style.left = Telerik.Web.UI.Grid.FindPosX(this._column.get_element()) + "px";
this._rightResizer.style.top = this._leftResizer.style.top;
this._rightResizer.style.left = parseInt(this._leftResizer.style.left) + this._column.get_element().offsetWidth + "px";
var h = parseInt(this._rightResizer.style.top) - this._resizerToolTip.offsetHeight - 2;
if (h < 0) {
h += (this._resizerToolTip.offsetHeight + this._column.get_element().offsetHeight + 2);
}
this._resizerToolTip.style.top = h + "px";
var g = parseInt(this._rightResizer.style.left) - 5;
this._resizerToolTip.style.left = g + "px";
if ($telerik.elementOverflowsRight($telerik.getViewPortSize(), this._resizerToolTip)) {
this._resizerToolTip.style.left = (g - this._resizerToolTip.offsetWidth) + "px";
}
if (parseInt(this._leftResizer.style.left) < Telerik.Web.UI.Grid.FindPosX(this._column._owner.get_element())) {
this._leftResizer.style.display = "none";
}
var a = this._column, j = a._owner, d = j._owner, i = d.ClientSettings.Scrolling, f = j._hasMultiHeaders ? a.get_element().offsetHeight : j.get_element().tHead.offsetHeight;
if (!i.AllowScroll) {
this._leftResizer.style.height = j.get_element().tBodies[0].offsetHeight + f + "px";
} else {
if (i.UseStaticHeaders) {
this._leftResizer.style.height = d._gridDataDiv.clientHeight + f + "px";
} else {
var b = d._gridDataDiv.clientHeight;
if (j._hasMultiHeaders) {
b = b - j.get_element().tHead.offsetHeight + a.get_element().offsetHeight;
}
this._leftResizer.style.height = b + "px";
}
}
this._rightResizer.style.height = this._leftResizer.style.height;
}, _onMouseUpHandler: function (a) {
this._destroy(a);
}, _onMouseMoveHandler: function (a) {
if ($telerik.isTouchDevice) {
a.preventDefault();
}
this._move(a);
}, _destroy: function (b) {
if (this.CanDestroy) {
if (this._onMouseUpDelegate) {
$telerik.removeMobileHandler(document, "mouseup", this._onMouseUpDelegate, null, true);
this._onMouseUpDelegate = null;
}
if (this._onMouseMoveDelegate) {
$telerik.removeMobileHandler(this._column._owner._owner.get_element(), "mousemove", this._onMouseMoveDelegate);
this._onMouseMoveDelegate = null;
}
if (this._currentWidth != null) {
if (this._currentWidth > 0) {
var a = this._column;
tableView = a._owner, columnIndex = null;
if (tableView._hasMultiHeaders) {
columnIndex = Array.indexOf(tableView.get_columns(), a);
} else {
if (!$telerik.isIE7) {
columnIndex = a.get_element().cellIndex;
} else {
var d = tableView.get_columns();
for (var c = 0;
c < d.length;
c++) {
if (d[c] == this._column) {
columnIndex = c;
break;
}
}
}
}
tableView.resizeColumn(columnIndex, this._currentWidth);
this._currentWidth = null;
}
}
this._column._owner._owner._isResize = null;
document.body.removeChild(this._leftResizer);
document.body.removeChild(this._rightResizer);
document.body.removeChild(this._resizerToolTip);
this.CanDestroy = false;
}
}, _move: function (f) {
this._leftResizer.style.left = Telerik.Web.UI.Grid.FindPosX(this._column.get_element()) + "px";
this._rightResizer.style.left = parseInt(this._leftResizer.style.left) + (Telerik.Web.UI.Grid.GetEventPosX(f) - Telerik.Web.UI.Grid.FindPosX(this._column.get_element())) + "px";
var j = parseInt(this._rightResizer.style.left) - 5;
this._resizerToolTip.style.left = j + "px";
if ($telerik.elementOverflowsRight($telerik.getViewPortSize(), this._resizerToolTip)) {
this._resizerToolTip.style.left = (j - this._resizerToolTip.offsetWidth) + "px";
}
var m = parseInt(this._rightResizer.style.left) - parseInt(this._leftResizer.style.left);
var d = this._column.get_element().scrollWidth - m;
var i = this._resizerToolTip.offsetHeight;
this._resizerToolTip.innerHTML = this._applyTooltipText(m);
if (this._resizerToolTip.offsetHeight > i) {
this._resizerToolTip.style.width = parseInt(this._resizerToolTip.style.width) + 10 + "px";
}
if (!Telerik.Web.UI.Grid.FireEvent(this._column._owner, "OnColumnResizing", [this._column.Index, m])) {
return;
}
if (m <= 0) {
this._rightResizer.style.left = this._rightResizer.style.left;
this._destroy(f);
return;
}
this._currentWidth = m;
if (this._isRealTimeResize) {
var b = (navigator.userAgent.indexOf("Safari") != -1 || this._column._owner._hasMultiHeaders) ? Telerik.Web.UI.Grid.GetRealCellIndex(this._column._owner, this._column.get_element()) : this._column.get_element().cellIndex;
this._column._owner.resizeColumn(b, m);
} else {
this._currentWidth = m;
return;
}
if (Telerik.Web.UI.Grid.FindPosX(this._leftResizer) != Telerik.Web.UI.Grid.FindPosX(this._column.get_element())) {
this._leftResizer.style.left = Telerik.Web.UI.Grid.FindPosX(this._column.get_element()) + "px";
}
if (Telerik.Web.UI.Grid.FindPosX(this._rightResizer) != (Telerik.Web.UI.Grid.FindPosX(this._column.get_element()) + this._column.get_element().offsetWidth)) {
this._rightResizer.style.left = Telerik.Web.UI.Grid.FindPosX(this._column.get_element()) + this._column.get_element().offsetWidth + "px";
}
if (Telerik.Web.UI.Grid.FindPosY(this._leftResizer) != Telerik.Web.UI.Grid.FindPosY(this._column.get_element())) {
this._leftResizer.style.top = Telerik.Web.UI.Grid.FindPosY(this._column.get_element()) + "px";
this._rightResizer.style.top = Telerik.Web.UI.Grid.FindPosY(this._column.get_element()) + "px";
}
var a = this._column, l = a._owner, g = l._owner, k = g.ClientSettings.Scrolling, h = l._hasMultiHeaders ? a.get_element().offsetHeight : l.get_element().tHead.offsetHeight;
if (!k.AllowScroll) {
this._leftResizer.style.height = l.get_element().tBodies[0].offsetHeight + h + "px";
} else {
if (k.UseStaticHeaders) {
this._leftResizer.style.height = g._gridDataDiv.clientHeight + h + "px";
} else {
var c = g._gridDataDiv.clientHeight;
if (l._hasMultiHeaders) {
c = c - l.get_element().tHead.offsetHeight + a.get_element().offsetHeight;
}
this._leftResizer.style.height = c + "px";
}
}
this._rightResizer.style.height = this._leftResizer.style.height;
}, _applyTooltipText: function (b) {
var a = /\{0[^\}]*\}/g;
return this._resizerToolTipFormatString.replace(a, b);
}
};
Telerik.Web.UI.GridColumnResizer.registerClass("Telerik.Web.UI.GridColumnResizer", null, Sys.IDisposable);
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.Grid");
Telerik.Web.UI.Grid._uniqueIDToClientID = function (a) {
return a.replace(/[$:]/g, "_");
};
Telerik.Web.UI.Grid.getTableHeaderRow = function (c) {
var a = null;
if (c.tHead && c.tHead.style.display != "none") {
for (var b = 0;
b < c.tHead.rows.length;
b++) {
if (c.tHead.rows[b] != null) {
if (c.tHead.rows[b].cells[0] != null) {
if (c.tHead.rows[b].cells[0].tagName != null) {
if (c.tHead.rows[b].cells[0].tagName.toLowerCase() == "th") {
a = c.tHead.rows[b];
break;
}
}
}
}
}
}
return a;
};
Telerik.Web.UI.Grid.hasEventAttached = function (b, c, d) {
if ((typeof(b._events) !== "object") || (b._events == null)) {
return false;
}
var a = b._events[c];
if (!(a instanceof Array)) {
return false;
}
for (var e = 0, f = a.length;
e < f;
e++) {
if (a[e].handler === d) {
return true;
}
}
return false;
};
Telerik.Web.UI.Grid.ChangePageSize = function (c, b) {
if (c && c.PageSize != b) {
var a = c._raiseAction("PageSize", {newPageSize: parseInt(b, 10)});
if (!a.get_cancel()) {
c.set_pageSize(a.get_newPageSize());
}
}
};
Telerik.Web.UI.Grid.ChangingPageSizeComboHandler = function (f, b) {
var c;
if (b.get_item) {
c = b.get_item();
} else {
if (b.get_index) {
c = f.get_items().getItem(b.get_index());
}
}
if (c) {
var e = c.get_attributes().getAttribute("ownerTableViewId");
var d = null;
if (c.get_value()) {
d = c.get_value();
} else {
d = c.get_text();
}
if (e && d) {
var g = $find(e);
if (g && g.PageSize != d) {
var a = g._raiseAction("PageSize", {newPageSize: parseInt(d, 10)});
if (a.get_cancel()) {
b.set_cancel(true);
}
}
}
}
};
Telerik.Web.UI.Grid.ChangePageSizeComboHandler = function (e, a) {
var b;
if (a.get_item) {
b = a.get_item();
} else {
if (a.get_index) {
b = e.get_items().getItem(a.get_index());
}
}
if (b) {
var d = b.get_attributes().getAttribute("ownerTableViewId");
var c = null;
if (e.get_value) {
if (e.get_value()) {
c = e.get_value();
} else {
c = e.get_text();
}
} else {
if (b.get_value()) {
c = b.get_value();
} else {
c = b.get_text();
}
}
if (d && c) {
var h = parseInt(c);
var g = $find(d);
if (g) {
var f = b.get_attributes().getAttribute("seoRedirectUrl");
if (f) {
window.location.href = f;
return false;
}
g.set_pageSize(h);
}
}
}
};
Telerik.Web.UI.Grid.Sort = function (c, b) {
var a = c._raiseAction("Sort", {sortExpression: b});
if (!a.get_cancel()) {
b = a.get_sortExpression();
c.sort(b);
}
};
Telerik.Web.UI.Grid.GetRealCellIndex = function (c, a) {
for (var b = 0;
b < c.get_columns().length;
b++) {
if (c.get_columns()[b].get_element() == a) {
return b;
}
}
};
Telerik.Web.UI.Grid.CopyAttributes = function (d, c) {
for (var b = 0;
b < c.attributes.length;
b++) {
try {
if (c.attributes[b].name.toLowerCase() == "id") {
continue;
}
if (c.attributes[b].value != null && c.attributes[b].value != "null" && c.attributes[b].value != "") {
d.setAttribute(c.attributes[b].name, c.attributes[b].value);
}
} catch (a) {
continue;
}
}
};
Telerik.Web.UI.Grid.PositionDragElement = function (c, d) {
var a = $telerik.isTouchDevice ? $telerik.getTouchEventLocation(d).x : d.clientX;
var b = $telerik.isTouchDevice ? $telerik.getTouchEventLocation(d).y : d.clientY;
c.style.top = b + $telerik.getDocumentElementScrollTop() + 1 + "px";
c.style.left = a + $telerik.getDocumentElementScrollLeft() + 1 + "px";
if ($telerik.isOpera || ($telerik.isOpera || $telerik.isSafari2) || $telerik.isTouchDevice) {
c.style.top = parseInt(c.style.top) - document.body.scrollTop + "px";
}
};
Telerik.Web.UI.Grid.ClearDocumentEvents = function (a) {
if (!a) {
if (document.onmousedown != this.mouseDownHandler) {
this.documentOnMouseDown = document.onmousedown;
}
this.mouseDownHandler = function (b) {
return false;
};
document.onmousedown = this.mouseDownHandler;
}
if (document.onselectstart != this.selectStartHandler) {
this.documentOnSelectStart = document.onselectstart;
}
if (document.ondragstart != this.dragStartHandler) {
this.documentOnDragStart = document.ondragstart;
}
this.selectStartHandler = function () {
return false;
};
this.dragStartHandler = function () {
return false;
};
document.onselectstart = this.selectStartHandler;
document.ondragstart = this.dragStartHandler;
};
Telerik.Web.UI.Grid.RestoreDocumentEvents = function () {
if ((typeof(this.documentOnMouseDown) == "function") && (document.onmousedown != this.mouseDownHandler)) {
document.onmousedown = this.documentOnMouseDown;
} else {
document.onmousedown = "";
}
if ((typeof(this.documentOnSelectStart) == "function") && (document.onselectstart != this.selectStartHandler)) {
document.onselectstart = this.documentOnSelectStart;
} else {
document.onselectstart = "";
}
if ((typeof(this.documentOnDragStart) == "function") && (document.ondragstart != this.dragStartHandler)) {
document.ondragstart = this.documentOnDragStart;
} else {
document.ondragstart = "";
}
};
Telerik.Web.UI.Grid.IsChildOf = function (a, b) {
if (!a) {
return false;
}
while (a.parentNode) {
if (a.parentNode == b) {
return true;
}
a = a.parentNode;
}
return false;
};
Telerik.Web.UI.Grid.GetCurrentElement = function (b) {
if (!b) {
var b = window.event;
}
var a;
if (b.srcElement) {
a = b.srcElement;
} else {
a = b.target;
}
return Telerik.Web.UI.Grid.IsDomElement(a) ? a : null;
};
Telerik.Web.UI.Grid.IsDomElement = function (a) {
var b = typeof HTMLElement === "object";
if (b) {
return a instanceof HTMLElement;
} else {
return a && typeof a === "object" && a.nodeType === 1 && typeof a.nodeName === "string";
}
return false;
};
Telerik.Web.UI.Grid.GetCurrentTouchElement = function (a) {
if ($telerik.isTouchDevice) {
var b = $telerik.getTouchTarget(a);
return b;
}
};
Telerik.Web.UI.Grid.CreateReorderIndicators = function (c, i, h, a, g) {
if ((this.ReorderIndicator1 == null) && (this.ReorderIndicator2 == null)) {
this.ReorderIndicator1 = document.createElement("span");
this.ReorderIndicator2 = document.createElement("span");
if (h != "") {
var j = new Image();
j.src = h + "MoveDown.gif";
var b = new Image();
b.src = h + "MoveUp.gif";
this.ReorderIndicator1.innerHTML = '<img src="' + h + 'MoveDown.gif" alt="reorder indicator" />';
this.ReorderIndicator2.innerHTML = '<img src="' + h + 'MoveUp.gif" alt="reorder indicator" />';
this.ReorderIndicator1.className = "GridReorderTopImage_" + i;
this.ReorderIndicator2.className = "GridReorderBottomImage_" + i;
} else {
if (i == "") {
this.ReorderIndicator1.innerHTML = "&darr;";
this.ReorderIndicator2.innerHTML = "&uarr;";
} else {
this.ReorderIndicator1.className = "GridReorderTop GridReorderTop_" + i;
this.ReorderIndicator2.className = "GridReorderBottom GridReorderBottom_" + i;
}
}
this.ReorderIndicator1.style.backgroundColor = "transparent";
this.ReorderIndicator1.style.color = "darkblue";
this.ReorderIndicator1.style.fontSize = "1px";
this.ReorderIndicator2.style.backgroundColor = this.ReorderIndicator1.style.backgroundColor;
this.ReorderIndicator2.style.color = this.ReorderIndicator1.style.color;
this.ReorderIndicator2.style.fontSize = this.ReorderIndicator1.style.fontSize;
var f = $find(g);
var d = 0;
var e = 0;
if (a && c.nodeName == "TH" && f && f.GridDataDiv) {
var d = f.GridDataDiv.scrollLeft;
if (!f.ClientSettings.Scrolling.UseStaticHeaders) {
var e = f.GridDataDiv.scrollTop;
}
}
this.ReorderIndicator1.style.top = Telerik.Web.UI.Grid.FindPosY(c) - this.ReorderIndicator1.offsetHeight + "px";
this.ReorderIndicator1.style.left = Telerik.Web.UI.Grid.FindPosX(c) + "px";
this.ReorderIndicator2.style.top = Telerik.Web.UI.Grid.FindPosY(c) + c.offsetHeight + "px";
this.ReorderIndicator2.style.left = this.ReorderIndicator1.style.left;
this.ReorderIndicator1.style.visibility = "hidden";
this.ReorderIndicator1.style.display = "none";
this.ReorderIndicator1.style.position = "absolute";
this.ReorderIndicator2.style.visibility = this.ReorderIndicator1.style.visibility;
this.ReorderIndicator2.style.display = this.ReorderIndicator1.style.display;
this.ReorderIndicator2.style.position = this.ReorderIndicator1.style.position;
document.body.appendChild(this.ReorderIndicator1);
document.body.appendChild(this.ReorderIndicator2);
if (h != "") {
this.ReorderIndicator1.style.marginLeft = -parseInt(j.width / 2) + "px";
this.ReorderIndicator2.style.marginLeft = -parseInt(b.width / 2) + "px";
j = null;
b = null;
}
}
};
Telerik.Web.UI.Grid.NavigateToPage = function (f, b) {
var e = $find(f), a;
if (e) {
var d = e.get_currentPageIndex();
var c = d;
if (b == "Next") {
c++;
} else {
if (b == "Prev") {
c--;
} else {
if (b == "First") {
c = 0;
} else {
if (b == "Last") {
c = e.get_pageCount() - 1;
} else {
c = parseInt(b) - 1;
}
}
}
}
if (c < 0 || c > (e.get_pageCount() - 1)) {
return false;
}
a = e._raiseAction("Page", {newPageIndex: c});
if (!a.get_cancel()) {
c = a.get_newPageIndex();
e.page(c + 1);
}
}
};
Telerik.Web.UI.Grid.DestroyReorderIndicators = function () {
if ((this.ReorderIndicator1 != null) && (this.ReorderIndicator2 != null)) {
document.body.removeChild(this.ReorderIndicator1);
document.body.removeChild(this.ReorderIndicator2);
this.ReorderIndicator1 = null;
this.ReorderIndicator2 = null;
}
};
Telerik.Web.UI.Grid.MoveReorderIndicators = function (f, b, a, h) {
if ((this.ReorderIndicator1 != null) && (this.ReorderIndicator2 != null)) {
this.ReorderIndicator1.style.visibility = "visible";
this.ReorderIndicator1.style.display = "";
this.ReorderIndicator2.style.visibility = "visible";
this.ReorderIndicator2.style.display = "";
var g = $find(h);
var c = 0;
var d = 0;
if (a && b.nodeName == "TH" && g && g.GridDataDiv) {
var c = g.GridDataDiv.scrollLeft;
if (!g.ClientSettings.Scrolling.UseStaticHeaders) {
var d = g.GridDataDiv.scrollTop;
}
}
var i = 0;
if (a && b.nodeName == "TH" && g && this._columnInitiatorIndex != null && this._columnOverIndex != null && this._columnInitiatorIndex < this._columnOverIndex) {
i = b.offsetWidth;
}
this.ReorderIndicator1.style.top = Telerik.Web.UI.Grid.FindPosY(b) - this.ReorderIndicator1.offsetHeight + "px";
this.ReorderIndicator1.style.left = Telerik.Web.UI.Grid.FindPosX(b) + i + "px";
this.ReorderIndicator2.style.top = Telerik.Web.UI.Grid.FindPosY(b) + b.offsetHeight + "px";
this.ReorderIndicator2.style.left = this.ReorderIndicator1.style.left;
}
};
Telerik.Web.UI.Grid.getVisibleCols = function (a) {
var b = 0;
for (var c = 0, d = a.length;
c < d;
c++) {
if (a[c].style.display == "none") {
continue;
}
b++;
}
return b;
};
Telerik.Web.UI.Grid.hideShowCells = function (x, m, f, c) {
var z = Telerik.Web.UI.Grid.getVisibleCols(c);
var y = $find(x.id);
var h = y._hasMultiHeaders;
var s = [];
var w = false;
var v = y._owner.ClientSettings.Scrolling;
var p = v && v.AllowScroll && v.UseStaticHeaders;
var e = y.get_columns()[m];
if (h && ((p && x.id.indexOf("Header") > -1) || (!p && y.get_owner().get_masterTableView().get_id() == x.id))) {
s = Telerik.Web.UI.Grid.getMultiHeaderCells(y);
}
for (var k = 0, r = x.rows.length;
k < r;
k++) {
var n = false;
var b = 0;
var a = null;
var o = h && !!x.rows[k].className && x.rows[k].className.indexOf("rgMultiHeaderRow") > -1;
if (o && w) {
continue;
}
if (!h) {
if (x.rows[k].cells.length != z) {
if (x.rows[k].cells.length == 1) {
x.rows[k].cells[0].colSpan = z || 1;
} else {
for (var q = 0;
q < x.rows[k].cells.length;
q++) {
a = x.rows[k].cells[q];
if (Telerik.Web.UI.Grid._trySetColSpanOnDetailTable(a)) {
if (y && !y._isHelperColumnType(y.get_columns()[m]._data.ColumnType)) {
n = true;
break;
}
break;
}
b = a.colSpan;
if (((b > 1 && q + b >= m) || (a.parentNode.className.indexOf("rgGroupHeader") != -1 && a.className.indexOf("rgGroupCol") == -1))) {
if (e && e._data.ColumnType === "GridGroupSplitterColumn") {
var g = x.rows[k].cells[e.get_element().cellIndex];
if (g && g.className.indexOf("rgGroupCol") !== -1) {
break;
}
}
if (!f) {
var d = x.rows[k].cells[q].colSpan - 1;
if (d <= 0) {
d = 1;
}
x.rows[k].cells[q].colSpan = d;
} else {
x.rows[k].cells[q].colSpan = x.rows[k].cells[q].colSpan + 1;
}
break;
}
}
}
} else {
for (var q = 0;
q < x.rows[k].cells.length;
q++) {
a = x.rows[k].cells[q];
if (Telerik.Web.UI.Grid._trySetColSpanOnDetailTable(a)) {
var y = $find(x.id);
if (y && !y._isHelperColumnType(y.get_columns()[m]._data.ColumnType)) {
n = true;
break;
}
}
}
}
}
a = o ? s[m] : x.rows[k].cells[m];
if (!n) {
if (a != null && a.colSpan == 1) {
if (a.style.display == "none" && f) {
a.style.display = (window.netscape) ? "table-cell" : "";
}
if ((a.style.display == "" || a.style.display == "table-cell") && !f) {
a.style.display = "none";
}
if (y._owner.get_enableAriaSupport()) {
a.setAttribute("aria-hidden", (a.style.display != "none").toString());
}
if (h && !w) {
var u = a.parentCell;
w = true;
while (u) {
if (a.style.display == "none") {
var t = u.colSpan - 1;
if (t == 0) {
u.style.display = "none";
} else {
u.colSpan = t;
}
} else {
if (u.style.display == "none") {
u.style.display = "";
} else {
u.colSpan++;
}
}
u = u.parentCell;
}
}
}
if ($telerik.isIE6) {
Telerik.Web.UI.Grid._hideShowSelect(a, f);
}
}
}
if (p) {
if ($telerik.isFirefox || $telerik.isIE9Mode) {
x.style.tableLayout = "auto";
setTimeout(function () {
x.style.tableLayout = "fixed";
}, 0);
}
}
Telerik.Web.UI.Grid.calculateRowSpan(x, f, p, h, s, m);
};
Telerik.Web.UI.Grid.calculateRowSpan = function (t, e, n, f, q, m) {
var s = t.parentNode;
if (n && s && s.id && s.id.indexOf("GridHeader") == -1) {
return;
}
if (f) {
var b = q[m];
var g = t.tHead.rows;
var h = 0;
for (var l = 0;
l < g.length;
l++) {
var k = g[l];
var d = k.cells;
isRowHidden = true;
for (var o = 0;
o < d.length;
o++) {
var a = d[o];
isRowHidden = isRowHidden && a.style.display == "none";
}
if (isRowHidden || k.className.indexOf("rgFilterRow") > -1) {
h++;
}
}
for (var l = 0, p = g.length;
l < p;
l++) {
var k = g[l];
var d = k.cells;
var r = p - l;
for (var o = 0;
o < d.length;
o++) {
var a = d[o];
if (a.id && a.id.indexOf("MultiHeader") > -1) {
a.rowSpan = r - h;
}
}
if (l == g.length - 1 - h) {
break;
}
}
}
};
Telerik.Web.UI.Grid._trySetColSpanOnDetailTable = function (a) {
var c = $telerik.getFirstChildByTagName(a, "table", 0);
var d;
if (c) {
d = $find(c.id);
}
if (d) {
var b = d.get_parentView()._getVisibleColumnsCount();
a.colSpan = b;
return true;
}
return false;
};
Telerik.Web.UI.Grid._hideShowSelect = function (c, a) {
if (!c) {
return;
}
var d = c.getElementsByTagName("select");
for (var b = 0;
b < d.length;
b++) {
d[b].style.display = (a) ? "" : "none";
}
};
Telerik.Web.UI.Grid.FindPosX = function (a) {
return Telerik.Web.UI.Grid.GetLocation(a).x;
};
Telerik.Web.UI.Grid.FindPosY = function (a) {
return Telerik.Web.UI.Grid.GetLocation(a).y;
};
Telerik.Web.UI.Grid.CreateDragDrop = function (c, b, a) {
if (a) {
var d = b.get_element().parentNode;
this._columnInitiatorIndex = b.get_owner()._getCellIndexByColumnUniqueNameFromTableRowElement(d, b.get_element().UniqueName);
}
if (b._owner._owner._renderMode != Telerik.Web.UI.RenderMode.Mobile) {
Telerik.Web.UI.Grid.CreateReorderIndicators(b.get_element(), b._owner._owner.Skin, b._owner._owner._imagesPath, a, b._owner._owner.get_id());
}
this._moveHeaderDiv = document.createElement("div");
var f = document.createElement("table");
if (this._moveHeaderDiv.mergeAttributes) {
this._moveHeaderDiv.mergeAttributes(b._owner._owner.get_element());
} else {
Telerik.Web.UI.Grid.CopyAttributes(this._moveHeaderDiv, b.get_element());
}
this._moveHeaderDiv.style.margin = 0;
if (f.mergeAttributes) {
f.mergeAttributes(b._owner.get_element());
} else {
Telerik.Web.UI.Grid.CopyAttributes(f, b._owner.get_element());
}
f.style.margin = "0px";
f.style.height = b.get_element().offsetHeight + "px";
f.style.width = b.get_element().offsetWidth + "px";
f.style.border = "0px";
f.style.borderCollapse = "collapse";
f.style.padding = "0px";
var g = document.createElement("thead");
var h = document.createElement("tr");
f.appendChild(g);
g.appendChild(h);
h.appendChild(b.get_element().cloneNode(true));
this._moveHeaderDiv.appendChild(f);
if (!$telerik.isIE) {
this._moveHeaderDiv.className += " " + b._owner._owner.get_element().className;
}
if (b._owner._owner.get_enableAriaSupport()) {
this._moveHeaderDiv.removeAttribute("aria-dropeffect");
this._moveHeaderDiv.setAttribute("aria-grabbed", "true");
}
document.body.appendChild(this._moveHeaderDiv);
this._moveHeaderDiv.style.height = f.style.height;
this._moveHeaderDiv.style.width = f.style.width;
this._moveHeaderDiv.style.position = "absolute";
this._moveHeaderDiv.style.cursor = "move";
this._moveHeaderDiv.style.display = "none";
this._moveHeaderDiv.UniqueName = b.get_element().UniqueName;
Telerik.Web.UI.Grid.ClearDocumentEvents();
};
Telerik.Web.UI.Grid.MoveDragDrop = function (g, b, a) {
if (this._moveHeaderDiv != null) {
if (typeof(this._moveHeaderDiv.style.filter) != "undefined") {
this._moveHeaderDiv.style.filter = "alpha(opacity=80);";
} else {
if (typeof(this._moveHeaderDiv.style.MozOpacity) != "undefined") {
this._moveHeaderDiv.style.MozOpacity = 0.8;
} else {
if (typeof(this._moveHeaderDiv.style.opacity) != "undefined") {
this._moveHeaderDiv.style.opacity = 0.8;
}
}
}
this._moveHeaderDiv.style.visibility = "";
this._moveHeaderDiv.style.display = "";
Telerik.Web.UI.Grid.PositionDragElement(this._moveHeaderDiv, g);
var d;
if ($telerik.isTouchDevice) {
d = $telerik.getTouchTarget(g);
} else {
d = Telerik.Web.UI.Grid.GetCurrentElement(g);
}
if (b._owner._owner._renderMode != Telerik.Web.UI.RenderMode.Mobile) {
if (d != null) {
if (a && d.tagName.toLowerCase() == "th") {
this._columnOverIndex = b.get_owner()._getCellIndexByColumnUniqueNameFromTableRowElement(d.parentNode, d.UniqueName);
} else {
if (a && d.parentNode && d.parentNode.tagName && d.parentNode.tagName.toLowerCase() == "th") {
this._columnOverIndex = b.get_owner()._getCellIndexByColumnUniqueNameFromTableRowElement(d.parentNode.parentNode, d.parentNode.UniqueName);
d = d.parentNode;
}
}
var j = b._owner._owner._groupPanel ? b._owner._owner._groupPanel.get_element() : null;
if (Telerik.Web.UI.Grid.IsChildOf(d, b._owner.get_element()) || (b._owner._owner.ClientSettings.AllowDragToGroup && b._owner._owner._groupPanel && (Telerik.Web.UI.Grid.IsChildOf(d, j) || ($telerik.isTouchDevice && d == j)))) {
if (d != b.get_element() && d.parentNode == b.get_element().parentNode) {
if (!b._hierarchicalIndex) {
var c = b._owner.getColumnByUniqueName(d.UniqueName);
var l = true;
if (b._owner._hasMultiHeaders) {
l = !!b && !!c && b.get_columnGroupName() == c.get_columnGroupName();
}
if (c && c._data.Reorderable && c._owner._owner.ClientSettings.AllowColumnsReorder && l) {
d.title = b._owner._owner.ClientSettings.ClientMessages.DropHereToReorder;
Telerik.Web.UI.Grid.MoveReorderIndicators(g, d, a, b._owner._owner.get_id());
}
} else {
if (d.parentNode.cells && d != d.parentNode.cells[d.parentNode.cells.length - 1]) {
d.title = b._owner._owner.ClientSettings.ClientMessages.DropHereToReorder;
Telerik.Web.UI.Grid.MoveReorderIndicators(g, d, a, b._owner._owner.get_id());
}
}
} else {
if (b._owner._owner.ClientSettings.AllowDragToGroup && b._owner._owner._groupPanel && (Telerik.Web.UI.Grid.IsChildOf(d, j) || ($telerik.isTouchDevice && d == j))) {
Telerik.Web.UI.Grid.MoveReorderIndicators(g, j, a, b._owner._owner.get_id());
} else {
Telerik.Web.UI.Grid.ReorderIndicator1.style.visibility = "hidden";
Telerik.Web.UI.Grid.ReorderIndicator1.style.display = "none";
Telerik.Web.UI.Grid.ReorderIndicator1.style.position = "absolute";
Telerik.Web.UI.Grid.ReorderIndicator2.style.visibility = Telerik.Web.UI.Grid.ReorderIndicator1.style.visibility;
Telerik.Web.UI.Grid.ReorderIndicator2.style.display = Telerik.Web.UI.Grid.ReorderIndicator1.style.display;
Telerik.Web.UI.Grid.ReorderIndicator2.style.position = Telerik.Web.UI.Grid.ReorderIndicator1.style.position;
}
}
if (b) {
var m = b._owner._owner;
}
if (m && m.ClientSettings.Scrolling.AllowScroll && m._gridDataDiv) {
Telerik.Web.UI.Grid.AutoScrollHorizontally(m, d);
}
} else {
if (Telerik.Web.UI.Grid.ReorderIndicator1.style.visibility != "hidden") {
Telerik.Web.UI.Grid.ReorderIndicator1.style.visibility = "hidden";
Telerik.Web.UI.Grid.ReorderIndicator1.style.display = "none";
Telerik.Web.UI.Grid.ReorderIndicator1.style.position = "absolute";
Telerik.Web.UI.Grid.ReorderIndicator2.style.visibility = Telerik.Web.UI.Grid.ReorderIndicator1.style.visibility;
Telerik.Web.UI.Grid.ReorderIndicator2.style.display = Telerik.Web.UI.Grid.ReorderIndicator1.style.display;
Telerik.Web.UI.Grid.ReorderIndicator2.style.position = Telerik.Web.UI.Grid.ReorderIndicator1.style.position;
}
}
}
} else {
var f = this._moveHeaderDiv;
var h = b._owner._owner._groupPanel;
var i = b._owner._owner._groupPanel.cells[0];
var k = $telerik.isMouseOverElement(h, g);
f.className = f.className.replace("rgDropAllow", "");
f.className = f.className.replace("rgDropDisable", "");
f.className = f.className.trim();
i.className = i.className.replace("rgGroupPanelCellHover", "");
i.className = i.className.trim();
if (k) {
f.className += " rgDropAllow";
i.className += " rgGroupPanelCellHover";
} else {
f.className += " rgDropDisable";
}
if (i.children.length > 0 && i.children[0].tagName.toLowerCase() == "span") {
var n = i.children[0];
}
}
}
};
Telerik.Web.UI.Grid.AutoScrollHorizontally = function (g, a) {
if (!g || !this || g.ClientSettings.Scrolling.FrozenColumnsCount > 0) {
return;
}
var d, h;
var c = g._gridDataDiv;
if (!c || !this._moveHeaderDiv) {
return;
}
var b = Telerik.Web.UI.Grid.GetLocation(this._moveHeaderDiv);
d = Telerik.Web.UI.Grid.GetLocation(c).x;
h = d + c.offsetWidth;
var j = c.scrollLeft <= 0;
var k = c.scrollLeft >= (c.scrollWidth - c.offsetWidth + 16);
var e = b.x - d;
var f = h - b.x;
if (e < (50 + Telerik.Web.UI.Grid.GetScrollBarWidth()) && !j) {
var i = (10 - (e / 5));
c.scrollLeft = c.scrollLeft - i;
window.setTimeout(function () {
Telerik.Web.UI.Grid.AutoScrollHorizontally(g, a);
}, 100);
Telerik.Web.UI.Grid.HideReorderIndicators();
} else {
if (f < (50 + Telerik.Web.UI.Grid.GetScrollBarWidth()) && !k) {
var i = (10 - (f / 5));
c.scrollLeft = c.scrollLeft + i;
window.setTimeout(function () {
Telerik.Web.UI.Grid.AutoScrollHorizontally(g, a);
}, 100);
Telerik.Web.UI.Grid.HideReorderIndicators();
}
}
};
Telerik.Web.UI.Grid.HideReorderIndicators = function () {
if (!Telerik.Web.UI.Grid.ReorderIndicator1 || !Telerik.Web.UI.Grid.ReorderIndicator2) {
return;
}
Telerik.Web.UI.Grid.ReorderIndicator1.style.visibility = "hidden";
Telerik.Web.UI.Grid.ReorderIndicator1.style.display = "none";
Telerik.Web.UI.Grid.ReorderIndicator1.style.position = "absolute";
Telerik.Web.UI.Grid.ReorderIndicator2.style.visibility = Telerik.Web.UI.Grid.ReorderIndicator1.style.visibility;
Telerik.Web.UI.Grid.ReorderIndicator2.style.display = Telerik.Web.UI.Grid.ReorderIndicator1.style.display;
Telerik.Web.UI.Grid.ReorderIndicator2.style.position = Telerik.Web.UI.Grid.ReorderIndicator1.style.position;
};
Telerik.Web.UI.Grid.DestroyDragDrop = function (a) {
if (this._moveHeaderDiv != null) {
var b = this._moveHeaderDiv.parentNode;
b.removeChild(this._moveHeaderDiv);
this._moveHeaderDiv = null;
Telerik.Web.UI.Grid.RestoreDocumentEvents();
}
this._columnInitiatorIndex = null;
this._columnOverIndex = null;
if (!a) {
Telerik.Web.UI.Grid.DestroyReorderIndicators();
}
};
Telerik.Web.UI.Grid.AnimateRevertDragDrop = function (a, b) {
if (!this._moveHeaderDiv) {
return;
}
b = b || 300;
var c = this._moveHeaderDiv;
if ($telerik.$) {
(function (d) {
var e = $telerik.getLocation(a.get_element());
d(c).clone().appendTo(c.parentNode).animate({left: e.x, top: e.y}, b, function () {
d(this).remove();
});
})($telerik.$);
}
Telerik.Web.UI.Grid.DestroyDragDrop();
};
Telerik.Web.UI.Grid.GetFirstParentByTagName = function (a, b) {
while (a && a.parentNode) {
if (a.tagName.toLowerCase() == b.toLowerCase()) {
return a;
}
a = a.parentNode;
}
return null;
};
Telerik.Web.UI.Grid.GetFirstParentRowWithID = function (a) {
while (a && a.parentNode) {
if (a.tagName.toLowerCase() == "tr" && a.id != undefined && a.id != "") {
return a;
}
a = a.parentNode;
}
return null;
};
Telerik.Web.UI.Grid.CreateColumnResizers = function (a, b) {
Telerik.Web.UI.Grid.ClearDocumentEvents();
this.LeftResizer = document.createElement("span");
this.LeftResizer.style.backgroundColor = "navy";
this.LeftResizer.style.width = "1px";
this.LeftResizer.style.position = "absolute";
this.LeftResizer.style.cursor = "e-resize";
this.RightResizer = document.createElement("span");
this.RightResizer.style.backgroundColor = "navy";
this.RightResizer.style.width = "1px";
this.RightResizer.style.position = "absolute";
this.RightResizer.style.cursor = "e-resize";
this.ResizerToolTip = document.createElement("span");
this.ResizerToolTip.style.backgroundColor = "#F5F5DC";
this.ResizerToolTip.style.border = "1px solid";
this.ResizerToolTip.style.position = "absolute";
this.ResizerToolTip.style.font = "icon";
this.ResizerToolTip.style.padding = "2";
this.ResizerToolTip.innerHTML = "Width: <b>" + a.get_element().offsetWidth + "</b> <em>pixels</em>";
this.LeftResizer.style.display = this.ResizerToolTip.style.display = this.ResizerToolTip.style.display = "none";
document.body.appendChild(this.LeftResizer);
document.body.appendChild(this.RightResizer);
document.body.appendChild(this.ResizerToolTip);
Telerik.Web.UI.Grid.MoveColumnResizers(a, b);
};
Telerik.Web.UI.Grid.DestroyColumnResizers = function () {
Telerik.Web.UI.Grid.RestoreDocumentEvents();
if (this.LeftResizer && this.LeftResizer.parentNode) {
document.body.removeChild(this.LeftResizer);
this.LeftResizer = null;
}
if (this.RightResizer && this.RightResizer.parentNode) {
document.body.removeChild(this.RightResizer);
this.RightResizer = null;
}
if (this.ResizerToolTip && this.ResizerToolTip.parentNode) {
document.body.removeChild(this.ResizerToolTip);
this.ResizerToolTip = null;
}
};
Telerik.Web.UI.Grid.MoveColumnResizers = function (a, d) {
if (!this.LeftResizer || !this.RightResizer || !this.RightResizer) {
return;
}
this.LeftResizer.style.display = this.RightResizer.style.display = this.ResizerToolTip.style.display = "";
this.LeftResizer.style.top = Telerik.Web.UI.Grid.FindPosY(a.get_element()) + "px";
this.LeftResizer.style.left = Telerik.Web.UI.Grid.FindPosX(a.get_element()) + "px";
this.RightResizer.style.top = this.LeftResizer.style.top;
this.RightResizer.style.left = Telerik.Web.UI.Grid.GetEventPosX(d) - 5 + "px";
this.ResizerToolTip.style.top = parseInt(this.RightResizer.style.top) - 20 + "px";
this.ResizerToolTip.style.left = parseInt(this.RightResizer.style.left) - 5 + "px";
if (parseInt(this.LeftResizer.style.left) < Telerik.Web.UI.Grid.FindPosX(a._owner.get_element())) {
this.LeftResizer.style.display = "none";
}
if (!a._owner._owner.ClientSettings.Scrolling.AllowScroll) {
this.LeftResizer.style.height = a._owner.get_element().tBodies[0].offsetHeight + a._owner.get_element().tHead.offsetHeight + "px";
} else {
var b = $get(a._owner._owner.ClientID + "_GridData");
if (a._owner._owner.ClientSettings.Scrolling.UseStaticHeaders) {
this.LeftResizer.style.height = b.clientHeight + a._owner.get_element().tHead.offsetHeight + "px";
} else {
this.LeftResizer.style.height = b.clientHeight + "px";
}
}
this.RightResizer.style.height = this.LeftResizer.style.height;
var c = parseInt(this.RightResizer.style.left) - parseInt(this.LeftResizer.style.left);
this.ResizerToolTip.innerHTML = "Width: <b>" + c + "</b> <em>pixels</em>";
if (a._owner._owner.ClientSettings.Resizing.EnableRealTimeResize) {
if (c > 0) {
a.get_element().style.width = c + "px";
this.RightResizer.style.left = parseInt(this.LeftResizer.style.left) + a.get_element().offsetWidth + "px";
}
}
if (parseInt(this.RightResizer.style.left) <= parseInt(this.LeftResizer.style.left) - 1) {
Telerik.Web.UI.Grid.DestroyColumnResizers();
}
};
Telerik.Web.UI.Grid.FindScrollPosX = function (a) {
var b = 0;
while (a.parentNode) {
if (typeof(a.parentNode.scrollLeft) == "number") {
b += a.parentNode.scrollLeft;
}
a = a.parentNode;
}
if (document.body.currentStyle && document.body.currentStyle.marginLeft.indexOf("px") != -1 && !window.opera) {
b = parseInt(b) - parseInt(document.body.currentStyle.marginLeft);
}
return b;
};
Telerik.Web.UI.Grid.FindScrollPosY = function (a) {
var b = 0;
while (a.parentNode) {
if (typeof(a.parentNode.scrollTop) == "number") {
b += a.parentNode.scrollTop;
}
a = a.parentNode;
}
if (document.body.currentStyle && document.body.currentStyle.marginTop.indexOf("px") != -1 && !window.opera) {
b = parseInt(b) - parseInt(document.body.currentStyle.marginTop);
}
return b;
};
Telerik.Web.UI.Grid.GetEventPosX = function (a) {
if ($telerik.isTouchDevice) {
return $telerik.getTouchEventLocation(a).x;
} else {
return parseInt(a.clientX) + parseInt($telerik.getScrollOffset(document.body, true).x);
}
};
Telerik.Web.UI.Grid.GetEventPosY = function (a) {
if ($telerik.isTouchDevice) {
return $telerik.getTouchEventLocation(a).y;
} else {
return parseInt(a.clientY) + parseInt($telerik.getScrollOffset(document.body, true).y);
}
};
Telerik.Web.UI.Grid.IsScrollOnLeftSide = function () {
if (typeof(this._IsScrollOnLeftSide) == "undefined") {
Telerik.Web.UI.Grid.getScrollBarHeight();
}
return this._IsScrollOnLeftSide;
};
Telerik.Web.UI.Grid.getScrollBarHeight = function () {
try {
if (typeof(this.scrollbarHeight) == "undefined") {
var f, a = 0;
var b = document.createElement("div");
b.style.position = "absolute";
b.style.top = "-1000px";
b.style.left = "-1000px";
b.style.width = "100px";
b.style.height = "100px";
b.style.overflow = "auto";
var c = document.createElement("div");
c.style.width = "1000px";
c.style.height = "1000px";
b.appendChild(c);
document.body.appendChild(b);
f = b.offsetHeight;
a = b.clientHeight;
document.body.removeChild(document.body.lastChild);
this.scrollbarHeight = f - a;
if (this.scrollbarHeight <= 0 || a == 0) {
this.scrollbarHeight = 16;
}
b.dir = "rtl";
var d = document.createElement("div");
d.style.position = "absolute";
d.style.left = "0";
d.style.height = "100%";
d.style.width = "100%";
b.appendChild(d);
if ($telerik.isOpera) {
d.style.left = "";
d.style.width = "100px";
}
document.body.appendChild(b);
this._IsScrollOnLeftSide = false;
if ($telerik.$(b).offset().left != $telerik.$(d).offset().left || $telerik.isChrome) {
this._IsScrollOnLeftSide = true;
}
b.removeChild(c);
b.removeChild(d);
b.parentNode.removeChild(b);
b = null;
c = null;
d = null;
}
return this.scrollbarHeight;
} catch (e) {
this._IsScrollOnLeftSide = false;
return false;
}
};
Telerik.Web.UI.Grid.GetScrollBarWidth = function () {
try {
if (typeof(this.scrollbarWidth) == "undefined") {
var e, a = 0;
var b = document.createElement("div");
b.style.position = "absolute";
b.style.top = "-1000px";
b.style.left = "-1000px";
b.style.width = "100px";
b.style.overflow = "auto";
var c = document.createElement("div");
c.style.width = "1000px";
b.appendChild(c);
document.body.appendChild(b);
e = b.offsetWidth;
a = b.clientWidth;
document.body.removeChild(document.body.lastChild);
this.scrollbarWidth = e - a;
if (this.scrollbarWidth <= 0 || a == 0) {
this.scrollbarWidth = 16;
}
b.removeChild(c);
b.parentNode.removeChild(b);
b = null;
c = null;
}
return this.scrollbarWidth;
} catch (d) {
return false;
}
};
Telerik.Web.UI.Grid.IsRightToLeft = function (b) {
try {
while (b && b != document) {
if ($telerik.getCurrentStyle(b, "direction") == "rtl") {
return true;
}
b = b.parentNode;
}
return false;
} catch (a) {
return false;
}
};
Telerik.Web.UI.Grid.FireEvent = function (e, c, b) {
try {
var d = true;
if (typeof(e[c]) == "string") {
eval(e[c]);
} else {
if (typeof(e[c]) == "function") {
if (b) {
switch (b.length) {
case 1:
d = e[c](b[0]);
break;
case 2:
d = e[c](b[0], b[1]);
break;
}
} else {
d = e[c]();
}
}
}
if (typeof(d) != "boolean") {
return true;
} else {
return d;
}
} catch (a) {
throw a;
}
};
Telerik.Web.UI.Grid.GetTableColGroup = function (b) {
try {
return b.getElementsByTagName("colgroup")[0];
} catch (a) {
return false;
}
};
Telerik.Web.UI.Grid.RemoveHiddenColGroupCols = function (a) {
try {
var b = a.getElementsByTagName("col");
for (var d = 0;
d < b.length;
d++) {
if (b[d].style.display && b[d].style.display == "none") {
b[d].parentNode.removeChild(b[d]);
d--;
}
}
} catch (c) {
}
};
Telerik.Web.UI.Grid.GetTableColGroupCols = function (a) {
try {
var b = new Array();
var e = a.childNodes[0];
for (var d = 0;
d < a.childNodes.length;
d++) {
if ((a.childNodes[d].tagName) && (a.childNodes[d].tagName.toLowerCase() == "col")) {
b[b.length] = a.childNodes[d];
}
}
return b;
} catch (c) {
return false;
}
};
Telerik.Web.UI.Grid.ClearItemStyle = function (f, c, d) {
Sys.UI.DomElement.removeCssClass(f, d);
if (c) {
var b = f.style.cssText.toLowerCase().replace(/ /g, "");
var a = b.split(";");
for (var e = 0;
e < a.length;
e++) {
if (c.indexOf(a[e]) != -1) {
a[e] = "";
}
}
f.style.cssText = a.join(";");
}
};
Telerik.Web.UI.Grid.SetItemStyle = function (c, a, b) {
Sys.UI.DomElement.addCssClass(c, b);
if (a) {
c.style.cssText = c.style.cssText + ";" + a;
}
};
Telerik.Web.UI.Grid.ScrollIntoView = function (i) {
var a = Telerik.Web.UI.Grid.getScrollableContainer(i) || (document.body || document.documentElement);
var e = i;
var h = $telerik.getLocation(e).y - $telerik.getLocation(a).y, g = h + a.scrollTop, f = g + e.offsetHeight;
var c = a.clientHeight;
var d = parseInt(a.scrollTop, 10);
var b = d + c;
if (e.offsetHeight > c || g < d) {
a.scrollTop = g;
} else {
if (f > b) {
a.scrollTop = f - c;
}
}
a.scrollTop = a.scrollTop;
};
Telerik.Web.UI.Grid.getScrollableContainer = function (a) {
if (!a || !a.parentNode) {
return;
}
var d = null;
var c = a.parentNode;
while (c != null) {
if (c.tagName.toUpperCase() == "BODY") {
d = c;
break;
}
var b = $telerik.getCurrentStyle(c, "overflowY");
if (b == "scroll" || b == "auto") {
d = c;
break;
}
c = c.parentNode;
}
return d;
};
Telerik.Web.UI.Grid.GetNestedTableView = function (c) {
var b = null;
var a = Telerik.Web.UI.Grid.GetNestedTable(c);
if (a) {
b = $find(a.id.split("__")[0]);
}
return b;
};
Telerik.Web.UI.Grid.GetLastNestedTableView = function (c) {
var b = null;
var a = Telerik.Web.UI.Grid.GetLastNestedTable(c);
if (a) {
b = $find(a.id.split("__")[0]);
}
return b;
};
Telerik.Web.UI.Grid.GetPreviousNestedTableView = function (b) {
var a = null;
if (b.previousSibling && b.previousSibling.previousSibling) {
a = Telerik.Web.UI.Grid.GetNestedTableView(b.previousSibling);
}
return a;
};
Telerik.Web.UI.Grid.GetNestedTable = function (d) {
var b = null;
var c = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(d, "tr");
if (c) {
var a = c.getElementsByTagName("table");
if (a.length > 0 && a[0].id.indexOf("Detail") != -1) {
b = a[0];
}
}
return b;
};
Telerik.Web.UI.Grid.GetLastNestedTable = function (f) {
var d = null;
var e = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(f, "tr");
if (e) {
var b = e.getElementsByTagName("table");
for (var c = b.length - 1;
c >= 0;
c--) {
var a = b[c];
if (a.id.indexOf("Detail") != -1 && a.id.indexOf("_mainTable") == -1) {
d = a;
break;
}
}
}
return d;
};
Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName = function (a, b) {
var a = a.nextSibling;
while (a != null && (a.nodeType == 3 || (a.tagName && a.tagName.toLowerCase() != b.toLowerCase()))) {
a = a.nextSibling;
}
return a;
};
Telerik.Web.UI.Grid.GetNodePreviousSiblingByTagName = function (a, b) {
var a = a.previousSibling;
while ((a != null) && (a.nodeType == 3 || (a.tagName && a.tagName.toLowerCase() != b.toLowerCase()))) {
a = a.previousSibling;
}
return a;
};
Telerik.Web.UI.Grid.ClearBestFitCache = function (a) {
for (var b = 0, c = a.length;
b < c;
b++) {
a[b]._cachedBestFitSize = null;
}
};
Telerik.Web.UI.Grid.LocationCache = {};
Telerik.Web.UI.Grid.GetLocation = function (a) {
if ($telerik.isOpera) {
return $telerik.originalGetLocation(a);
}
return $telerik.getLocation(a);
};
Telerik.Web.UI.Grid.GetGrid = function (a) {
while (!!a) {
if (a.tagName.toLowerCase() == "div" && a.id && $find(a.id)) {
return $find(a.id);
}
a = a.parentNode;
}
return null;
};
Telerik.Web.UI.Grid.ClientStateData = function ClientStateData() {
var a = {};
this.add = function (b, c) {
a[b] = c;
};
this.toString = function () {
var c = "";
var d = null;
for (var b in a) {
c += b;
d = a[b];
if (typeof(d) != "undefined" && d != null) {
c += ",";
c += a[b];
}
c += ";";
}
return c;
};
};
Telerik.Web.UI.Grid.getMultiHeaderCells = function (k) {
var c = "MultiHeader";
var h = k.get_element();
var d = h.tHead.rows;
var b = [];
for (var e = 0;
e < d.length;
e++) {
var g = d[e];
for (var f = 0;
f < g.cells.length;
f++) {
var a = g.cells[f];
if (a.id && a.id.indexOf(c) > -1) {
b.push(a);
}
}
}
b.sort(function (i, j) {
return i.id.split(c)[1] - j.id.split(c)[1];
});
return b;
};
Telerik.Web.UI.Grid.correctWidthForIE = function (a) {
return parseInt(a.currentStyle.borderLeftWidth) + parseInt(a.currentStyle.borderRightWidth) + parseInt(a.currentStyle.paddingLeft) + parseInt(a.currentStyle.paddingRight);
};
Telerik.Web.UI.Grid.IsEditableControl = function (a) {
var b = a.tagName ? a.tagName.toLowerCase() : null;
if (b && (b === "input" || b === "textarea" || b === "select" || b === "option" || b == "checkbox")) {
return true;
}
return false;
};
Telerik.Web.UI.Grid.IsActionControl = function (b) {
if (b.jquery) {
b = b[0];
}
var c = b.tagName ? b.tagName.toLowerCase() : null;
var a = $find(b.id);
if (c && (c == "button" || c == "a" || (a && Telerik.Web.UI.RadButton && Telerik.Web.UI.RadButton.isInstanceOfType(a)))) {
return true;
}
return Telerik.Web.UI.Grid.IsEditableControl(b);
};
Telerik.Web.UI.Grid.BuildEventArgs = function (a, b) {
for (var d in b) {
var c = d;
var e = b[d];
if (c.indexOf("et_") > 0) {
a[c] = e;
continue;
}
a["_" + c] = e;
a["get_" + c] = function (f) {
return function () {
return this["_" + f];
};
}(c);
}
return a;
};
Telerik.Web.UI.Grid.TouchPointDirection = {
None: -1,
N: 0,
NNE: 1,
NE: 2,
ENE: 3,
E: 4,
ESE: 5,
SE: 6,
SSE: 7,
S: 8,
SSW: 9,
SW: 10,
WSW: 11,
W: 12,
WNW: 13,
NW: 14,
NNW: 15
};
Telerik.Web.UI.Grid.TouchPointMovement = {Up: 0, Left: 1, Down: 2, Right: 3, None: 4, Inconsistent: 5};
Telerik.Web.UI.Grid.detectTouchPointDirection = function (c, b, a) {
if (b.x > c.x) {
if (b.y > c.y) {
if (a == 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.SE;
}
if (a > 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.ESE;
}
if (a < 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.SSE;
}
} else {
if (b.y == c.y) {
return Telerik.Web.UI.Grid.TouchPointDirection.E;
} else {
if (a == 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.NE;
}
if (a > 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.ENE;
}
if (a < 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.NNE;
}
}
}
} else {
if (b.x == c.x) {
if (b.y > c.y) {
return Telerik.Web.UI.Grid.TouchPointDirection.S;
} else {
if (b.y == c.y) {
return Telerik.Web.UI.Grid.TouchPointDirection.None;
} else {
return Telerik.Web.UI.Grid.TouchPointDirection.N;
}
}
} else {
if (b.y > c.y) {
if (a == 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.SW;
}
if (a > 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.WSW;
}
if (a < 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.SSW;
}
} else {
if (b.y == c.y) {
return Telerik.Web.UI.Grid.TouchPointDirection.W;
} else {
if (a == 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.NW;
}
if (a > 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.WNW;
}
if (a < 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.NNW;
}
}
}
}
}
};
Telerik.Web.UI.Grid.detectTouchPointMovement = function (a) {
if (a >= Telerik.Web.UI.Grid.TouchPointDirection.NE && a < Telerik.Web.UI.Grid.TouchPointDirection.SE) {
return Telerik.Web.UI.Grid.TouchPointMovement.Right;
}
if (a >= Telerik.Web.UI.Grid.TouchPointDirection.SE && a < Telerik.Web.UI.Grid.TouchPointDirection.SW) {
return Telerik.Web.UI.Grid.TouchPointMovement.Down;
}
if (a >= Telerik.Web.UI.Grid.TouchPointDirection.SW && a < Telerik.Web.UI.Grid.TouchPointDirection.NW) {
return Telerik.Web.UI.Grid.TouchPointMovement.Left;
}
if (a >= Telerik.Web.UI.Grid.TouchPointDirection.NW || (a >= Telerik.Web.UI.Grid.TouchPointDirection.N && a < Telerik.Web.UI.Grid.TouchPointDirection.NE)) {
return Telerik.Web.UI.Grid.TouchPointMovement.Up;
}
if (a == Telerik.Web.UI.Grid.TouchPointDirection.None) {
return Telerik.Web.UI.Grid.TouchPointMovement.None;
}
};
Telerik.Web.UI.Grid.reorderArray = function (a, e, f) {
var c = [];
for (var b = 0;
b < a.length;
b++) {
c[b] = a[b];
}
if (e > f) {
var d = c.splice(e, 1)[0];
c.splice(f, 0, d);
return c;
}
if (e < f) {
c.splice(f + 1, 0, c[e]);
c.splice(e, 1);
return c;
}
};
Telerik.Web.UI.Grid.Draggable = (function (a) {
function b(c) {
this._options = c;
this._isDragging = false;
this.init(c);
}
b.prototype = {
init: function (c) {
a(c.container).onEvent("down", a.proxy(this._down, this), {ns: "draggable"});
}, dispose: function () {
a(document).add(this._options.container).off(".draggable");
}, _positionDragElement: function (c) {
var d = $telerik.getEventLocation(c);
this._$dragElement.offset({top: d.pageY + 1, left: d.pageX + 1});
}, _down: function (c) {
var d = this._options;
var f;
if (d.canDrag.call(d.thisArg, c)) {
f = d.createDraggable.call(d.thisArg, c);
if (f === false) {
return;
}
a(document).onEvent("move", a.proxy(this._move, this), {ns: "draggable"});
a(document).onEvent("up", a.proxy(this._up, this), {ns: "draggable"});
this._$dragElement = a(f).appendTo(document.body);
if (d.createDropClue) {
this._$dropClue = a(d.createDropClue.call(d.thisArg, c)).css("position", "absolute").appendTo(document.body).hide();
}
this._positionDragElement(c);
this._isDragging = true;
}
}, _move: function (c) {
var d = this._options;
this._positionDragElement(c);
d.dragging.call(d.thisArg, c, {$dropClue: this._$dropClue, $dragElement: this._$dragElement});
c.preventDefault();
}, _up: function (c) {
var d = this._options;
if (this._isDragging) {
if (d.stopDragging) {
d.stopDragging.call(d.thisArg, c, {$dragElement: this._$dragElement});
}
this._$dragElement.remove();
if (this._$dropClue) {
this._$dropClue.remove();
}
a(document).off(".draggable");
this._isDragging = false;
}
}
};
return b;
})($telerik.$);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.GridItemResizer = function (a) {
Telerik.Web.UI.GridItemResizer.initializeBase(this);
this._owner = a;
this._onResizeMouseUpDelegate = null;
this._cellsWithEvents = [];
};
Telerik.Web.UI.GridItemResizer.prototype = {
dispose: function () {
for (var a = 0;
a < this._cellsWithEvents.length;
a++) {
$clearHandlers(this._cellsWithEvents[a]);
this._cellsWithEvents[a]._events = null;
this._cellsWithEvents[a]._onResizeMouseDownDelegate = null;
}
this._cellsWithEvents = null;
this._destroyRowResizer();
if (this._onResizeMouseUpDelegate) {
$telerik.removeExternalHandler(document, "mouseup", this._onResizeMouseUpDelegate);
}
}, _detectResizeCursorsOnItems: function (d, a) {
var i = this;
if ((a != null) && (a.tagName.toLowerCase() == "td") && !this._owner.MoveHeaderDiv) {
var f = Telerik.Web.UI.Grid.GetFirstParentByTagName(a, "tr");
var h = false;
while (f && Telerik.Web.UI.Grid.IsChildOf(f, this._owner.get_element())) {
if (f.id && f.id.split("__").length == 2) {
h = true;
break;
}
f = Telerik.Web.UI.Grid.GetFirstParentByTagName(f.parentNode, "tr");
}
if (!h) {
return;
}
var b = a.parentNode.parentNode.parentNode;
var c = $find(b.id);
if (c != null) {
if (!c.get_element()) {
return;
}
if (!c.get_element().tBodies[0]) {
return;
}
var k = Telerik.Web.UI.Grid.GetEventPosY(d);
var l = $telerik.isSafari ? Telerik.Web.UI.Grid.FindPosY(f) : Telerik.Web.UI.Grid.FindPosY(a);
var g = l + a.offsetHeight;
this._resizeTolerance = 5;
var j = a.title;
if ((k > g - this._resizeTolerance) && (k < g + this._resizeTolerance)) {
a.style.cursor = "n-resize";
a.title = this._owner.ClientSettings.ClientMessages.DragToResize;
if (!a._onResizeMouseDownDelegate) {
a._onResizeMouseDownDelegate = Function.createDelegate(this, this._onResizeMouseDownHandler);
$addHandler(a, "mousedown", a._onResizeMouseDownDelegate);
this._cellsWithEvents[this._cellsWithEvents.length] = a;
}
} else {
a.style.cursor = "default";
a.title = "";
if (a._onResizeMouseDownDelegate) {
if (a._events != null) {
$removeHandler(a, "mousedown", a._onResizeMouseDownDelegate);
}
a._onResizeMouseDownDelegate = null;
a._events = null;
}
}
}
}
}, _moveItemResizer: function (a) {
if ((this._owner._rowResizer != "undefined") && (this._owner._rowResizer != null) && (this._owner._rowResizer.parentNode != null)) {
this._owner._rowResizer.style.top = Telerik.Web.UI.Grid.GetEventPosY(a) + "px";
if (this._owner.ClientSettings.Resizing.EnableRealTimeResize) {
this._destroyRowResizerAndResizeRow(a, false);
this._updateRowResizerWidth(a);
}
}
}, _destroyRowResizerAndResizeRow: function (d, g) {
if ((this._owner._cellToResize != "undefined") && (this._owner._cellToResize != null) && (this._owner._cellToResize.tagName.toLowerCase() == "td") && (this._owner._rowResizer != "undefined") && (this._owner._rowResizer != null)) {
var f;
var a = $telerik.isSafari ? Telerik.Web.UI.Grid.FindPosY(this._owner._cellToResize.parentNode) : Telerik.Web.UI.Grid.FindPosY(this._owner._cellToResize);
if (this._gridDataDiv) {
f = parseInt(this._owner._rowResizer.style.top) + this._gridDataDiv.scrollTop - (a);
} else {
f = parseInt(this._owner._rowResizer.style.top) - (a);
}
if (f > 0) {
var b = this._owner._cellToResize.parentNode.parentNode.parentNode;
var c = $find(b.id);
if (c != null) {
c.resizeItem(this._owner._cellToResize.parentNode.rowIndex, f);
}
}
}
if (g) {
this._destroyRowResizer();
}
}, _updateRowResizerWidth: function (c) {
var a = Telerik.Web.UI.Grid.GetCurrentElement(c);
if ((a != null) && (a.tagName.toLowerCase() == "td")) {
var b = this._owner._rowResizerRefTable;
if (b != null) {
this._owner._rowResizer.style.width = this._owner.get_element().offsetWidth + "px";
}
}
}, _createRowResizer: function (d) {
this._destroyRowResizer();
var a = Telerik.Web.UI.Grid.GetCurrentElement(d);
if ((a != null) && (a.tagName.toLowerCase() == "td")) {
if (a.cellIndex > 0) {
var g = a.parentNode.rowIndex;
a = a.parentNode.parentNode.parentNode.rows[g].cells[0];
}
this._owner._rowResizer = null;
this._owner._cellToResize = a;
var b = a.parentNode.parentNode.parentNode;
var c = $find(b.id);
this._owner._rowResizer = document.createElement("div");
this._owner._rowResizer.style.backgroundColor = "navy";
this._owner._rowResizer.style.height = "1px";
this._owner._rowResizer.style.fontSize = "1";
this._owner._rowResizer.style.position = "absolute";
this._owner._rowResizer.style.cursor = "n-resize";
if (c != null) {
this._owner._rowResizerRefTable = c;
this._owner._rowResizer.style.width = this._owner.get_element().offsetWidth + "px";
this._owner._rowResizer.style.left = Telerik.Web.UI.Grid.FindPosX(this._owner.get_element()) + "px";
}
this._owner._rowResizer.style.top = Telerik.Web.UI.Grid.GetEventPosY(d) + "px";
var f = document.body;
f.appendChild(this._owner._rowResizer);
}
}, _destroyRowResizer: function () {
if ((this._owner._rowResizer != "undefined") && (this._owner._rowResizer != null) && (this._owner._rowResizer.parentNode != null)) {
var a = this._owner._rowResizer.parentNode;
a.removeChild(this._owner._rowResizer);
this._owner._rowResizer = null;
this._owner._rowResizerRefTable = null;
}
}, _onResizeMouseDownHandler: function (b) {
var a = Telerik.Web.UI.Grid.GetCurrentElement(b);
if (a) {
if (a.tagName.toLowerCase() != "td") {
return;
}
$clearHandlers(a);
}
this._createRowResizer(b);
Telerik.Web.UI.Grid.ClearDocumentEvents();
this._onResizeMouseUpDelegate = Function.createDelegate(this, this._onResizeMouseUpHandler);
$telerik.addExternalHandler(document, "mouseup", this._onResizeMouseUpDelegate);
this._owner._isRowResize = true;
}, _onResizeMouseUpHandler: function (a) {
$telerik.removeExternalHandler(document, "mouseup", this._onResizeMouseUpDelegate);
this._owner._isRowResize = null;
this._destroyRowResizerAndResizeRow(a, true);
Telerik.Web.UI.Grid.RestoreDocumentEvents();
}
};
Telerik.Web.UI.GridItemResizer.registerClass("Telerik.Web.UI.GridItemResizer", null, Sys.IDisposable);
Telerik.Web.UI.GridDataItem = function (a) {
Telerik.Web.UI.GridDataItem.initializeBase(this, [a]);
this._owner = {};
this._data = {};
this._selected = false;
this._selectable = true;
this._expanded = false;
this._display = false;
this._dataKeyValue = null;
this._dataItem = null;
this._itemIndexHierarchical = "";
this._itemIndex = null;
this._editFormItem = "notSet";
this._nestedViews = null;
};
Telerik.Web.UI.GridDataItem.prototype = {
initialize: function () {
Telerik.Web.UI.GridDataItem.callBaseMethod(this, "initialize");
var b = this, a = b._element.id.split("_");
b._itemIndex = parseInt(a[a.length - 1]);
}, dispose: function () {
this._owner._owner.raise_rowDestroying(new Telerik.Web.UI.GridDataItemEventArgs(this.get_element(), null));
if (this.get_element()) {
$clearHandlers(this.get_element());
this._element.control = null;
}
Telerik.Web.UI.GridDataItem.callBaseMethod(this, "dispose");
}, get_itemIndex: function () {
return this._itemIndex;
}, get_itemIndexHierarchical: function () {
return this._itemIndexHierarchical;
}, get_owner: function () {
return this._owner;
}, get_cell: function (a) {
return this.get_parent().getCellByColumnUniqueName(this, a);
}, get_dataItem: function () {
return this._dataItem;
}, findControl: function (a) {
return $telerik.findControl(this.get_element(), a);
}, findElement: function (a) {
return $telerik.findElement(this.get_element(), a);
}, getDataKeyValue: function (c) {
var b = this.get_element().id.split("__")[1];
var a = null;
if (this._owner._owner._clientKeyValues && this._owner._owner._clientKeyValues[b]) {
a = this._owner._owner._clientKeyValues[b];
}
return (a) ? a[c] : null;
}, get_selected: function () {
return this._selected;
}, set_selected: function (b) {
if (this._selected != b) {
if (!this.get_selectable()) {
return;
}
var a = {ctrlKey: false};
if (!this._owner._owner._selection._selectRowInternal(this.get_element(), a, true, true, true)) {
return;
}
}
}, get_selectable: function () {
return this._selectable;
}, get_expanded: function () {
return this._expanded;
}, set_expanded: function (a) {
if (this._expanded != a) {
if (a && !this._owner.expandItem(this.get_element())) {
return;
}
if (!a && !this._owner.collapseItem(this.get_element())) {
return;
}
this._expanded = a;
}
}, get_nestedViews: function () {
var j = this, g = j._nestedViews, h = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(j.get_element(), "tr");
if (!g) {
j._nestedViews = g = [];
if (j.get_owner()._data.hasDetailItemTemplate) {
h = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(h, "tr");
}
if (h) {
var a = j.get_owner().get_element().id.split("Detail").length, c = h.getElementsByTagName("table"), b, f;
for (var d = 0, e = c.length;
d < e;
d++) {
b = c[d];
if (b.id.indexOf("Detail") != -1 && b.id.indexOf("_mainTable") == -1 && a + 1 == b.id.split("Detail").length) {
f = $find(b.id);
if (f && Telerik.Web.UI.GridTableView.isInstanceOfType(f)) {
Array.add(g, f);
}
}
}
}
}
return g;
}, get_display: function () {
return this._display;
}, set_display: function (a) {
if (this._display != a) {
this._display = a;
}
}, get_isInEditMode: function () {
return Array.indexOf(this.get_owner().get_owner()._editIndexes, this._itemIndexHierarchical) > -1;
}, get_editFormItem: function () {
if (this._editFormItem === "notSet") {
if ($telerik.$) {
var a = $telerik.$(this.get_element()).next();
if (a.children("td").children("div.rgEditForm").length) {
this._editFormItem = a.get(0);
}
}
var c = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(this.get_element(), "tr");
if (c && c.cells) {
for (var b = 0;
b < c.cells.length;
b++) {
if ($telerik.getChildByClassName(c.cells[b], "rgEditForm")) {
this._editFormItem = c;
}
}
}
if (this._editFormItem === "notSet") {
this._editFormItem = null;
}
}
return this._editFormItem;
}
};
Telerik.Web.UI.GridDataItem.registerClass("Telerik.Web.UI.GridDataItem", Sys.UI.Control);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.GridScrolling = function () {
Telerik.Web.UI.GridScrolling.initializeBase(this);
this._owner = {};
this._onGridScrollDelegate = null;
};
Telerik.Web.UI.GridScrolling.prototype = {
initialize: function () {
Telerik.Web.UI.GridScrolling.callBaseMethod(this, "initialize");
this.AllowScroll = this._owner.ClientSettings.Scrolling.AllowScroll;
this.UseStaticHeaders = this._owner.ClientSettings.Scrolling.UseStaticHeaders;
if (!this._owner.canRepaint()) {
this._shouldInitializeLayoutAndScroll = true;
this._owner.add_parentShown(this._owner.get_element());
} else {
this._initializeDimensions();
this._initializeScroll();
}
if (Telerik.Web.UI.TouchScrollExtender._getNeedsScrollExtender() && !this._dropDownTouchScroll) {
this._createTouchScrollExtender(true);
}
}, updated: function () {
Telerik.Web.UI.GridScrolling.callBaseMethod(this, "updated");
}, dispose: function () {
if (this._onResizeDelegate) {
try {
$removeHandler(window, "resize", this._onResizeDelegate);
this._onResizeDelegate = null;
} catch (a) {
}
}
if (this._onGridFrozenScrollDelegate) {
$removeHandler(this._frozenScroll, "scroll", this._onGridFrozenScrollDelegate);
this._onGridFrozenScrollDelegate = null;
}
if (this._onGridScrollDelegate) {
if (this._owner.GridDataDiv) {
$removeHandler(this._owner.GridDataDiv, "scroll", this._onGridScrollDelegate);
}
if (this._owner.GridHeaderDiv) {
$removeHandler(this._owner.GridHeaderDiv, "scroll", this._onGridScrollDelegate);
}
this._onGridScrollDelegate = null;
}
if (this._frozenScroll) {
$clearHandlers(this._frozenScroll);
}
this._createTouchScrollExtender(false);
Telerik.Web.UI.GridScrolling.callBaseMethod(this, "dispose");
}, _initializeDimensions: function () {
var d = this;
this.onWindowResize();
this.initializeAutoLayout();
this.applyFrozenScroll();
var c = 0;
this._onResizeDelegate = Function.createDelegate(this._owner, function () {
var e = this;
clearInterval(c);
c = setTimeout(function () {
clearInterval(c);
e.repaint();
}, 200);
});
if (navigator.userAgent.toLowerCase().indexOf("msie") != -1) {
setTimeout(function () {
$addHandler(window, "resize", d._onResizeDelegate);
}, 0);
} else {
$addHandler(window, "resize", this._onResizeDelegate);
}
if (this._owner.ClientSettings.Scrolling.FrozenColumnsCount > 0) {
if (this._owner.ClientSettings.Resizing.AllowRowResize) {
this._owner.ClientSettings.Scrolling.FrozenColumnsCount++;
}
if (this._owner.MasterTableViewHeader && this._owner.MasterTableViewHeader._data._columnsData) {
for (var a = 0, b = this._owner.MasterTableViewHeader._data._columnsData.length;
a < b;
a++) {
if (this._owner.MasterTableViewHeader._data._columnsData[a].ColumnType == "GridExpandColumn") {
this._owner.ClientSettings.Scrolling.FrozenColumnsCount++;
}
}
}
}
}, _createTouchScrollExtender: function (c) {
var a = this._owner.GridDataDiv;
if (a) {
var b = this._dropDownTouchScroll;
if (b) {
if (!c) {
b.dispose();
this._dropDownTouchScroll = null;
}
} else {
if (c) {
this._dropDownTouchScroll = new Telerik.Web.UI.TouchScrollExtender(a);
this._dropDownTouchScroll.initialize();
}
}
}
}, applyFrozenScroll: function () {
this._frozenScroll = $get(this._owner.ClientID + "_Frozen");
var b = Telerik.Web.UI.Grid.getScrollBarHeight();
if (this._frozenScroll) {
var a = $get(this._owner.ClientID + "_FrozenScroll");
this._onGridFrozenScrollDelegate = Function.createDelegate(this, this.onGridFrozenScroll);
$addHandler(this._frozenScroll, "scroll", this._onGridFrozenScrollDelegate);
this.gridMasterTableWidth = this._owner.get_masterTableView().get_element().offsetWidth;
a.style.width = this._owner.GridDataDiv.scrollWidth + "px";
a.style.height = b + "px";
if (this._owner.get_masterTableView().get_element().offsetWidth > this._owner.GridDataDiv.clientWidth) {
if ($telerik.isIE) {
b++;
}
this._frozenScroll.style.height = b + "px";
if (this._owner.ClientSettings.Scrolling.SaveScrollPosition && typeof this._owner.ClientSettings.Scrolling.ScrollLeft != "undefined") {
this._frozenScroll.scrollLeft = this._owner.ClientSettings.Scrolling.ScrollLeft;
}
if (this._owner.GridDataDiv.style.overflowX != null) {
this._owner.GridDataDiv.style.overflowX = "hidden";
} else {
this._frozenScroll.style.marginTop = "-" + b + "px";
this._frozenScroll.style.zIndex = 99999;
this._frozenScroll.style.position = "relative";
}
if ((window.netscape)) {
this._frozenScroll.style.width = this._owner.GridDataDiv.offsetWidth - b + "px";
}
if (Telerik.Web.UI.Grid.IsRightToLeft(this._owner.GridHeaderDiv) && Telerik.Web.UI.Grid.IsScrollOnLeftSide()) {
this._frozenScroll.style.marginLeft = b + "px";
} else {
if (!(Telerik.Web.UI.Grid.IsRightToLeft(this._owner.GridHeaderDiv) && $telerik.isSafari)) {
this._frozenScroll.style.marginRight = b + "px";
}
}
if (this._owner.GridHeaderDiv && this._owner.GridDataDiv) {
if ((this._owner.GridDataDiv.clientWidth == this._owner.GridDataDiv.offsetWidth)) {
if (typeof(this._frozenScroll.style.overflowX) != "undefined" && typeof(this._frozenScroll.style.overflowY) != "undefined") {
this._frozenScroll.style.overflowX = "auto";
this._frozenScroll.style.overflowY = "hidden";
if (window.netscape) {
this._frozenScroll.style.width = parseInt(this._frozenScroll.style.width) + b + "px";
}
}
}
}
if ($telerik.isIE8) {
this._frozenScroll.style.overflowX = "scroll";
}
} else {
this._frozenScroll.style.height = 0;
}
this.isFrozenScroll = true;
this.gridDataTableWidth = this._owner.GridDataDiv.clientWidth;
this.isFrozenScrollApplied = true;
}
}, onGridFrozenResized: function () {
var e = Telerik.Web.UI.Grid.getScrollBarHeight(), b = $get(this._owner.ClientID + "_FrozenScroll");
if ($telerik.isIE) {
++e;
}
if (this.gridDataTableWidth != this._owner.GridDataDiv.clientWidth) {
this.gridDataTableWidth = this._owner.GridDataDiv.clientWidth;
if (this.gridMasterTableWidth > this.gridDataTableWidth) {
this._frozenScroll.style.height = e + "px";
if (this._owner.GridDataDiv.style.overflowX != null) {
this._owner.GridDataDiv.style.overflowX = "hidden";
} else {
this._frozenScroll.style.marginTop = "-" + e + "px";
this._frozenScroll.style.zIndex = 99999;
this._frozenScroll.style.position = "relative";
}
if ((window.netscape)) {
this._frozenScroll.style.width = this._owner.GridDataDiv.offsetWidth - e + "px";
this._frozenScroll.style.marginRight = e + "px";
}
if (this._owner.GridHeaderDiv && this._owner.GridDataDiv) {
if ((this._owner.GridDataDiv.clientWidth == this._owner.GridDataDiv.offsetWidth)) {
if (typeof(this._frozenScroll.style.overflowX) != "undefined" && typeof(this._frozenScroll.style.overflowY) != "undefined") {
this._frozenScroll.style.overflowX = "auto";
this._frozenScroll.style.overflowY = "hidden";
if (window.netscape) {
this._frozenScroll.style.width = parseInt(this._frozenScroll.style.width) + e + "px";
this._frozenScroll.style.marginRight = 0;
}
}
}
}
if ($telerik.isIE8) {
this._frozenScroll.style.overflowX = "scroll";
}
} else {
this._frozenScroll.scrollLeft = 0;
this._frozenScroll.style.height = 0;
var a = this._owner.get_masterTableView().get_columns();
for (var c = 0, d = a.length;
c < d;
c++) {
if (!a[c].get_visible()) {
this._owner.get_masterTableView().showColumn(c);
}
}
}
}
}, onGridFrozenScroll: function (a) {
if (!this._frozenScrollCounter) {
this._frozenScrollCounter = 0;
}
this._frozenScrollCounter++;
var b = this;
b._currentElement = Telerik.Web.UI.Grid.GetCurrentElement(a);
Telerik.Web.UI.Grid.frozenScrollHanlder = function (e) {
var v = 10;
if ($telerik.isOpera) {
v = navigator.userAgent.substring(navigator.userAgent.indexOf("Version/") + "Version".length + 1) * 1;
}
if (b._frozenScrollCounter != e) {
return;
}
if (!b._lastScrollIndex) {
b._lastScrollIndex = 0;
}
var f = b._currentElement;
if (b._owner.ClientSettings.Scrolling.FrozenColumnsCount > b._owner.get_masterTableViewHeader().get_columns().length) {
b.isFrozenScroll = false;
}
if (b.isFrozenScroll) {
var s = [];
s._getPreviousNotFrozenColumnWidth = function (j) {
var A = 0;
for (var k = 0;
k < this.length - 1;
k++) {
if (this[k].Index < j) {
A += this[k].Width;
}
}
return A;
};
var h = b._owner.get_masterTableView()._getFirstDataRow();
for (var m = b._owner.ClientSettings.Scrolling.FrozenColumnsCount;
m < b._owner.get_masterTableView().get_columns().length;
m++) {
var c = b._owner.get_masterTableView().get_columns()[m];
var y = false;
if ((window.netscape || $telerik.isSafari || $telerik.isIE8 || ($telerik.isOpera && v > 10.1)) && c.get_element().style.display == "none") {
c.get_element().style.display = "table-cell";
y = true;
}
var u;
if ($telerik.isIE9Mode) {
u = b._owner.get_masterTableView().ColGroup.Cols[m].style.width.replace("px", "") * 1;
} else {
if (!($telerik.isIE6 || $telerik.isIE7) && b._owner.get_masterTableView().ColGroup.Cols[m].style.width.indexOf("px") > -1) {
if (typeof(h) != "undefined" && h.cells[m].offsetWidth > 0) {
u = h.cells[m].offsetWidth;
} else {
u = parseInt(b._owner.get_masterTableView().ColGroup.Cols[m].style.width, 10);
}
} else {
u = (c.get_element().offsetWidth > 0) ? c.get_element().offsetWidth : (typeof(h) == "undefined" ? 0 : h.cells[m].offsetWidth);
}
}
s[s.length] = {Index: m, Width: u, FrozenDisplay: true};
if (typeof(c.FrozenDisplay) == "boolean") {
s[s.length - 1].FrozenDisplay = c.FrozenDisplay;
}
if ((window.netscape || $telerik.isSafari || $telerik.isIE8 || ($telerik.isOpera && v > 10.1)) && y) {
c.get_element().style.display = "none";
y = false;
}
}
var z = 0;
var t = -1;
if ((f.scrollWidth - f.offsetWidth) != 0) {
t = f.scrollWidth - f.offsetWidth;
}
z = Math.floor((f.scrollLeft / t) * 100);
if (z < 0) {
z = -1 * z;
}
if (z > 100) {
z = 100;
}
if (Telerik.Web.UI.Grid.IsRightToLeft(b._owner.GridHeaderDiv) && ($telerik.isSafari || $telerik.isIE7)) {
z = 100 - z;
}
var l = b._owner.get_masterTableView().get_columns();
var m = 0, g = f.scrollLeft;
while (m < s.length) {
var c = s[m];
var w = s._getPreviousNotFrozenColumnWidth(c.Index);
if ((f.scrollWidth - f.offsetWidth) < 0) {
break;
}
var d = Math.floor(((c.Width + w) / t) * 100);
if (d <= z && g != 0) {
if (c.FrozenDisplay) {
b._owner.get_masterTableViewHeader()._hideNotFrozenColumn(c.Index);
}
} else {
if (!c.FrozenDisplay) {
b._owner.get_masterTableViewHeader()._showNotFrozenColumn(c.Index);
}
}
m++;
if (m == (s.length - 1) && z == 100) {
var x = 0;
var q = 0;
var o = 0;
for (var n = 0;
n < l.length - 1;
n++) {
if (typeof(l[n].FrozenDisplay) == "boolean" && !l[n].FrozenDisplay) {
x += s[o].Width;
o++;
q = n;
}
}
if ((x - t) < 0) {
var r = s[o];
b._owner.get_masterTableViewHeader()._hideNotFrozenColumn(r.Index);
}
}
}
b._owner.get_masterTableViewHeader().get_element().style.tableLayout = "auto";
b._owner.get_masterTableViewHeader().get_element().style.tableLayout = "fixed";
b._owner.get_masterTableView().get_element().style.width = b._owner.get_masterTableViewHeader().get_element().offsetWidth + "px";
b._owner.get_masterTableView().get_element().style.tableLayout = "auto";
b._owner.get_masterTableView().get_element().style.tableLayout = "fixed";
b._owner.get_masterTableViewHeader().get_element().style.width = "100%";
b._owner.get_masterTableView().get_element().style.width = "100%";
if (z == 100 && ($telerik.isFirefox || $telerik.isIE7)) {
b._owner.get_masterTableViewHeader().get_element().style.width = b._owner.get_masterTableViewHeader().get_element().offsetWidth + "px";
b._owner.get_masterTableViewHeader().get_element().style.tableLayout = "auto";
b._owner.get_masterTableViewHeader().get_element().style.tableLayout = "fixed";
b._owner.get_masterTableView().get_element().style.width = b._owner.get_masterTableViewHeader().get_element().offsetWidth + "px";
b._owner.get_masterTableView().get_element().style.tableLayout = "auto";
b._owner.get_masterTableViewHeader().get_element().style.tableLayout = "";
setTimeout(function () {
if ($telerik.isFirefox && Sys.Browser.version >= 4) {
b._owner.get_masterTableView().get_element().style.tableLayout = "fixed";
}
b._owner.get_masterTableViewHeader().get_element().style.tableLayout = "auto";
b._owner.get_masterTableViewHeader().get_element().style.tableLayout = "fixed";
}, 100);
} else {
if ($telerik.isIE8) {
if (z == 100) {
var p = l.length - 1;
if (!b.lastColumnWidth) {
b.lastColumnWidth = b._owner.get_masterTableViewHeader().get_element().getElementsByTagName("col")[p].style.width;
b._owner.get_masterTableViewHeader().get_element().getElementsByTagName("col")[p].style.width = "";
b._owner.get_masterTableView().get_element().getElementsByTagName("col")[p].style.width = "";
}
b._owner.get_masterTableViewHeader().get_element().style.tableLayout = "auto";
b._owner.get_masterTableView().get_element().style.tableLayout = "auto";
} else {
if (b.lastColumnWidth) {
var p = l.length - 1;
b._owner.get_masterTableView().get_element().getElementsByTagName("col")[p].style.width = b.lastColumnWidth;
b._owner.get_masterTableViewHeader().get_element().getElementsByTagName("col")[p].style.width = b.lastColumnWidth;
b.lastColumnWidth = null;
}
}
}
}
if (b._owner.get_masterTableViewFooter()) {
b._owner.get_masterTableViewFooter().get_element().style.width = b._owner.get_masterTableViewHeader().get_element().offsetWidth + "px";
b._owner.get_masterTableViewFooter().get_element().style.tableLayout = "auto";
b._owner.get_masterTableViewFooter().get_element().style.tableLayout = "fixed";
}
} else {
b._owner.GridDataDiv.scrollLeft = f.scrollLeft;
}
b._frozenScrollCounter = 0;
b._owner.updateClientState();
b._owner.raise_scroll(new Telerik.Web.UI.GridScrollEventArgs(b._currentElement));
};
setTimeout("Telerik.Web.UI.Grid.frozenScrollHanlder(" + this._frozenScrollCounter + ")", 0);
}, onWindowResize: function () {
this.setDataDivHeight();
this.setHeaderAndFooterDivsWidth();
if (this.isFrozenScrollApplied) {
this.onGridFrozenResized();
}
}, setHeaderAndFooterDivsWidth: function () {
var c = this._owner, d = c.get_element(), i = c.get_masterTableView(), a = c.GridDataDiv, f = c.GridHeaderDiv;
if (!i || !a || !f) {
return;
}
var j = i.get_element(), l = Telerik.Web.UI.Grid.getScrollBarHeight(), g = navigator.userAgent.toLowerCase().indexOf("msie") > -1;
if (g) {
if (a.offsetWidth > 0 && (j.offsetWidth >= d.offsetWidth - l || j.offsetHeight > a.offsetHeight) && (document.compatMode && document.compatMode != "BackCompat")) {
var n = a.offsetWidth - l;
if (n > 0) {
if ($telerik.isIE6 && this._onResizeDelegate) {
if (Telerik.Web.UI.Grid.hasEventAttached(window, "resize", this._onResizeDelegate)) {
$removeHandler(window, "resize", this._onResizeDelegate);
}
}
if ($telerik.isIE6 && this._onResizeDelegate) {
var m = this;
setTimeout(function () {
$addHandler(window, "resize", m._onResizeDelegate);
}, 0);
}
}
} else {
if (a.offsetWidth > 0) {
if ($telerik.isIE6 && this._onResizeDelegate) {
if (Telerik.Web.UI.Grid.hasEventAttached(window, "resize", this._onResizeDelegate)) {
$removeHandler(window, "resize", this._onResizeDelegate);
}
}
f.style.width = a.offsetWidth + "px";
if ($telerik.isIE6 && this._onResizeDelegate) {
var m = this;
setTimeout(function () {
$addHandler(window, "resize", m._onResizeDelegate);
}, 0);
}
}
}
}
var h = Telerik.Web.UI.Grid.IsRightToLeft(f) && Telerik.Web.UI.Grid.IsScrollOnLeftSide();
var b = this._owner.GridFooterDiv;
if (a.clientWidth === a.offsetWidth) {
if ($telerik.isIE7) {
f.style.width = "100%";
}
f.style.marginRight = f.style.paddingRight = "";
f.style.marginLeft = f.style.paddingLeft = "";
} else {
if (!h) {
if ($telerik.isIE7) {
f.style.width = "";
}
f.style.marginRight = l + "px";
f.style.marginLeft = f.style.paddingRight = "";
} else {
if (!$telerik.isChrome) {
f.style.marginLeft = l + "px";
f.style.marginRight = f.style.paddingRight = "";
}
}
}
if (b) {
b.style.paddingRight = f.style.paddingRight;
b.style.paddingLeft = f.style.paddingLeft;
b.style.width = f.style.width;
b.style.marginRight = f.style.marginRight;
b.style.marginLeft = f.style.marginLeft;
}
if (this._owner._renderMode != Telerik.Web.UI.RenderMode.Mobile) {
var e = this._owner._groupPanel, k = this._owner.get_masterTableViewHeader();
if (e && e._items.length > 0 && g && k) {
j.style.width = k.get_element().offsetWidth + "px";
}
}
}, setDataDivHeight: function () {
if (this._owner.GridDataDiv && this._owner.get_element().style.height != "") {
this._owner.GridDataDiv.style.height = "10px";
var b = 0;
if (this._owner._groupPanelClientID != "" && this._owner._renderMode != Telerik.Web.UI.RenderMode.Mobile) {
var a = $get(this._owner._groupPanelClientID);
if (a) {
b += a.offsetHeight;
}
}
if (this._owner.GridHeaderDiv) {
b += this._owner.GridHeaderDiv.parentNode.offsetHeight;
}
if (this._owner.GridFooterDiv) {
b += this._owner.GridFooterDiv.parentNode.offsetHeight;
}
if (this._owner.PagerControl) {
b += this._owner.PagerControl.offsetHeight;
}
if (this._owner.TopPagerControl) {
b += this._owner.TopPagerControl.offsetHeight;
}
if (this._owner.ClientSettings.Scrolling.FrozenColumnsCount > 0) {
b += Telerik.Web.UI.Grid.getScrollBarHeight();
}
var c = this._owner.get_element().clientHeight - b;
if (c > 0) {
var d = this._owner.get_element().style.position;
if (window.netscape) {
this._owner.get_element().style.position = "absolute";
}
this._owner.GridDataDiv.style.height = c + "px";
if (window.netscape) {
this._owner.get_element().style.position = d;
}
}
}
}, initializeAutoLayout: function () {
var r = this._owner.MasterTableView;
var l = this._owner.get_masterTableViewHeader();
if (this.AllowScroll && this.UseStaticHeaders && r && l) {
var s = r.get_element();
var n = l.get_element();
var f = r._getFirstDataRow();
var h = this._owner.get_masterTableViewFooter();
var k = h ? h.get_element() : null;
if (!f && $telerik.isIE7) {
s.style.width = "100%";
}
if (s.style.tableLayout != "auto") {
return;
}
n.style.tableLayout = "auto";
var o = l.HeaderRow;
var b = 0;
var m = null;
if (o) {
m = o.cells;
} else {
if (l.MultiHeaderCells) {
m = l.MultiHeaderCells;
}
}
if (m != null) {
b = m.length;
if (f && f.cells.length < m.length) {
b = f.cells.length;
}
}
var a = 0;
var q = $telerik.isIE6 || $telerik.isIE7;
if (q) {
var d = this._getColWidthCorrections(b, n, r.get_columns());
}
for (var p = 0;
p < b;
p++) {
var c = this._owner.get_masterTableViewHeader().ColGroup.Cols[p];
if (!c || (c.style.width != "" && !window.netscape)) {
continue;
}
var t = m[p].offsetWidth;
if (f && f.cells[p].offsetWidth > t) {
t = f.cells[p].offsetWidth;
}
if (k) {
var g = k.tBodies[0].rows[0];
var j = g ? g.cells[p] : null;
if (j && j.offsetWidth > t) {
t = j.offsetWidth;
}
}
a += t;
if (t <= 0) {
continue;
}
var e = 0;
if (q && d[p]) {
e = d[p];
}
c.style.width = (t + e) + "px";
r.ColGroup.Cols[p].style.width = t + "px";
if (h && h.ColGroup) {
h.ColGroup.Cols[p].style.width = t + "px";
}
}
s.style.tableLayout = n.style.tableLayout = "fixed";
if (k) {
k.style.tableLayout = "fixed";
}
}
}, initializeSaveScrollPosition: function () {
if (!this._owner.ClientSettings.Scrolling.SaveScrollPosition) {
return;
}
if (this._owner.ClientSettings.Scrolling.ScrollTop != "" && !this._owner.ClientSettings.Scrolling.EnableVirtualScrollPaging) {
var c = this, d = c._owner.get_masterTableView()._virtualization, b = c._owner.ClientSettings.Virtualization;
if (d) {
if (b.ItemAtTop) {
setTimeout(function () {
c._owner.add_dataBound(c._scrollToIndex);
d.select(b.StartIndex, true);
}, 100);
} else {
if (this._owner.ClientSettings.Scrolling.ScrollTop) {
d._shouldLoadState = false;
d._startScrollTop = this._owner.ClientSettings.Scrolling.ScrollTop;
}
}
}
this._owner.GridDataDiv.scrollTop = this._owner.ClientSettings.Scrolling.ScrollTop;
}
var a = $get(this._owner.ClientID + "_Frozen");
if (this._owner.ClientSettings.Scrolling.ScrollLeft && this._owner.ClientSettings.Scrolling.ScrollLeft != "") {
if (this._owner.GridHeaderDiv && !a) {
this._owner.GridHeaderDiv.scrollLeft = this._owner.ClientSettings.Scrolling.ScrollLeft;
}
if (this._owner.GridFooterDiv && !a) {
this._owner.GridFooterDiv.scrollLeft = this._owner.ClientSettings.Scrolling.ScrollLeft;
}
if (a) {
a.scrollLeft = this._owner.ClientSettings.Scrolling.ScrollLeft;
} else {
this._owner.GridDataDiv.scrollLeft = this._owner.ClientSettings.Scrolling.ScrollLeft;
}
}
}, _scrollToIndex: function (a) {
a.get_masterTableView()._virtualization.scrollToIndex(a.ClientSettings.Virtualization.ItemAtTop);
a.remove_dataBound(a._scrolling._scrollToIndex);
}, _initializeScroll: function () {
var b = this;
var a = function () {
b.initializeSaveScrollPosition();
};
if (window.netscape && !window.opera) {
window.setTimeout(a, 0);
} else {
a();
}
this._initializeVirtualScrollPaging();
if (this._owner.GridDataDiv || this._owner.GridHeaderDiv) {
this._onGridScrollDelegate = Function.createDelegate(this, this._onGridScroll);
if (this._owner.GridDataDiv) {
$addHandlers(this._owner.GridDataDiv, {scroll: this._onGridScrollDelegate});
}
if (this._owner.GridHeaderDiv) {
$addHandlers(this._owner.GridHeaderDiv, {scroll: this._onGridScrollDelegate});
}
}
}, _hideRadComboBoxes: function () {
if (Telerik.Web.UI.RadComboBox) {
var b = document.getElementsByTagName("div");
var e = [];
for (var f = 0, k = b.length;
f < k;
f++) {
var a = b[f];
if (Sys.UI.DomElement.containsCssClass(a, "rcbSlide")) {
Array.add(e, a);
}
}
for (var f = 0, k = e.length;
f < k;
f++) {
var g = e[f].getElementsByTagName("div");
if (g) {
for (var h = 0, l = g.length;
h < l;
h++) {
if (g[h].id.indexOf("_DropDown") > -1) {
var d = g[h].id.substr(0, g[h].id.indexOf("_DropDown"));
var c = $find(d);
if (c && c.get_dropDownVisible() && Telerik.Web.UI.Grid.IsChildOf(c.get_element(), this._owner.get_element())) {
c.hideDropDown();
}
}
}
}
}
}
}, _onGridScroll: function (b) {
if (this._owner._renderMode != Telerik.Web.UI.RenderMode.Mobile) {
if (this._owner._getFilterMenu()) {
this._owner._getFilterMenu().hide();
}
}
this._hideRadComboBoxes();
var f = null;
if (Telerik.Web.UI.RadDatePicker) {
f = Telerik.Web.UI.RadDatePicker.PopupInstances;
} else {
if (Telerik.Web.UI.RadDateInputComponent) {
f = Telerik.Web.UI.RadDatePickerComponent.PopupInstances;
}
}
if (f) {
for (var d in f) {
if ($find(d) && (($find(d).get_id().indexOf(this._owner.ClientID + "_gdtcSharedCalendar") > -1) || ($find(d).get_id().indexOf(this._owner.ClientID + "_gdtcSharedTimeView") > -1))) {
f[d].Hide();
}
}
}
var a = (b.srcElement) ? b.srcElement : b.target;
if (window.opera && this.isFrozenScroll) {
this._owner.GridDataDiv.scrollLeft = this._owner.GridHeaderDiv.scrollLeft = 0;
return;
}
if (this.UseStaticHeaders) {
this._updateDataDivScrollPos(a);
}
if (!Telerik.Web.UI.GridSelection || (Telerik.Web.UI.GridSelection && this._owner.ClientSettings.EnablePostBackOnRowClick) || (this._owner._selectedItemsInternal.length > 0 && this._owner._selectedIndexes.length == 0)) {
var g = this._owner._selectedItemsInternal;
if (g.length > 0) {
for (var c = 0;
c < g.length;
c++) {
if (g != null && !Array.contains(this._owner._selectedIndexes, g[c].itemIndex)) {
Array.add(this._owner._selectedIndexes, g[c].itemIndex);
}
}
}
}
this._owner.updateClientState();
this._owner.raise_scroll(new Telerik.Web.UI.GridScrollEventArgs(this._owner._gridDataDiv));
}, _updateDataDivScrollPos: function (a) {
if (!a) {
return;
}
if (!this.isFrozenScroll) {
if (this._owner.GridHeaderDiv) {
if (a == this._owner.GridHeaderDiv) {
if ($telerik.isSafari) {
if (this._owner.GridHeaderDiv.scrollLeft && this._owner.GridHeaderDiv.scrollLeft != this._owner.GridDataDiv.scrollLeft) {
this._owner.GridDataDiv.scrollLeft = this._owner.GridHeaderDiv.scrollLeft;
}
} else {
this._owner.GridDataDiv.scrollLeft = this._owner.GridHeaderDiv.scrollLeft;
}
}
if (a == this._owner.GridDataDiv) {
if ($telerik.isSafari) {
if (this._owner.GridHeaderDiv.scrollLeft != this._owner.GridDataDiv.scrollLeft) {
this._owner.GridHeaderDiv.scrollLeft = this._owner.GridDataDiv.scrollLeft;
}
} else {
this._owner.GridHeaderDiv.scrollLeft = this._owner.GridDataDiv.scrollLeft;
}
}
}
if (this._owner.GridFooterDiv) {
this._owner.GridFooterDiv.scrollLeft = this._owner.GridDataDiv.scrollLeft;
}
} else {
if (this._owner.GridHeaderDiv) {
if ($telerik.isSafari) {
if (this._owner.GridHeaderDiv.scrollLeft && this._owner.GridHeaderDiv.scrollLeft != this._owner.GridDataDiv.scrollLeft) {
this._owner.GridHeaderDiv.scrollLeft = this._owner.GridDataDiv.scrollLeft;
}
} else {
this._owner.GridHeaderDiv.scrollLeft = this._owner.GridDataDiv.scrollLeft;
}
}
if (this._owner.GridFooterDiv) {
this._owner.GridFooterDiv.scrollLeft = this._owner.GridDataDiv.scrollLeft;
}
}
}, _initializeVirtualScrollPaging: function (d) {
if (!this._owner.ClientSettings.Scrolling.EnableVirtualScrollPaging) {
return;
}
this._scrollCounter = 0;
this._currentAJAXScrollTop = 0;
if (this._owner.ClientSettings.Scrolling.AJAXScrollTop != "" && typeof(this._owner.ClientSettings.Scrolling.AJAXScrollTop) != "undefined") {
this._currentAJAXScrollTop = this._owner.ClientSettings.Scrolling.AJAXScrollTop;
}
var h = this._owner.get_masterTableView().get_currentPageIndex() * this._owner.get_masterTableView().get_pageSize() * 20;
var k = this._owner.get_masterTableView().get_pageCount() * this._owner.get_masterTableView().get_pageSize() * 20;
var i = k - h;
var f = this._owner.get_masterTableView().get_element();
var c;
var a;
if (($telerik.isIE8 || $telerik.isSafari || $telerik.isOpera) && f) {
if (f.parentNode) {
c = $get("dummyDivTop", f.parentNode);
if (!c) {
c = document.createElement("div");
c.innerHTML = "&nbsp;";
c.style.height = "1px";
c.id = "dummyDivTop";
c.style.marginTop = "-1px";
f.parentNode.insertBefore(c, f);
}
a = $get("dummyDivBottom", f.parentNode);
if (!a) {
a = document.createElement("div");
a.innerHTML = "&nbsp;";
a.style.height = "1px";
a.id = "dummyDivBottom";
a.style.marginBottom = "-1px";
f.parentNode.appendChild(a);
}
}
}
var j = f.offsetHeight;
var e = $telerik.isOpera && +Sys.Browser.version < 9.800000000000001;
if (d && (e || ($telerik.isFirefox && !$telerik.isFirefox3))) {
if (f.style.marginBottom != "") {
j = j - parseInt(f.style.marginBottom);
}
if (f.style.marginTop != "") {
j = j - parseInt(f.style.marginTop);
}
}
var b = this._owner._gridDataDiv.offsetHeight;
if (!e) {
if (($telerik.isIE8 || $telerik.isOpera) && c && a) {
c.style.height = Math.max(h, 0) + "px";
if (i >= b) {
a.style.height = Math.max(i - j, 0) + "px";
} else {
a.style.height = Math.max(b - j, 0) + "px";
}
} else {
f.style.marginTop = h + "px";
if (i >= b) {
f.style.marginBottom = i - j + "px";
} else {
f.style.marginBottom = b - j + "px";
}
}
} else {
f.style.position = "relative";
f.style.top = h + "px";
f.style.marginBottom = k - j + "px";
}
this._owner._gridDataDiv.scrollTop = h;
this._currentAJAXScrollTop = h;
this._createScrollerToolTip();
var g = Function.createDelegate(this, this._onAjaxScrollHandler);
$addHandler(this._owner._gridDataDiv, "scroll", g);
}, _createScrollerToolTip: function () {
var a = $get(this._owner.get_id() + "ScrollerToolTip");
if (!a) {
this._scrollerToolTip = document.createElement("span");
this._scrollerToolTip.id = this._owner.get_id() + "ScrollerToolTip";
this._scrollerToolTip.style.position = "absolute";
this._scrollerToolTip.style.zIndex = 10000;
this._scrollerToolTip.style.display = "none";
if (this._owner.Skin != "") {
this._scrollerToolTip.className = String.format("GridToolTip_{0}", this._owner.Skin);
}
if (!this._owner._embeddedSkin || this._owner.Skin == "") {
this._scrollerToolTip.style.border = "1px solid";
this._scrollerToolTip.style.backgroundColor = "#F5F5DC";
this._scrollerToolTip.style.font = "icon";
this._scrollerToolTip.style.padding = "2px";
}
document.body.appendChild(this._scrollerToolTip);
}
}, _onAjaxScrollHandler: function (a) {
var b = this._owner._gridDataDiv;
if (b) {
this._currentScrollTop = b.scrollTop;
}
this._scrollCounter++;
var g = this;
Telerik.Web.UI.Grid.AjaxScrollInternal = function (e) {
if (g._scrollCounter != e) {
return;
}
var h = g._owner._gridDataDiv;
if (g._currentAJAXScrollTop != h.scrollTop) {
if (g._owner.get_masterTableView().get_currentPageIndex() == c) {
return;
}
g._owner.get_masterTableView().page(c + 1);
}
g._scrollCounter = 0;
g._hideScrollerToolTip();
};
this._owner.raise_scroll(new Telerik.Web.UI.GridScrollEventArgs(b));
var d = Telerik.Web.UI.Grid.getScrollBarHeight();
var f = b.scrollTop / (b.scrollHeight - b.offsetHeight + d);
var c = Math.round((this._owner.get_masterTableView().get_pageCount() - 1) * f);
window.setTimeout("Telerik.Web.UI.Grid.AjaxScrollInternal(" + this._scrollCounter + ")", 500);
this._showScrollerTooltip(f, c);
}, _showScrollerTooltip: function (e, b) {
var d = $get(this._owner.get_id() + "ScrollerToolTip");
if (d) {
var c = this._owner.get_masterTableView().get_pageCount();
this._applyPagerTooltipText(d, b, c);
var a = this._owner._gridDataDiv;
d.style.display = "";
d.style.top = parseInt(Telerik.Web.UI.Grid.FindPosY(a)) + Math.round(a.offsetHeight * e) + "px";
d.style.left = parseInt(Telerik.Web.UI.Grid.FindPosX(a)) + a.offsetWidth - (a.offsetWidth - a.clientWidth) - d.offsetWidth + "px";
}
}, _applyPagerTooltipText: function (g, e, d) {
if (this._owner.ClientSettings.ClientMessages.PagerTooltipFormatString == "") {
g.style.display = "none";
} else {
var h = this._owner.ClientSettings.ClientMessages.PagerTooltipFormatString;
var c = /\{0[^\}]*\}/g;
var b = /\{1[^\}]*\}/g;
var f = ((e == 0) ? 1 : e + 1);
var a = d;
h = h.replace(c, f).replace(b, a);
g.innerHTML = h;
}
}, _hideScrollerToolTip: function () {
var a = this;
setTimeout(function () {
var b = $get(a._owner.get_id() + "ScrollerToolTip");
if (b && b.parentNode) {
b.style.display = "none";
}
}, 200);
}, _getColWidthCorrections: function (b, h, c) {
var d = {};
if (h && h.tHead && h.tHead.rows.length > 0) {
var a = h.tHead.rows[0].cells;
var f = 0;
var g = 0;
for (var e = 0;
e < c.length;
e++) {
if (e == f && a[g]) {
f += a[g].colSpan;
g++;
} else {
if (c[e]) {
d[e] = Telerik.Web.UI.Grid.correctWidthForIE(c[e].get_element());
}
}
}
}
return d;
}
};
Telerik.Web.UI.GridScrolling.registerClass("Telerik.Web.UI.GridScrolling", Sys.Component);
Telerik.Web.UI.GridScrollEventArgs = function (a) {
Telerik.Web.UI.GridScrollEventArgs.initializeBase(this);
this.scrollTop = a.scrollTop;
this.scrollLeft = a.scrollLeft;
this.scrollControl = a;
this.isOnTop = (a.scrollTop == 0) ? true : false;
var b = Telerik.Web.UI.Grid.getScrollBarHeight();
if (a.clientHeight == a.offsetHeight) {
b = 0;
}
this.isOnBottom = ((a.scrollHeight - a.offsetHeight + b) == a.scrollTop) ? true : false;
};
Telerik.Web.UI.GridScrollEventArgs.prototype = {
get_scrollTop: function () {
return this.scrollTop;
}, get_scrollLeft: function () {
return this.scrollLeft;
}, get_scrollControl: function () {
return this.scrollControl;
}, get_isOnTop: function () {
return this.isOnTop;
}, get_isOnBottom: function () {
return this.isOnBottom;
}
};
Telerik.Web.UI.GridScrollEventArgs.registerClass("Telerik.Web.UI.GridScrollEventArgs", Sys.EventArgs);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.GridSelection = function () {
Telerik.Web.UI.GridSelection.initializeBase(this);
this._owner = {};
this._masterTable = null;
this._selectionInProgress = false;
this._lastSelectedItemIndex = null;
};
Telerik.Web.UI.GridSelection.prototype = {
initialize: function () {
var c = this;
Telerik.Web.UI.GridSelection.callBaseMethod(c, "initialize");
if (c._owner._masterClientID == null) {
return;
}
$addHandlers(c._owner.get_element(), {click: Function.createDelegate(c, c._click)});
c._masterTable = $get(c._owner._masterClientID).tBodies[0];
if (c._owner.AllowMultiRowSelection && !c._owner.ClientSettings.Selecting.UseClientSelectColumnOnly) {
if (c._owner.ClientSettings.Selecting.EnableDragToSelectRows) {
$addHandlers(c._masterTable, {mousedown: Function.createDelegate(c, c._mousedown)});
$addHandlers(c._masterTable, {mousemove: Function.createDelegate(c, c._mousemove)});
$addHandlers(c._masterTable, {mouseup: Function.createDelegate(c, c._mouseup)});
$telerik.addExternalHandler(document, "mouseup", Function.createDelegate(c, c._mouseup));
} else {
$addHandlers(c._masterTable, {
mousedown: c._mouseDownTryClearDocumentEvents,
mouseup: c._mouseUpRestoreDocumentEvents
}, c);
}
}
if (this._owner._selectedItemsInternal.length > 0) {
var a = null;
for (var b = 0;
b < this._owner._selectedItemsInternal.length;
b++) {
a = this._owner._selectedItemsInternal[b].itemIndex;
if (!Array.contains(this._owner._selectedIndexes, a)) {
Array.add(this._owner._selectedIndexes, a);
}
}
}
}, updated: function () {
Telerik.Web.UI.GridSelection.callBaseMethod(this, "updated");
}, dispose: function () {
if (this._masterTable) {
$clearHandlers(this._masterTable);
this._masterTable._events = null;
}
this._masterTable = null;
this._owner = null;
Telerik.Web.UI.GridSelection.callBaseMethod(this, "dispose");
}, get_owner: function () {
return this._owner;
}, set_owner: function (a) {
this._owner = a;
}, _mouseDownTryClearDocumentEvents: function (a) {
if (!a.shiftKey || this._shouldReturnOnMouseDown(a)) {
return;
}
Telerik.Web.UI.Grid.ClearDocumentEvents(true);
}, _mouseUpRestoreDocumentEvents: function (a) {
Telerik.Web.UI.Grid.RestoreDocumentEvents();
}, _mousedown: function (a) {
if (this._owner.ClientSettings.Selecting.EnableDragToSelectRows && this._owner.AllowMultiRowSelection && !this._owner._rowResizer && a.rawEvent.button != 2) {
this._createRowSelectorArea(a);
}
}, _mousemove: function (a) {
if (this._owner._isRowDragged()) {
this._destroyRowSelectorArea(a);
return;
}
this._resizeRowSelectorArea(a);
}, _mouseup: function (a) {
this._destroyRowSelectorArea(a);
}, _shouldReturnOnMouseDown: function (b) {
if (b.ctrlKey) {
return true;
}
var a = null;
if (b.srcElement) {
a = b.srcElement;
} else {
if (b.target) {
a = b.target;
}
}
if (!a || a == null || !a.tagName) {
return true;
}
if (a.tagName.toLowerCase() == "input" || a.tagName.toLowerCase() == "textarea" || a.tagName.toLowerCase() == "select" || a.tagName.toLowerCase() == "option") {
return true;
}
if ((!this._owner.ClientSettings.Selecting.AllowRowSelect) || (!this._owner.AllowMultiRowSelection)) {
return true;
}
}, _createRowSelectorArea: function (c) {
if (this._shouldReturnOnMouseDown(c)) {
return;
}
var b = Telerik.Web.UI.Grid.GetCurrentElement(c);
if ((!b) || (!Telerik.Web.UI.Grid.IsChildOf(b, this._owner.get_element()))) {
return;
}
this._firstRow = Telerik.Web.UI.Grid.GetFirstParentByTagName(b, "tr");
if (this._firstRow.id == "") {
return;
}
if (!this._rowSelectorArea) {
this._rowSelectorArea = document.createElement("span");
this._rowSelectorArea.style.position = "absolute";
this._rowSelectorArea.style.zIndex = 1000100;
if (this._owner.Skin != "") {
this._rowSelectorArea.className = String.format("GridRowSelector_{0}", this._owner.Skin);
}
if (!this._owner._embeddedSkin || this._owner.Skin == "") {
this._rowSelectorArea.style.backgroundColor = "navy";
}
if ("opacity" in this._rowSelectorArea.style) {
this._rowSelectorArea.style.opacity = 0.1;
} else {
if ("MozOpacity" in this._rowSelectorArea.style) {
this._rowSelectorArea.style.MozOpacity = 1 / 10;
} else {
this._rowSelectorArea.style.filter = "alpha(opacity=10);";
}
}
if (this._owner._gridDataDiv) {
this._rowSelectorArea.style.top = Telerik.Web.UI.Grid.FindPosY(this._firstRow) + this._owner._gridDataDiv.scrollTop + "px";
this._rowSelectorArea.style.left = Telerik.Web.UI.Grid.FindPosX(this._firstRow) + this._owner._gridDataDiv.scrollLeft + "px";
if (parseInt(this._rowSelectorArea.style.left) < Telerik.Web.UI.Grid.FindPosX(this._owner.get_element())) {
this._rowSelectorArea.style.left = Telerik.Web.UI.Grid.FindPosX(this._owner.get_element()) + "px";
}
} else {
this._rowSelectorArea.style.top = Telerik.Web.UI.Grid.FindPosY(this._firstRow) + "px";
this._rowSelectorArea.style.left = Telerik.Web.UI.Grid.FindPosX(this._firstRow) + "px";
}
document.body.appendChild(this._rowSelectorArea);
Telerik.Web.UI.Grid.ClearDocumentEvents(true);
var a = document.activeElement;
if (a && a.tagName && a.tagName.toLowerCase() === "input") {
document.activeElement.blur();
}
}
}, _destroyRowSelectorArea: function (c) {
if (this._rowSelectorArea) {
var f = this._rowSelectorArea.style.height;
document.body.removeChild(this._rowSelectorArea);
this._rowSelectorArea = null;
Telerik.Web.UI.Grid.RestoreDocumentEvents();
var a = Telerik.Web.UI.Grid.GetCurrentElement(c);
var j;
if ((!a) || (!Telerik.Web.UI.Grid.IsChildOf(a, this._owner.get_element()))) {
return;
}
var l = Telerik.Web.UI.Grid.GetFirstParentByTagName(a, "td");
if ((a.tagName.toLowerCase() == "td") || (a.tagName.toLowerCase() == "tr") || (l && l.tagName.toLowerCase() == "td")) {
if (a.tagName.toLowerCase() == "td") {
j = a.parentNode;
} else {
if (l.tagName.toLowerCase() == "td") {
j = l.parentNode;
} else {
if (a.tagName.toLowerCase() == "tr") {
j = a;
}
}
}
if (this._firstRow.parentNode.parentNode.id == j.parentNode.parentNode.id) {
var k = this._owner;
var m = (this._firstRow.rowIndex < j.rowIndex) ? this._firstRow.rowIndex : j.rowIndex;
var d = (m == this._firstRow.rowIndex) ? j.rowIndex : this._firstRow.rowIndex;
if (!c.ctrlKey && !c.shiftKey && m !== d) {
k.clearSelectedItems();
}
this._selectionInProgress = true;
k._keyboardNavigationProperties.lastClickSelectedItem = j;
for (var g = m;
g < d + 1;
g++) {
if (g == d) {
this._selectionInProgress = false;
}
var b = this._firstRow.parentNode.parentNode.rows[g];
if (b.id == "") {
continue;
}
if (b) {
if (f != "") {
var h = $find(b.id);
if (h) {
h.set_selected(true);
} else {
var n = $find(b.id.split("__")[0]);
n.selectItem(b);
}
}
}
}
} else {
}
}
}
}, _resizeRowSelectorArea: function (c) {
if ((this._rowSelectorArea) && (this._rowSelectorArea.parentNode)) {
var a = Telerik.Web.UI.Grid.GetCurrentElement(c);
if ((!a) || (!Telerik.Web.UI.Grid.IsChildOf(a, this._owner.get_element()))) {
return;
}
var h = parseInt(this._rowSelectorArea.style.left);
var f = Telerik.Web.UI.Grid.GetEventPosX(c);
var i = parseInt(this._rowSelectorArea.style.top);
var g = Telerik.Web.UI.Grid.GetEventPosY(c);
if (g >= $telerik.getLocation(this._rowSelectorArea).y + this._rowSelectorArea.offsetHeight && this._rowSelectorArea.dragDirectionTop) {
this._rowSelectorArea.dragDirectionTop = null;
}
if ((f - h - 5) > 0) {
this._rowSelectorArea.style.width = f - h - 5 + "px";
}
if (this._rowSelectorArea.offsetWidth > this._owner.get_element().offsetWidth) {
this._rowSelectorArea.style.width = this._owner.get_element().offsetWidth + "px";
}
if (g > i && !this._rowSelectorArea.dragDirectionTop) {
if ((g - i - 5) > 0) {
this._rowSelectorArea.style.height = g - i - 5 + "px";
}
} else {
if (!this._rowSelectorArea.dragDirectionTop) {
this._rowSelectorArea.dragDirectionTop = true;
}
if ((i - g - 5) > 0 || this._rowSelectorArea.dragDirectionTop) {
this._rowSelectorArea.style.top = g - 5 + "px";
var d = Telerik.Web.UI.Grid.FindPosY(this._firstRow) - parseInt(this._rowSelectorArea.style.top) - 5;
if (d > 0) {
if (this._owner._gridDataDiv) {
if ((this._owner._gridDataDiv.offsetHeight + this._owner._gridDataDiv.offsetTop) > parseInt(this._rowSelectorArea.style.top) + d) {
this._rowSelectorArea.style.height = d + "px";
} else {
var b = (this._owner._gridDataDiv.offsetHeight + this._owner._gridDataDiv.offsetTop) - parseInt(this._rowSelectorArea.style.top) - 5;
this._rowSelectorArea.style.height = (b >= 0) ? b + "px" : 0 + "px";
}
} else {
this._rowSelectorArea.style.height = d + "px";
}
}
}
}
}
}, _shouldRaiseRowEvent: function (b) {
var d, a = $find(b.id);
if (!a && b.parentNode) {
a = $find(b.parentNode.id);
}
var c = (b.tagName.toLowerCase() == "input" && b.type.toLowerCase() == "checkbox" && (b.id && b.id.indexOf("SelectCheckBox") != -1));
if ((b.tagName.toLowerCase() == "input" && !c) || b.tagName.toLowerCase() == "select" || b.tagName.toLowerCase() == "option" || b.tagName.toLowerCase() == "button" || b.tagName.toLowerCase() == "a" || b.tagName.toLowerCase() == "textarea" || b.tagName.toLowerCase() == "img" || (a && Telerik.Web.UI.RadButton && Telerik.Web.UI.RadButton.isInstanceOfType(a))) {
d = false;
} else {
d = true;
}
return d;
}, _click: function (b) {
var c = (b.target) ? b.target : b.srcElement;
if ($telerik.isTouchDevice && c.nodeType == 3) {
c = c.parentNode;
}
if (!c.tagName) {
return;
}
if (c.tagName.toLowerCase() == "label" && c.htmlFor) {
return;
}
var g = c.id && c.id.indexOf("RowDragHandle") > -1;
if (!this._shouldRaiseRowEvent(c) && !g) {
return;
}
var f = (c.tagName.toLowerCase() == "input" && c.type.toLowerCase() == "checkbox" && (c.id && c.id.indexOf("SelectCheckBox") != -1));
var l = this._owner;
if (f && l.ClientSettings.AllowKeyboardNavigation) {
l.get_element().focus();
}
if (l.ClientSettings.Selecting && l.ClientSettings.Selecting.AllowRowSelect) {
if (b.ctrlKey) {
l._keyboardNavigationProperties.holdingCtrl = true;
}
if (c.tagName.toLowerCase() != "tr") {
c = Telerik.Web.UI.Grid.GetFirstParentByTagName(c, "tr");
while (c && c.id.split("__").length !== 2 && c.parentNode) {
c = Telerik.Web.UI.Grid.GetFirstParentByTagName(c.parentNode, "tr");
}
}
if (l.ClientSettings.Selecting.UseClientSelectColumnOnly && !f && this._findClientSelectColumn(c) && !g) {
} else {
var k = c;
var d = false;
while (c && Telerik.Web.UI.Grid.IsChildOf(c, l.get_element())) {
if (c.id && c.id.split("__").length == 2) {
d = true;
break;
}
c = Telerik.Web.UI.Grid.GetFirstParentByTagName(c.parentNode, "tr");
}
if (!d) {
c = k;
}
if (c && (c.parentNode.parentNode.parentNode == l.get_element() || c.parentNode.parentNode.parentNode == l._gridDataDiv || Array.contains(l.get_detailTables(), $find(c.parentNode.parentNode.id))) && c.id && c.id.split("__").length == 2) {
if (l.get_allowMultiRowSelection()) {
if (b.shiftKey) {
var a = l._searchRowIndex(c.id);
var j = this._lastSelectedItemIndex;
this._selectionInProgress = true;
if (!isNaN(parseInt(j))) {
if (j < a) {
if (!b.ctrlKey) {
l._clearSelectedItemsExcludingInterval(j, a);
}
l._selectItemsInInterval(j, a, 1);
} else {
if (j > a) {
if (!b.ctrlKey) {
l._clearSelectedItemsExcludingInterval(a, j);
}
l._selectItemsInInterval(a, j, 1);
} else {
l._clearSelectedItemsExcludingInterval(j, j);
}
}
} else {
this._lastSelectedItemIndex = a;
}
}
if (b.ctrlKey || (!b.ctrlKey && !b.shiftKey)) {
this._lastSelectedItemIndex = l._searchRowIndex(c.id);
}
this._selectionInProgress = false;
this._selectRowInternal(c, b, f, true, true);
} else {
if (f) {
var i = Array.contains(l._selectedIndexes, c.id.split("__")[1]);
this._selectRowInternal(c, b, i, i, true);
} else {
this._selectRowInternal(c, b, false, false, true);
}
}
l._keyboardNavigationProperties.lastClickSelectedItem = c;
}
}
}
if (l.ClientSettings && l.ClientSettings.EnablePostBackOnRowClick && c) {
if (c && c.tagName.toLowerCase() != "tr") {
c = Telerik.Web.UI.Grid.GetFirstParentByTagName(c, "tr");
}
if (c && c.id != "" && c.id.split("__").length == 2) {
var h = c.id.split("__")[1];
var m = l.ClientSettings.PostBackFunction;
m = m.replace("{0}", l.UniqueID);
m = m.replace("{1}", "RowClick;" + h);
setTimeout(function () {
eval(m);
}, 100);
}
}
}, _selectRowInternal: function (r, h, m, w, u, s) {
var t;
if (typeof(s) == "undefined") {
s = true;
t = false;
} else {
t = s;
}
var o = r.id.split("__")[1];
var v = $find(r.id.split("__")[0]);
v.get_dataItems();
var f = $find(r.id);
if (f && !f.get_selectable()) {
this._selectRowInternalSetActiveRow(r, h);
return;
}
if (!m) {
var q = (h.rawEvent && !h.rawEvent.metaKey) || $telerik.isTouchDevice;
if (!this._owner.AllowMultiRowSelection || (this._owner.AllowMultiRowSelection && (!(h.ctrlKey || h.shiftKey) && q))) {
if (!h.shiftKey) {
this._owner._keyboardNavigationProperties.lastSelectedRowIndex = this._owner._searchRowIndex(r.id);
}
if (this._owner._selectedItemsInternal.length > 0) {
var l = this._owner._selectedItemsInternal.length - 1;
while (l >= 0) {
var d = $get(this._owner._selectedItemsInternal[l].id);
if (d == null) {
Array.remove(this._owner._selectedItemsInternal, this._owner._selectedItemsInternal[l]);
Array.remove(this._owner._selectedIndexes, this._owner._selectedIndexes[l]);
l--;
continue;
}
var f = $find(d.id);
if (f && !f.get_selectable()) {
l--;
continue;
}
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(d, h);
this._owner.raise_rowDeselecting(a);
if (a.get_cancel()) {
l--;
continue;
}
Sys.UI.DomElement.removeCssClass(d, v._data._selectedItemStyleClass);
if (v._data._selectedItemStyle) {
var c = d.style.cssText.toLowerCase().replace(/ /g, "");
var b = c.split(";");
for (var p = 0;
p < b.length;
p++) {
if (v._data._selectedItemStyle.toLowerCase().indexOf(b[p]) != -1) {
b[p] = "";
}
}
d.style.cssText = b.join(";");
}
this._checkClientSelectColumn(d, false);
var n = $find(this._owner._selectedItemsInternal[l].id);
if (n) {
n._selected = false;
}
Array.remove(this._owner._selectedItemsInternal, this._owner._selectedItemsInternal[l]);
Array.remove(this._owner._selectedIndexes, this._owner._selectedIndexes[l]);
if (this._owner.get_enableAriaSupport()) {
d.setAttribute("aria-selected", "false");
}
this._owner.raise_rowDeselected(new Telerik.Web.UI.GridDataItemEventArgs(d, h));
l = Math.min(this._owner._selectedItemsInternal.length, l);
l--;
}
}
var k = this._getTableHeaderRow(r.parentNode.parentNode);
if (k) {
this._checkClientSelectColumn(k, false);
}
}
}
if (!Array.contains(this._owner._selectedIndexes, o)) {
if (!this._owner.AllowMultiRowSelection && this._owner._selectedIndexes.length > 0) {
this._checkClientSelectColumn(r, false);
} else {
if (!m || s) {
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(r, h);
this._owner.raise_rowSelecting(a);
if (a.get_cancel()) {
if (m) {
this._checkClientSelectColumn(r, false);
if (r.parentNode != null && typeof(r.parentNode) != "undefined" && r.parentNode.parentNode != null && typeof(r.parentNode.parentNode) != "undefined") {
var k = this._getTableHeaderRow(r.parentNode.parentNode);
if (k) {
this._checkClientSelectColumn(k, false);
}
}
}
return false;
}
Sys.UI.DomElement.addCssClass(r, v._data._selectedItemStyleClass);
if (v._data._selectedItemStyle != "") {
r.style.cssText = r.style.cssText + ";" + v._data._selectedItemStyle;
}
Array.add(this._owner._selectedItemsInternal, {itemIndex: o, id: r.id});
Array.add(this._owner._selectedIndexes, o);
this._checkClientSelectColumn(r, true);
var n = $find(r.id);
if (n) {
n._selected = true;
}
if (this._owner.get_enableAriaSupport()) {
r.setAttribute("aria-selected", "true");
}
this._owner.raise_rowSelected(new Telerik.Web.UI.GridDataItemEventArgs(r, h));
var x = 0;
var g = v.get_dataItems();
for (var l = 0;
len = g.length, l < len;
l++) {
if (!g[l].get_selectable() && !g[l].get_selected()) {
x++;
}
}
if (!t && v.get_selectedItems().length == v.get_dataItems().length - x) {
if (r.parentNode != null && typeof(r.parentNode) != "undefined" && r.parentNode.parentNode != null && typeof(r.parentNode.parentNode) != "undefined") {
var k = this._getTableHeaderRow(r.parentNode.parentNode);
if (k) {
this._checkClientSelectColumn(k, true);
}
}
}
}
}
} else {
if ((w || (m && !s)) && !h.shiftKey) {
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(r, h);
this._owner.raise_rowDeselecting(a);
if (!a.get_cancel()) {
Sys.UI.DomElement.removeCssClass(r, v._data._selectedItemStyleClass);
if (v._data._selectedItemStyle) {
var c = r.style.cssText.toLowerCase().replace(/ /g, "");
var b = c.split(";");
for (var p = 0;
p < b.length;
p++) {
if (v._data._selectedItemStyle.toLowerCase().indexOf(b[p]) != -1) {
b[p] = "";
}
}
r.style.cssText = b.join(";");
}
for (var l = 0;
l < this._owner._selectedItemsInternal.length;
l++) {
if (this._owner._selectedItemsInternal[l].itemIndex == o) {
var n = $find(this._owner._selectedItemsInternal[l].id);
if (n) {
n._selected = false;
}
Array.remove(this._owner._selectedItemsInternal, this._owner._selectedItemsInternal[l]);
break;
}
}
for (var l = 0;
l < this._owner._selectedIndexes.length;
l++) {
if (this._owner._selectedIndexes[l] == o) {
Array.remove(this._owner._selectedIndexes, this._owner._selectedIndexes[l]);
break;
}
}
this._checkClientSelectColumn(r, false);
if (this._owner.get_enableAriaSupport()) {
r.setAttribute("aria-selected", "false");
}
this._owner.raise_rowDeselected(new Telerik.Web.UI.GridDataItemEventArgs(r, h));
if (r.parentNode != null && typeof(r.parentNode) != "undefined" && r.parentNode.parentNode != null && typeof(r.parentNode.parentNode) != "undefined") {
var k = this._getTableHeaderRow(r.parentNode.parentNode);
if (k) {
this._checkClientSelectColumn(k, false);
}
}
}
}
}
if (u) {
this._owner.updateClientState();
}
this._selectRowInternalSetActiveRow(r, h);
return true;
}, _selectRowInternalSetActiveRow: function (b, a) {
if (this._owner.ClientSettings.AllowKeyboardNavigation) {
if (this._selectionInProgress && this._owner.get_allowMultiRowSelection()) {
return true;
}
if (this._owner._activeRow && b.id != this._owner._activeRow.id) {
this._owner._setActiveRow(b, a);
}
}
}, _checkClientSelectColumn: function (e, d) {
var c = e.getElementsByTagName("input");
for (var a = 0;
a < c.length;
a++) {
var b = c[a];
if (b.type.toLowerCase() != "checkbox") {
continue;
}
if (b.id && b.id.indexOf("SelectCheckBox") != -1) {
b.checked = d;
if (this._owner.get_enableAriaSupport()) {
b.setAttribute("aria-checked", d.toString());
}
if ($telerik.isSafari) {
b.safarichecked = d;
}
}
}
}, _getTableHeaderRow: function (c) {
var b = Telerik.Web.UI.Grid.getTableHeaderRow(c);
var a = this._owner.get_masterTableView()._hasMultiHeaders;
if (b) {
if (a && b.parentNode.tagName.toLowerCase() == "thead") {
return b.parentNode;
}
return b;
}
b = $get(String.format("{0}_Header", this.get_owner().get_masterTableView().get_id()));
if (b) {
b = Telerik.Web.UI.Grid.getTableHeaderRow(b);
}
if (a && b.parentNode.tagName.toLowerCase() == "thead") {
return b.parentNode;
}
return b;
}, _findClientSelectColumn: function (d) {
if (!d) {
return;
}
var c = d.getElementsByTagName("input");
if (!c) {
return;
}
for (var a = 0;
a < c.length;
a++) {
var b = c[a];
if (b.type.toLowerCase() != "checkbox") {
continue;
}
if (b.id && b.id.indexOf("SelectCheckBox") != -1) {
return b;
}
}
}
};
Telerik.Web.UI.GridSelection.registerClass("Telerik.Web.UI.GridSelection", Sys.Component);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.GridTableView = function (a) {
Telerik.Web.UI.GridTableView.initializeBase(this, [a]);
this._owner = {};
this._data = {};
this._hiddenCols = {};
this._dataItemsCreated = false;
this._dataItems = [];
this._cachedItems = [];
this._columnsInternal = [];
this._sortExpressions = new Telerik.Web.UI.GridSortExpressions();
this._filterExpressions = new Telerik.Web.UI.GridFilterExpressions();
this._firstDataRow = null;
this._exapndedGroupItemsTemp;
this._enableGroupsExpandAll;
this._groupHeadersCount = [];
this._enableHierarchyExpandAll;
this._dataSource = null;
this._preventUpdatePager = false;
this._virtualItemCount = 0;
this._pageButtonCount = 10;
this._hasDetailTables = false;
this._hasMultiHeaders = false;
this._hierarchyLoadMode = "ServerOnDemand";
this.__shouldPerformFiltering = true;
this._shouldAutoPostBackOnFilter = true;
this._rangeValidationInProcess = false;
this._calculatedParentTableCells = false;
this._groupLevelsCount = 0;
this._groupColumnIndex = 1;
this._originalGroupLevel = null;
this._resizedColumnsData = new Telerik.Web.UI.Grid.ClientStateData();
this._hidedItemsData = new Telerik.Web.UI.Grid.ClientStateData();
this._showedItemsData = new Telerik.Web.UI.Grid.ClientStateData();
this._resizedItemsData = new Telerik.Web.UI.Grid.ClientStateData();
this._resizedControlData = new Telerik.Web.UI.Grid.ClientStateData();
this._includeAllHeaderRows;
};
Telerik.Web.UI.GridTableView.prototype = {
initialize: function () {
Telerik.Web.UI.GridTableView.callBaseMethod(this, "initialize");
if (this._element && this._owner && this._owner._element) {
var c = this._element.parentNode;
while (c) {
if ((this._owner._element == c) && c.control) {
this._owner = c.control;
break;
}
c = c.parentNode;
}
}
if (this._data._selectedItemStyleClass == "" && this._data._selectedItemStyle == "") {
this._data._selectedItemStyle = "background-color:navy;color:white;";
}
if (this._data._renderActiveItemStyleClass == "" && this._data._renderActiveItemStyle == "") {
this._data._renderActiveItemStyle = "background-color:navy;color:white;";
}
this.ColGroup = Telerik.Web.UI.Grid.GetTableColGroup(this.get_element());
if (this.ColGroup) {
this.ColGroup.Cols = Telerik.Web.UI.Grid.GetTableColGroupCols(this.ColGroup);
}
if ($telerik.quirksMode) {
for (var r = 0;
r < this.ColGroup.Cols.length;
r++) {
if (this.ColGroup.Cols[r].style.display == "none") {
this.ColGroup.Cols[r].style.display = "";
}
}
}
this.PageSize = this._data.PageSize;
this.PageCount = this._data.PageCount;
this.CurrentPageIndex = this._data.CurrentPageIndex;
this._virtualItemCount = this._data.VirtualItemCount;
this._pageButtonCount = this._data.PageButtonCount;
this._hasDetailTables = this._data.HasDetailTables;
this._hasMultiHeaders = this._data.HasMultiHeaders;
if (this._data.GroupLevelsCount) {
this._groupLevelsCount = this._data.GroupLevelsCount * 1;
this._exapndedGroupItemsTemp = new Array(this._groupLevelsCount);
}
if (this._data.GroupHeadersCount) {
this._groupHeadersCount = this._data.GroupHeadersCount;
}
if (this._data.HierarchyLoadMode) {
this._hierarchyLoadMode = this._data.HierarchyLoadMode;
}
if (this._data.EnableGroupsExpandAll) {
this._enableGroupsExpandAll = this._data.EnableGroupsExpandAll;
}
if (this._data.EnableHierarchyExpandAll) {
this._enableHierarchyExpandAll = this._data.EnableHierarchyExpandAll;
}
var q = (this._owner.ClientSettings.Scrolling && this._owner.ClientSettings.Scrolling.AllowScroll && this._owner.ClientSettings.Scrolling.UseStaticHeaders);
if ((this.get_element().id.indexOf("_Header") != -1 && q) || (!q && this.get_element().id.indexOf("_Header") == -1) || (this.get_element().id.indexOf("_Detail") != -1)) {
var s = [];
if (this._hasMultiHeaders) {
s = Telerik.Web.UI.Grid.getMultiHeaderCells(this);
var w = this.get_element();
if ((w.id.indexOf("_Header") != -1 && q && ($telerik.isIE6 || $telerik.isIE7))) {
var n = w.tHead ? w.tHead.rows[0] : null;
if (n && n.className && n.className.indexOf("rgMultiHeaderRow") > -1) {
var f = n.cells;
var g = w.getElementsByTagName("colgroup")[0];
if (f && g) {
var h = g.getElementsByTagName("col");
var v = 0;
for (var p = 0;
p < f.length;
p++) {
var m = f[p];
if (m.colSpan > 1) {
for (var r = v + 1;
r < v + m.colSpan;
r++) {
if (h[r] && s[r] && h[r].style.width && h[r].style.width.indexOf("%") == -1) {
h[r].style.width = (h[r].offsetWidth + Telerik.Web.UI.Grid.correctWidthForIE(s[r])) + "px";
}
}
}
v += m.colSpan;
}
}
}
}
this.MultiHeaderCells = s;
} else {
var n = Telerik.Web.UI.Grid.getTableHeaderRow(this.get_element());
}
if (!n) {
var o = $get(this.get_element().id + "_Header");
if (o) {
n = Telerik.Web.UI.Grid.getTableHeaderRow(o);
}
}
this.HeaderRow = n;
var t = this._owner;
var u = t.ClientSettings;
if ($telerik.isMobileIE10 && (u.AllowRowsDragDrop || (u.Scrolling && u.Scrolling.AllowScroll))) {
this.get_element().style.msTouchAction = "none";
}
var b = this._data._columnsData;
for (var p = 0;
p < b.length;
p++) {
if (!n && (!s || !s[p])) {
continue;
}
var l = b[p];
var e = this._hasMultiHeaders ? s[p] : n.cells[p];
if (!e) {
continue;
}
this._owner.raise_columnCreating(new Sys.EventArgs());
var k = $create(Telerik.Web.UI.GridColumn, {_owner: this, _data: l}, null, null, e);
var d = new Sys.EventArgs();
d.get_column = function () {
return k;
};
Array.add(this._columnsInternal, k);
this._owner.raise_columnCreated(d);
}
this._setupHeaderRotations();
}
if ($telerik.isIE && document.documentMode && document.documentMode <= 7) {
this._setHeaderFooterSpan();
}
if (this._data.VirtualizationDataAsJSON && this.get_element().parentNode.id.indexOf("_GridData") !== -1) {
this._virtualization = $create(Telerik.Web.UI.GridVirtualization, null, null, {_tableView: this.get_id()}, null);
this._virtualization._tableView = this;
if (this._owner.ClientSettings.Virtualization.StartIndex) {
this._virtualization._startIndex = this._owner.ClientSettings.Virtualization.StartIndex;
}
this._virtualization.initialize();
} else {
if (this._owner.get_events().getHandler("rowCreating") || this._owner.get_events().getHandler("rowCreated")) {
this.get_dataItems();
}
}
if (this._owner.get_enableAriaSupport()) {
this._initializeAriaSupport();
}
}, dispose: function () {
this._owner.raise_tableDestroying(Sys.EventArgs.Empty);
this._sortExpressions.dispose();
this._filterExpressions.dispose();
$clearHandlers(this.get_element());
if (this.get_element().tBodies[0]) {
$clearHandlers(this.get_element().tBodies[0]);
}
for (var a = 0;
a < this._dataItems.length;
a++) {
if (this._dataItems[a]) {
this._dataItems[a].dispose();
this._dataItems[a] = null;
}
}
if (this._cachedItems) {
for (var a = 0;
a < this._cachedItems.length;
a++) {
if (this._cachedItems[a]) {
this._cachedItems[a].dispose();
this._cachedItems[a] = null;
}
}
}
this._dataItems = [];
if (this.ColGroup != null && this.ColGroup.Cols != null) {
this.ColGroup.Cols = null;
}
if (this.ColGroup != null) {
this.ColGroup = null;
}
this._element.control = null;
this._owner = null;
this._data = null;
this._hiddenCols = null;
this._dataItems = null;
this._cachedItems = null;
this._columnsInternal = null;
this._groupHeadersCount = null;
Telerik.Web.UI.GridTableView.callBaseMethod(this, "dispose");
}, _setupHeaderRotations: function () {
var e = this, b = e.get_columns(), d = 0, a;
for (var c = 0;
c < b.length;
c++) {
a = b[c].get_element();
if (Sys.UI.DomElement.containsCssClass(a, "rgRotateHeader") && a.children[0].offsetWidth > d) {
d = a.children[0].offsetWidth;
}
}
if (parseInt($telerik.getComputedStyle(a, "height", 0), 10) > d) {
return;
}
if ($telerik.isOpera) {
d += ["paddingTop", "paddingBottom", "borderTopWidth", "borderBottomWidth"].reduce(function (g, f) {
var h = parseInt($telerik.getCurrentStyle(a, f), 10);
return g + (isNaN(h) ? 0 : h);
}, 0);
}
if (d != 0) {
for (var c = 0;
c < b.length;
c++) {
if (b[c].get_element().style.height == "") {
b[c].get_element().style.height = d + "px";
}
}
}
}, _hideInvisibleColumns: function () {
if ($telerik.isIE7) {
var a = this.get_columns();
for (var b = 0;
b < a.length;
b++) {
if (!a[b].Display) {
this._hideShowColumn(b, false, true);
}
}
}
}, get_columns: function () {
return this._columnsInternal;
}, getColumnByUniqueName: function (b) {
var c = this, a = c._columnsByUniqueName = c._columnsByUniqueName || (function () {
var f = {}, d = tableView.get_columns();
for (var e = 0;
e < d.length;
e++) {
f[d[e].get_uniqueName()] = d[e];
}
return f;
})();
return a[b] || null;
}, showFilterItem: function () {
this._toggleFilterItemVisibility(true);
}, hideFilterItem: function () {
this._toggleFilterItemVisibility(false);
}, get_isFilterItemVisible: function () {
return this._data.isFilterItemExpanded;
}, _toggleFilterItemVisibility: function (a) {
var b = this._getTableFilterRow();
if (b && a != this._data.isFilterItemExpanded) {
if (a) {
b.style.display = "";
} else {
b.style.display = "none";
}
this._data.isFilterItemExpanded = a;
Array.add(this._owner._expandedFilterItems, this._data.UniqueID + "!");
this._owner.updateClientState();
}
}, get_tableFilterRow: function () {
return this._getTableFilterRow();
}, _getTableFilterRow: function () {
filterRow = null;
var d = this.get_element();
if (d.tHead && d.tHead.style.display != "none") {
if (this._hasMultiHeaders) {
for (var a = 0;
a < d.tHead.rows.length;
a++) {
var b = d.tHead.rows[a];
if (b.className && b.className.indexOf("rgFilterRow") > -1) {
return b;
}
}
}
if (!this.HeaderRow) {
return null;
}
var c = (this.HeaderRow) ? this.HeaderRow.rowIndex : 1;
for (var a = c;
a < d.tHead.rows.length;
a++) {
var b = d.tHead.rows[a];
if (b != null && b.cells[0] != null && b.cells[0].tagName != null && b.cells[0].tagName.toLowerCase() != "th" && b.className && b.className.indexOf("rgFilterRow") > -1) {
filterRow = b;
break;
}
}
} else {
if (this._owner.get_masterTableViewHeader() && this._owner.get_masterTableViewHeader().get_element()) {
d = this._owner.get_masterTableViewHeader().get_element();
if (d.tHead && this._hasMultiHeaders) {
for (var a = 0;
a < d.tHead.rows.length;
a++) {
var b = d.tHead.rows[a];
if (b.className && b.className.indexOf("rgFilterRow") > -1) {
return b;
}
}
}
for (var a = 1;
a < d.rows.length;
a++) {
var b = d.tHead.rows[a];
if (b != null && b.cells[0] != null && b.cells[0].tagName != null && b.className && b.className.indexOf("rgFilterRow") > -1) {
filterRow = d.tHead.rows[a];
break;
}
}
}
}
return filterRow;
}, _initializeAriaSupport: function () {
var j = this.get_element();
if (j.id && j.id.indexOf("Detail") != -1) {
j.setAttribute("role", "listitem");
var h = j.parentNode;
if (h && h.tagName.toLowerCase() == "td") {
h.setAttribute("role", "group");
}
var f = this.get_dataItems();
if (f.length > 0) {
var g = f[0].get_element().id.split(":").length;
j.setAttribute("aria-level", g.toString());
}
}
var a = this.get_tableFilterRow();
if (a) {
var d = a.getElementsByTagName("input");
for (var b = 0;
b < d.length;
b++) {
var c = d[b];
var e = c.style.display != "none" && c.style.visibility != "hidden";
if (e) {
var k = c.type.toLowerCase();
if (k == "text") {
c.setAttribute("role", "textbox");
}
if (k == "submit" || k == "button") {
c.setAttribute("role", "button");
}
if (k == "checkbox") {
c.setAttribute("role", "checkbox");
}
}
}
}
}, _handleAutoPostBackOnFilterWithoutDelay: function (c, g, d) {
var b = $find(c);
var a = b.get_textBoxValue();
if (this._currentFilterTimeoutID) {
clearTimeout(this._currentFilterTimeoutID);
}
try {
var f = this.get_id();
this._currentFilterTimeoutID = setTimeout(function () {
var j = $find(f);
var h = b.get_textBoxValue();
var i = b.parseDate(h);
if (!j._shouldAutoPostBackOnFilter) {
return;
}
if (i != null) {
b.set_selectedDate(i);
if (b.get_selectedDate()) {
j.filter(g, j._getFilterControlValue(g));
}
} else {
if (h == "") {
if (j.__shouldPerformFiltering) {
j.filter(g, "");
} else {
this.__shouldPerformFiltering = true;
}
}
}
}, d);
} catch (e) {
}
}, _handleAutoPostBackOnFilterWithDelay: function (d, b, h, c) {
var a = $find(b);
var e = d ? d : window.event;
if (this._currentFilterTimeoutID) {
clearTimeout(this._currentFilterTimeoutID);
}
try {
var g = this.get_id();
if (e.keyCode == 13 || e.keyCode == 20) {
e.cancelBubble = true;
e.returnValue = false;
if (e.stopPropagation) {
e.stopPropagation();
e.preventDefault();
}
this._currentFilterTimeoutID = setTimeout(function () {
var k = $find(g);
var i = a.get_textBoxValue();
var j = a.parseDate(i);
if (j != null) {
a.set_selectedDate(j);
} else {
if (i == "") {
a.set_selectedDate(i);
}
}
}, 0);
} else {
this._currentFilterTimeoutID = setTimeout(function () {
var k = $find(g);
var i = a.get_textBoxValue();
var j = a.parseDate(i);
if (j != null) {
a.set_selectedDate(j);
} else {
if (i == "") {
a.set_selectedDate(i);
}
}
}, c);
}
} catch (f) {
}
}, _filterOnKeyDownWithDelay: function (b, d, g, a, e) {
var c = b ? b : window.event;
if (c.keyCode == 8 || c.keyCode == 46) {
if (this._currentFilterTimeoutID) {
clearTimeout(this._currentFilterTimeoutID);
}
var f = this.get_id();
if (!$telerik.isOpera || e) {
this._currentFilterTimeoutID = setTimeout(function () {
$find(f).filter(g, $get(d).value);
}, a);
} else {
this._currentFilterTimeoutID = setTimeout(function () {
$get(d).blur();
}, a);
}
}
}, _filterOnKeyPressWithDelay: function (b, d, g, a, e) {
var c = b ? b : window.event;
var f = this.get_id();
if ($telerik.isFirefox && ((c.keyCode >= 33 && c.keyCode <= 40) || (c.keyCode >= 112 && c.keyCode <= 123) || (c.keyCode >= 16 && c.keyCode <= 20) || (c.keyCode >= 144 && c.keyCode <= 145) || (c.keyCode >= 92 && c.keyCode <= 93))) {
return;
}
if (this._currentFilterTimeoutID) {
clearTimeout(this._currentFilterTimeoutID);
}
if (c.keyCode == 13) {
c.cancelBubble = true;
c.returnValue = false;
if ((c.preventDefault)) {
c.preventDefault();
c.stopPropagation();
}
if (!$telerik.isOpera || e) {
this._currentFilterTimeoutID = setTimeout(function () {
$find(f).filter(g, $get(d).value);
}, 0);
} else {
this._currentFilterTimeoutID = setTimeout(function () {
$get(d).blur();
}, 0);
}
return false;
} else {
if (!$telerik.isOpera || e) {
this._currentFilterTimeoutID = setTimeout(function () {
$find(f).filter(g, $get(d).value);
}, a);
} else {
this._currentFilterTimeoutID = setTimeout(function () {
$get(d).blur();
}, a);
}
}
}, _filterNoDelay: function (a, c) {
var b = this.get_id();
if (this._currentFilterTimeoutID) {
clearTimeout(this._currentFilterTimeoutID);
}
this._currentFilterTimeoutID = setTimeout(function () {
var e = $get(a).value;
var d = $find(a);
if (d && d.get_value) {
e = d.get_value();
}
$find(b).filter(c, e);
}, 0);
}, get_clientDataKeyNames: function () {
var a = [];
if (this._data.clientDataKeyNames) {
a = this._data.clientDataKeyNames;
}
return a;
}, get_dataItems: function () {
if (this._dataItemsCreated || (this._cachedItems && this._cachedItems.length > 0)) {
return this._dataItems;
}
this._dataItemsCreated = true;
var o = ($telerik.isOpera) ? this.get_element() : this.get_element().tBodies[0];
var n = o.rows;
for (var c = 0, k = n.length;
c < k;
c++) {
var m = n[c];
if (!m.id) {
continue;
}
var b = $find(m.id);
var a = {};
this._owner.raise_rowCreating(new Sys.EventArgs());
var e = true;
var g = this._owner._unselectableItemsInternal;
for (var h = 0;
len = g.length, h < len;
h++) {
if (g[h].id == m.id) {
e = false;
break;
}
}
var f = false;
for (var h = 0;
h < this._owner._selectedItemsInternal.length;
h++) {
if (this._owner._selectedItemsInternal[h].id == m.id) {
f = true;
break;
}
}
var d = false;
if (this._owner._expandItems[m.id.split("__")[1]]) {
d = true;
}
for (var h = 0;
h < this._owner._expandedItems.length;
h++) {
if (this._owner._expandedItems[h] == m.id.split("__")[1]) {
d = !d;
break;
}
}
if (!b) {
b = $create(Telerik.Web.UI.GridDataItem, {_owner: this, _data: a}, null, null, m);
}
b._selectable = e;
b._selected = f;
b._expanded = d;
b._itemIndexHierarchical = m.id.split("__")[1];
if (this._virtualization) {
this._virtualization.updateItemState(b);
}
this._dataItems[this._dataItems.length] = b;
if (c == 0) {
this._saveCellAttributes(b);
}
this._owner.raise_rowCreated(new Telerik.Web.UI.GridDataItemEventArgs(m, null));
}
if (this._virtualization) {
this._virtualization.updateItemsCellSelectionState();
}
return this._dataItems;
}, get_owner: function () {
return this._owner;
}, get_name: function () {
return this._data.Name;
}, get_isItemInserted: function () {
return this._data.IsItemInserted;
}, get_insertItem: function () {
var b = $find(this._owner.get_id());
var c = null;
function a(j) {
for (var g = 0;
g < j.length;
g++) {
var h = j[g];
if (h.className.indexOf("rgEditRow") > -1) {
return h;
} else {
var f = h.getElementsByTagName("div")[0];
if (f && f.className.indexOf("rgEditForm") > -1) {
return h;
}
}
}
return null;
}
if (this === b.get_masterTableView() && b.ClientSettings.Scrolling.AllowScroll && b.ClientSettings.Scrolling.UseStaticHeaders) {
if (b.GridHeaderDiv) {
var e = b.GridHeaderDiv.getElementsByTagName("thead")[0];
if (e) {
c = a(e.rows);
}
if (!c && b.PagerControl) {
c = a(b.PagerControl.rows);
}
}
} else {
var d = this.get_element();
if (d.tHead) {
c = a(d.tHead.rows);
}
if (!c && d.tFoot) {
c = a(d.tFoot.rows);
}
}
return c;
}, get_editItems: function () {
var a = [];
var c = this.get_dataItems();
for (var b = 0;
b < c.length;
b++) {
if (c[b].get_isInEditMode()) {
a[a.length] = c[b];
}
}
return a;
}, _handlerKeyDownInInserItem: function (a) {
var d = a.keyCode || a.charCode;
var b = (d == this._owner.ClientSettings.KeyboardNavigationSettings.ExitEditInsertModeKey);
var c = (d == this._owner.ClientSettings.KeyboardNavigationSettings.UpdateInsertItemKey);
if (!this._owner._canHandleKeyboardAction(a)) {
return;
}
if (b) {
this.cancelInsert();
a.cancelBubble = true;
a.returnValue = false;
if (a.stopPropagation) {
a.preventDefault();
a.stopPropagation();
}
} else {
if (c) {
this.insertItem();
a.cancelBubble = true;
a.returnValue = false;
if (a.stopPropagation) {
a.preventDefault();
a.stopPropagation();
}
}
}
return false;
}, _showNotFrozenColumn: function (a) {
this._hideShowNotFrozenColumn(a, true);
}, _hideNotFrozenColumn: function (a) {
this._hideShowNotFrozenColumn(a, false);
}, showColumn: function (c) {
if (this.get_columns()[c].Display) {
return;
}
var a = new Telerik.Web.UI.GridColumnCancelEventArgs(this.get_columns()[c], null);
this._owner.raise_columnShowing(a);
if (a.get_cancel()) {
return false;
}
this._hideShowColumn(c, true);
var b = this._data.UniqueID + "," + this.get_columns()[c].get_uniqueName();
if (!Array.contains(this._owner._showedColumns, b)) {
Array.add(this._owner._showedColumns, b);
}
if (Array.contains(this._owner._hidedColumns, b)) {
Array.remove(this._owner._hidedColumns, b);
}
this._owner.updateClientState();
$find(this._owner.get_id()).repaint();
var a = new Telerik.Web.UI.GridColumnEventArgs(this.get_columns()[c], null);
this._owner.raise_columnShown(a);
}, hideColumn: function (d) {
if (!this.get_columns()[d].Display) {
return;
}
if (this._getVisibleColumnsCount() == 1) {
var c = this.get_columns()[d]._data.ColumnType;
if (!this._isHelperColumnType(c)) {
return;
}
}
var a = new Telerik.Web.UI.GridColumnCancelEventArgs(this.get_columns()[d], null);
this._owner.raise_columnHiding(a);
if (a.get_cancel()) {
return false;
}
this._hideShowColumn(d, false);
var b = this._data.UniqueID + "," + this.get_columns()[d].get_uniqueName();
if (!Array.contains(this._owner._hidedColumns, b)) {
Array.add(this._owner._hidedColumns, b);
}
if (Array.contains(this._owner._showedColumns, b)) {
Array.remove(this._owner._showedColumns, b);
}
this._owner.updateClientState();
var a = new Telerik.Web.UI.GridColumnEventArgs(this.get_columns()[d], null);
this._owner.raise_columnHidden(a);
}, _getVisibleColumnsCount: function () {
var c = 0;
var b = this.get_columns();
var a = null;
var d = null;
for (var e = 0;
len = b.length, e < len;
e++) {
a = b[e];
d = a._data.ColumnType;
if (this._isHelperColumnType(d) || a.get_element().style.display == "none") {
continue;
}
c++;
}
return c;
}, _isHelperColumnType: function (a) {
if (a == "GridExpandColumn" || a == "GridGroupSplitterColumn" || a == "GridRowIndicatorColumn" || a == "GridDragDropColumn") {
return true;
}
return false;
}, _hideShowColumn: function (h, d, e) {
var d = this.get_columns()[h].Display = d;
if (this.get_columns()[h]._data) {
this.get_columns()[h]._data.Display = d;
}
var j = false;
if (this._owner.ClientSettings.Resizing && this._owner.ClientSettings.Resizing.EnableRealTimeResize) {
j = this._owner.ClientSettings.Resizing.EnableRealTimeResize;
}
if (this._hasMultiHeaders) {
var o = this.get_element().tHead;
var m = this._owner.ClientSettings.Scrolling;
if (m && m.AllowScroll && m.UseStaticHeaders) {
o = this.get_owner().GridHeaderDiv.getElementsByTagName("table")[0].tHead;
}
var f = [];
if (o && o.rows) {
for (var g = 0;
g < o.rows.length;
g++) {
var l = o.rows[g];
if (l.className && l.className.indexOf("rgMultiHeaderRow") > -1) {
f.push(l);
}
}
}
if (!this._calculatedParentTableCells) {
this._calculatedParentTableCells = true;
this._setParentTableCells(f);
}
}
if (this != this._owner.get_masterTableViewHeader() && this != this._owner.get_masterTableViewFooter() && this != this._owner.get_masterTableView()) {
if (!$telerik.isIE7 && !$telerik.isIE6) {
this._hideShowCol(this, h, d);
} else {
this._removeRestoreCol(this, h, d);
}
if (!e) {
Telerik.Web.UI.Grid.hideShowCells(this.get_element(), h, d, this.ColGroup.Cols);
}
this._setHeaderFooterSpan();
return;
}
if (this._owner.get_masterTableViewHeader()) {
if (!$telerik.isIE7 && !$telerik.isIE6) {
this._hideShowCol(this._owner.get_masterTableViewHeader(), h, d);
}
if ($telerik.isIE7 || $telerik.isIE6) {
this._removeRestoreCol(this._owner.get_masterTableViewHeader(), h, d);
var b = this._owner.get_masterTableViewHeader().get_element().getElementsByTagName("colgroup")[0];
var c = b.getElementsByTagName("col");
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableViewHeader().get_element(), h, d, c);
} else {
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableViewHeader().get_element(), h, d, this._owner.get_masterTableView().ColGroup.Cols);
}
}
if (this._owner.get_masterTableView()) {
if (!$telerik.isIE7 && !$telerik.isIE6) {
this._hideShowCol(this._owner.get_masterTableView(), h, d);
} else {
this._removeRestoreCol(this._owner.get_masterTableView(), h, d);
}
if (!e) {
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableView().get_element(), h, d, this._owner.get_masterTableView().ColGroup.Cols);
}
}
if (this._owner.get_masterTableViewFooter() && !e) {
if (!$telerik.isIE7 && !$telerik.isIE6) {
this._hideShowCol(this._owner.get_masterTableViewFooter(), h, d);
}
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableViewFooter().get_element(), h, d, this._owner.get_masterTableViewFooter().ColGroup.Cols);
}
if (!e) {
this._setHeaderFooterSpan();
if ($telerik.isIE7) {
var n = Math.max(this._getVisibleColumns().length, 1);
var k = $telerik.getElementByClassName(this._owner.get_masterTableView().get_element(), "rgNoRecords");
if (k && k.cells && k.cells.length > 0) {
var a = k.cells[0];
if (a.className.indexOf("rgExpandCol") == -1 && a.className.indexOf("rgGroupCol") == -1) {
k.cells[0].colSpan = n;
}
}
}
}
}, _setParentTableCells: function (g) {
var l = [];
for (var h = 0;
h < g.length;
h++) {
var m = g[h];
var a = 0;
var c = 0;
var e = null;
var f = 0;
var d = [];
if (l.length > 0) {
e = l[0];
c = e.colSpan;
}
for (var k = 0;
k < m.cells.length;
k++) {
var b = m.cells[k];
if (h == 0) {
b.parentCell = null;
a += b.colSpan;
} else {
b.parentCell = e;
if (b.colSpan < c) {
c -= b.colSpan;
} else {
if (b.colSpan == c) {
if (f < l.length - 1) {
e = l[++f];
c = e.colSpan;
}
}
}
}
if (!b.id || b.id.indexOf("MultiHeader") == -1) {
d.push(b);
}
}
l = d;
}
}, _removeRestoreCol: function (p, l, g) {
var h = p._hiddenCols;
var d = p.get_columns();
var c = p.get_columns()[l];
var e = c.get_uniqueName();
var o = p.get_element();
var a = o.getElementsByTagName("colgroup")[0];
var b = a.getElementsByTagName("col");
if (p && p.ColGroup && p.ColGroup.Cols && p.ColGroup.Cols[l]) {
if (!g) {
if (h[e] && h[e].columnIndex == l && h[e].position == l) {
return;
}
if (!h[e]) {
h[e] = {};
}
h[e].columnIndex = l;
h[e].position = l;
for (var m = 0;
m < d.length;
m++) {
var q = d[m].get_uniqueName();
var f = h[d[m].get_uniqueName()];
if (f != undefined) {
if (f.columnIndex < h[e].columnIndex) {
h[e].position--;
} else {
if (f.columnIndex > h[e].columnIndex) {
f.position--;
}
}
}
}
for (var j = 0;
j < b.length;
j++) {
if (j == h[e].position) {
h[e].col = b[h[e].position];
a.removeChild(b[h[e].position]);
break;
}
}
} else {
if (!h[e]) {
return;
}
var n = h[e].position;
for (var m = 0;
m < d.length;
m++) {
var q = d[m].get_uniqueName();
var f = h[d[m].get_uniqueName()];
if (f != undefined) {
if (f.columnIndex > h[e].columnIndex) {
f.position++;
}
}
}
h[e].col.style.display = "";
if (n >= b.length) {
a.appendChild(h[e].col);
} else {
a.insertBefore(h[e].col, b[h[e].position]);
}
h[e] = null;
}
}
}, _setHeaderFooterSpan: function () {
var a = function (i) {
if (!i) {
return 0;
}
var k = 0;
for (var l = 0, m = i.length;
l < m;
l++) {
k += i[l].colSpan;
}
return k;
};
var g = this.get_element().tFoot;
var h = this.get_element().tHead;
var e = Math.max(this._getVisibleColumns().length, 1);
if (g && g.rows) {
for (var c = 0, d = g.rows.length;
c < d;
c++) {
if (g.rows[c].cells && g.rows[c].cells[0]) {
var b = a(g.rows[c].cells);
if (e > b) {
g.rows[c].cells[0].colSpan = e;
}
}
}
}
if (h && h.rows) {
for (var c = 0, d = h.rows.length;
c < d;
c++) {
if (h.rows[c] && (h.rows[c] == this.get_element().HeaderRow || (h.rows[c].cells.length > 0 && h.rows[c].cells[0].tagName.toLowerCase() == "th"))) {
var f = (this.get_element().tBodies && this.get_element().tBodies[0]) ? this.get_element().tBodies[0] : null;
if (f && f.rows && f.style.display == "none" && f.rows[0].cells.length == 1 && f.rows[0].cells[0].colSpan) {
f.rows[0].cells[0].colSpan = e;
}
break;
}
if (h.rows[c] && h.rows[c].cells && h.rows[c].cells.length > 0 && h.rows[c].cells[0]) {
var b = a(h.rows[c].cells);
if (e > b) {
h.rows[c].cells[0].colSpan = e;
}
}
}
}
}, _getVisibleColumns: function () {
var e = [];
if (this.get_columns()) {
var b = this.get_columns();
for (var c = 0, d = b.length;
c < d;
c++) {
var a = b[c];
if (a.get_element().style.visibility != "hidden" && a.get_element().style.display != "none" && (a.Display == null || a.Display)) {
Array.add(e, a);
}
}
}
return e;
}, _hideShowCol: function (e, d, c) {
if (e && e.ColGroup && e.ColGroup.Cols && e.ColGroup.Cols[d]) {
var a = e.ColGroup.Cols[d];
var b = (a.style.display == "") ? true : false;
if (b != c) {
if (c) {
a.style.display = "";
if (this._owner.get_enableAriaSupport()) {
a.setAttribute("aria-hidden", "false");
}
} else {
a.style.display = "none";
if (this._owner.get_enableAriaSupport()) {
a.setAttribute("aria-hidden", "true");
}
}
this._tryAddRemoveColWidth(e, c);
}
}
}, _tryAddRemoveColWidth: function (e, c) {
if (!$telerik.isIE8 && !$telerik.isChrome && !$telerik.isSafari) {
return;
}
var f = e._getVisibleColumns();
if (f.length !== 1) {
return;
}
var a = e._getVisibleColumns()[0], d = a.get_element().cellIndex, b;
if (e && e.ColGroup && e.ColGroup.Cols && e.ColGroup.Cols[d]) {
b = e.ColGroup.Cols[d];
if (c) {
if (a._bufferWidth) {
b.style.width = a._bufferWidth;
a._bufferWidth = null;
}
} else {
a._bufferWidth = b.style.width;
b.style.width = "";
}
}
}, _hideShowNotFrozenColumn: function (b, a) {
var c = 10;
if ($telerik.isOpera) {
c = navigator.userAgent.substring(navigator.userAgent.indexOf("Version/") + "Version".length + 1) * 1;
}
if (this._owner.get_masterTableViewHeader()) {
this._owner.get_masterTableViewHeader().get_columns()[b].FrozenDisplay = a;
if (!window.netscape && navigator.userAgent.toLowerCase().indexOf("safari") == -1) {
this._hideShowCol(this._owner.get_masterTableViewHeader(), b, a);
if ($telerik.isIE8 || $telerik.isIE9Mode || ($telerik.isOpera && c > 10.1)) {
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableViewHeader().get_element(), b, a, this._owner.get_masterTableViewHeader().ColGroup.Cols);
}
this._setHeaderFooterSpan();
if (!$telerik.isIE6) {
var d = this._owner.get_masterTableViewHeader().get_element().getElementsByTagName("select");
if (d.length > 0) {
var e = this._owner.get_masterTableViewHeader().get_element();
setTimeout(function () {
for (var g = 0, h = e.rows.length;
g < h;
g++) {
var f = e.rows[g].cells[b];
Telerik.Web.UI.Grid._hideShowSelect(f, a);
}
}, 0);
}
}
} else {
this._hideShowCol(this._owner.get_masterTableViewHeader(), b, a);
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableViewHeader().get_element(), b, a, this._owner.get_masterTableViewHeader().ColGroup.Cols);
this._setHeaderFooterSpan();
}
}
if (this._owner.get_masterTableView()) {
this._owner.get_masterTableView().get_columns()[b].FrozenDisplay = a;
if (!window.netscape && navigator.userAgent.toLowerCase().indexOf("safari") == -1) {
this._hideShowCol(this._owner.get_masterTableView(), b, a);
if ($telerik.isIE8 || $telerik.isIE9Mode || ($telerik.isOpera && c > 10.1)) {
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableView().get_element(), b, a, this._owner.get_masterTableView().ColGroup.Cols);
}
this._setHeaderFooterSpan();
if (!$telerik.isIE6) {
var d = this._owner.get_masterTableView().get_element().getElementsByTagName("select");
if (d.length > 0) {
var e = this._owner.get_masterTableView().get_element();
setTimeout(function () {
for (var g = 0, h = e.rows.length;
g < h;
g++) {
var f = e.rows[g].cells[b];
Telerik.Web.UI.Grid._hideShowSelect(f, a);
}
}, 0);
}
}
} else {
this._hideShowCol(this._owner.get_masterTableView(), b, a);
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableView().get_element(), b, a, this._owner.get_masterTableView().ColGroup.Cols);
this._setHeaderFooterSpan();
}
}
if (this._owner.get_masterTableViewFooter()) {
if (!window.netscape && navigator.userAgent.toLowerCase().indexOf("safari") == -1) {
this._hideShowCol(this._owner.get_masterTableViewFooter(), b, a);
if ($telerik.isIE8 || $telerik.isIE9Mode || ($telerik.isOpera && c > 10.1)) {
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableViewFooter().get_element(), b, a, this._owner.get_masterTableViewFooter().ColGroup.Cols);
}
this._setHeaderFooterSpan();
if (!$telerik.isIE6) {
var d = this._owner.get_masterTableViewFooter().get_element().getElementsByTagName("select");
if (d.length > 0) {
var e = this._owner.get_masterTableViewFooter().get_element();
setTimeout(function () {
for (var g = 0, h = e.rows.length;
g < h;
g++) {
var f = e.rows[g].cells[b];
Telerik.Web.UI.Grid._hideShowSelect(f, a);
}
}, 0);
}
}
} else {
this._hideShowCol(this._owner.get_masterTableViewFooter(), b, a);
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableViewFooter().get_element(), b, a, this._owner.get_masterTableViewFooter().ColGroup.Cols);
this._setHeaderFooterSpan();
}
}
}, hideItem: function (d) {
if (!this._canShowHideItem(d)) {
return false;
}
var e = null;
if (this.get_element() && this.get_element().tBodies.length > 1) {
var b = $telerik.getFirstChildByTagName(this.get_element(), "tbody", 0);
if (b && b.rows[d]) {
e = b.rows[d];
}
} else {
if (this.get_element() && this.get_element().tBodies[0] && this.get_element().tBodies[0].rows[d]) {
e = this.get_element().tBodies[0].rows[d];
}
}
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(e, null);
this._owner.raise_rowHiding(a);
if (a.get_cancel()) {
return false;
}
if (e) {
e.style.display = "none";
}
if (e && e.id != "" && e.id.split("__").length == 2) {
var f = e.id.split("__")[1];
var c = this._hidedItemsData;
c.add(String.format("{0},{1}", this.get_id(), f));
this._owner._hidedItems = c.toString();
this._owner.updateClientState();
}
$find(this._owner.get_id())._getPositionedDataItems(true);
var a = new Telerik.Web.UI.GridDataItemEventArgs(e, null);
this._owner.raise_rowHidden(a);
}, showItem: function (c) {
if (!this._canShowHideItem(c)) {
return false;
}
var d = null;
if (this.get_element() && this.get_element().tBodies.length > 1) {
var b = $telerik.getFirstChildByTagName(this.get_element(), "tbody", 0);
if (b && b.rows[c]) {
d = b.rows[c];
}
} else {
if (this.get_element() && this.get_element().tBodies[0] && this.get_element().tBodies[0].rows[c]) {
d = this.get_element().tBodies[0].rows[c];
}
}
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(d, null);
this._owner.raise_rowShowing(a);
if (a.get_cancel()) {
return false;
}
if (d) {
if (window.netscape) {
d.style.display = "table-row";
} else {
d.style.display = "";
}
}
if (d && d.id != "" && d.id.split("__").length == 2) {
var e = d.id.split("__")[1];
var f = this._showedItemsData;
f.add(String.format("{0},{1}", this.get_id(), e));
this._owner._showedItems = f.toString();
this._owner.updateClientState();
}
$find(this._owner.get_id())._getPositionedDataItems(true);
var a = new Telerik.Web.UI.GridDataItemEventArgs(d, null);
this._owner.raise_rowShown(a);
}, _canShowHideItem: function (b) {
if (isNaN(parseInt(b))) {
var c = 'Row index must be of type "Number"!';
alert(c);
return false;
}
if (b < 0) {
var c = "Row index must be non-negative!";
alert(c);
return false;
}
if (this.get_element() && this.get_element().tBodies.length > 1) {
var a = $telerik.getFirstChildByTagName(this.get_element(), "tbody", 0);
if (a && a.rows[b] && (b > a.rows[b].length - 1)) {
var c = "Row index must be less than rows count!";
alert(c);
return false;
}
} else {
if (this.get_element() && this.get_element().tBodies[0] && this.get_element().tBodies[0].rows[b] && (b > (this.get_element().tBodies[0].rows[b].length - 1))) {
var c = "Row index must be less than rows count!";
alert(c);
return false;
}
}
return true;
}, _getRowsFromBody: function (b) {
var d = b.length;
var c = new Array();
for (var a = 0;
a < d;
a++) {
if (b[a].parentNode.tagName.toUpperCase() == "TBODY") {
return b[a].parentNode.rows;
}
}
}, _getFirstDataRow: function () {
if (this._firstDataRow != null) {
return this._firstDataRow;
}
if (this._dataItems.length > 0) {
return this._dataItems[0].get_element();
}
var d = [];
if ($telerik.isOpera) {
d = this._getRowsFromBody(this.get_element().rows);
} else {
var e = this.get_element().tBodies;
if (e.length > 0) {
d = e[0].rows;
}
}
for (var a = 0, b = d.length;
a < b;
a++) {
var c = d[a];
if (c.id != "" && c.id.split("__").length == 2) {
this._firstRow = c;
break;
}
}
return this._firstRow;
}, _getNextDataRow: function (d) {
var c = null;
var e;
if ($telerik.isOpera) {
e = this._getRowsFromBody(this.get_element().rows);
} else {
e = this.get_element().tBodies[0].rows;
}
for (var a = d.sectionRowIndex + 1, b = e.length;
a < b;
a++) {
var d = e[a];
if (d.id != "" && d.id.split("__").length == 2) {
c = d;
break;
}
}
return c;
}, _getNestedTableWhenRowIsInEditMode: function (d) {
var b = null;
var c = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(d, "tr");
if (this._data.hasDetailItemTemplate) {
c = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(c, "tr");
}
if (c) {
var a = c.nextSibling.getElementsByTagName("table");
if (a.length > 0 && a[0].id.indexOf("Detail") != -1) {
b = a[0];
}
}
return b;
}, _getNextNestedDataRow: function (g) {
var f = null;
var d = null;
var b = g.id;
var a = $find(b);
if (this._owner.ClientSettings.AllowKeyboardNavigation && a && a.get_isInEditMode()) {
d = this._getNestedTableWhenRowIsInEditMode(g);
} else {
if (this._data.hasDetailItemTemplate) {
var e = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(g, "tr");
d = Telerik.Web.UI.Grid.GetNestedTable(e);
} else {
d = Telerik.Web.UI.Grid.GetNestedTable(g);
}
}
if (d) {
var h;
if ($telerik.isOpera) {
h = this._getRowsFromBody(this.get_element().rows);
} else {
h = this.get_element().tBodies[0].rows;
}
for (var c = 0;
c < h.length;
c++) {
var g = h[c];
if (g.id != "" && g.id.split("__").length == 2) {
f = g;
break;
}
}
}
return f;
}, _getPreviousDataRow: function (c) {
var b = null;
var d;
if ($telerik.isOpera) {
d = this._getRowsFromBody(this.get_element().rows);
} else {
d = this.get_element().tBodies[0].rows;
}
for (var a = c.sectionRowIndex - 1;
a >= 0;
a--) {
var c = d[a];
if (c.id != "" && c.id.split("__").length == 2) {
b = c;
break;
}
}
return b;
}, _getPreviousNestedDataRow: function (d) {
var c = null;
var b = Telerik.Web.UI.Grid.GetNestedTable(d);
if (b) {
var e;
if ($telerik.isOpera) {
e = this._getRowsFromBody(this.get_element().rows);
} else {
e = this.get_element().tBodies[0].rows;
}
for (var a = d.sectionRowIndex - 1;
a >= 0;
a--) {
var d = e[a];
if (d.id != "" && d.id.split("__").length == 2) {
c = d;
break;
}
}
}
return c;
}, get_parentView: function () {
var a = null;
if (this.get_id() != this._owner.get_masterTableView().get_id()) {
a = $find(this.get_parentRow().id.split("__")[0]);
}
return a;
}, get_parentRow: function () {
var a = null;
if (this.get_id() != this._owner.get_masterTableView().get_id()) {
a = this.get_element().parentNode.parentNode.previousSibling;
}
return a;
}, get_selectedItems: function () {
var d = [];
for (var a = 0;
a < this._owner._selectedItemsInternal.length;
a++) {
var c = this._owner._selectedItemsInternal[a].id.split("__")[0];
if (c == this.get_id()) {
var b = $find(this._owner._selectedItemsInternal[a].id);
if (b == null) {
if ($get(this._owner._selectedItemsInternal[a].id)) {
b = $create(Telerik.Web.UI.GridDataItem, {
_owner: this,
_data: this._data,
_selected: true
}, null, null, $get(this._owner._selectedItemsInternal[a].id));
Array.add(d, b);
}
} else {
if (b && b._owner.get_element().id == this.get_element().id) {
Array.add(d, b);
}
}
}
}
return d;
}, selectAllItems: function () {
if (!this._owner.AllowMultiRowSelection) {
return;
}
var f = ($telerik.isOpera) ? this.get_element() : this.get_element().tBodies[0];
var e = f.rows;
if (!e) {
return;
}
for (var a = 0, c = e.length;
a < c;
a++) {
var d = e[a];
if (!d.id) {
continue;
}
var b = $find(d.id);
if (b) {
b.set_selected(true);
} else {
this.selectItem(d);
}
}
}, clearSelectedItems: function () {
var h = this, d = h._owner, a = h.get_element().id, g = d._selectedItemsInternal, e = d._selectedIndexes, b, c, f;
if (g.length > 0) {
b = g.length - 1;
while (b >= 0) {
f = g[b];
c = $find(f.id);
if (c) {
if (c._owner.get_element().id == a) {
c.set_selected(false);
}
} else {
c = $get(f.id);
if (c && c.parentNode && c.parentNode.parentNode.id == a) {
h.deselectItem($get(f.id));
} else {
Array.remove(g, f);
Array.remove(e, e[b]);
h._owner.updateClientState();
}
}
b = Math.min(g.length, b);
b--;
}
}
}, clearSelectedCells: function () {
if (this._owner._cellSelection != null) {
this._owner._cellSelection._deselectTableViewCells(this);
}
}, selectItem: function (a) {
a = this._getRowByIndexOrItemIndexHierarchical(a);
if (this._owner._selection && a && a.id) {
if (!this._owner.AllowMultiRowSelection) {
this.clearSelectedItems();
}
this._owner._keyboardNavigationProperties.lastClickSelectedItem = a;
this._owner._selection._selectRowInternal(a, {ctrlKey: false}, true, false, true);
}
}, deselectItem: function (a) {
var b = this;
a = b._getRowByIndexOrItemIndexHierarchical(a);
if (b._owner._selection && a && a.id && Array.contains(b._owner._selectedIndexes, a.id.split("__")[1])) {
b._owner._selection._selectRowInternal(a, {ctrlKey: false}, true, true, true);
}
}, _getRowByIndexOrItemIndexHierarchical: function (k) {
if (typeof(k) == "number") {
var j = null;
if (this.get_element().tBodies.length > 0) {
if (this.get_element().tBodies[0].rows[k]) {
j = this.get_element().tBodies[0].rows[k];
}
if (j && (j.id == "" || !j.id.endsWith(k.toString()))) {
while (j && !j.id.endsWith(k.toString())) {
j = this._getNextDataRow(j);
}
}
}
k = j;
}
if (typeof(k) == "string") {
var a = k;
k = $get(this.get_element().id + "__" + k);
if (!k) {
var f = a.split(":");
var b = f.length;
if (b > 1) {
var g = this;
var j = g.get_dataItems()[f[0]];
if (!j) {
if (g.get_dataItems().length == 1) {
j = g.get_dataItems()[0];
} else {
j = g.get_dataItems()[f[0].split("__")[1]];
}
}
for (var c = 1;
c < b;
c++) {
var h = f[c].split("_")[1];
g = j.get_nestedViews()[0];
if (!g) {
g = this;
}
if (g.get_dataItems().length == 1) {
j = g.get_dataItems()[0];
} else {
j = g.get_dataItems()[h];
}
}
k = j.get_element();
} else {
var d = parseInt(f[0].split("__")[1], 10);
var e = this.get_dataItems();
if (!isNaN(d) && d < e.length) {
k = e[d].get_element();
} else {
k = null;
}
}
}
}
return k;
}, reorderColumns: function (h, i) {
if (!this._owner.ClientSettings.AllowColumnsReorder) {
return;
}
if (this._owner.ClientSettings.ColumnsReorderMethod != 1) {
return;
}
var d = this.getColumnByUniqueName(h);
var e = this.getColumnByUniqueName(i);
if (!d || !e) {
return;
}
var m = d.get_element().parentNode;
var f = this._getCellIndexByColumnUniqueNameFromTableRowElement(m, h);
var g = this._getCellIndexByColumnUniqueNameFromTableRowElement(m, i);
if (this._hasMultiHeaders && m.className.indexOf("rgMultiHeaderRow") > -1) {
header1 = this._getMultiHeaderByColumnUniqueName(h);
if (header1) {
f = header1.index;
}
header2 = this._getMultiHeaderByColumnUniqueName(i);
if (header2) {
g = header2.index;
}
}
var k = this._owner.ClientSettings.ReorderColumnsOnClient;
this._owner.ClientSettings.ReorderColumnsOnClient = true;
var j = this._owner.ClientSettings.ColumnsReorderMethod;
this._owner.ClientSettings.ColumnsReorderMethod = 0;
if (g > f) {
var a = new Telerik.Web.UI.GridColumnCancelEventArgs(d, null);
this._owner.raise_columnMovingToLeft(a);
if (a.get_cancel()) {
return false;
}
while (f < g) {
var b = this.getColumnUniqueNameByCellIndex(m, f + 1);
var c = this.getColumnUniqueNameByCellIndex(m, f);
this.swapColumns(b, c);
f++;
}
var a = new Telerik.Web.UI.GridColumnEventArgs(d, null);
this._owner.raise_columnMovedToLeft(a);
} else {
var a = new Telerik.Web.UI.GridColumnCancelEventArgs(d, null);
this._owner.raise_columnMovingToRight(a);
if (a.get_cancel()) {
return false;
}
while (g < f) {
var b = this.getColumnUniqueNameByCellIndex(m, f - 1);
var c = this.getColumnUniqueNameByCellIndex(m, f);
this.swapColumns(b, c);
f--;
}
var a = new Telerik.Web.UI.GridColumnEventArgs(d, null);
this._owner.raise_columnMovedToRight(a);
}
this._owner.ClientSettings.ColumnsReorderMethod = j;
this._owner.ClientSettings.ReorderColumnsOnClient = k;
if (!this._owner.ClientSettings.ReorderColumnsOnClient) {
var l = this._owner.ClientSettings.PostBackFunction;
l = l.replace("{0}", this._owner.UniqueID);
eval(l);
return;
}
}, swapColumns: function (g, h) {
var e = this.getColumnByUniqueName(g);
var f = this.getColumnByUniqueName(h);
if (!e || !f) {
return;
}
if (!this._owner.ClientSettings.AllowColumnsReorder) {
return;
}
if (!e.get_reorderable() || !f.get_reorderable()) {
return;
}
if (!this._owner.ClientSettings.ReorderColumnsOnClient) {
var o = this._owner.ClientSettings.PostBackFunction;
o = o.replace("{0}", this._owner.UniqueID);
o = o.replace("{1}", "ReorderColumns," + this._data.UniqueID + "," + e.get_uniqueName() + "," + f.get_uniqueName());
eval(o);
return;
}
if (this._owner.ClientSettings.ColumnsReorderMethod != 0) {
return;
}
var l = this._getCellIndexByColumnUniqueNameFromTableRowElement(e.get_element().parentNode, g);
var m = this._getCellIndexByColumnUniqueNameFromTableRowElement(f.get_element().parentNode, h);
var b = new Sys.CancelEventArgs();
b.get_gridSourceColumn = function () {
return e;
};
b.get_gridTargetColumn = function () {
return f;
};
this._owner.raise_columnSwapping(b);
if (b.get_cancel()) {
return false;
}
if (this.get_id() && this.get_id().indexOf("Detail") != -1) {
this._reorderColumnsInternal(g, h);
}
if (this._owner.get_masterTableViewHeader()) {
this._owner.get_masterTableViewHeader()._reorderColumnsInternal(g, h);
}
if (this._owner.get_masterTableView()) {
this._owner.get_masterTableView()._reorderColumnsInternal(g, h);
}
if (this._owner.get_masterTableViewFooter()) {
var n = (this._owner.ClientSettings.Scrolling && this._owner.ClientSettings.Scrolling.AllowScroll && this._owner.ClientSettings.Scrolling.UseStaticHeaders);
if ((this.get_id() && this.get_id().indexOf("Detail") == -1) && n) {
this._owner.get_masterTableViewFooter()._reorderFooterInStaticHeaders(g, h);
} else {
this._owner.get_masterTableViewFooter()._reorderColumnsInternal(g, h);
}
}
var d = f.get_element().UniqueName;
var c = e.get_element().UniqueName;
e.get_element().UniqueName = d;
f.get_element().UniqueName = c;
var j = f._data;
f._data = e._data;
e._data = j;
this.get_columns()[m] = f;
this.get_columns()[l] = e;
if (this._owner.ClientSettings.AllowKeyboardNavigation && this._owner._cellSelection != null) {
var p = this.get_element().rows;
for (var k = 0;
k < p.length;
k++) {
if (p[k].id == "" || p[k].id == undefined) {
continue;
} else {
this._owner._cellSelection._setActiveCellElement(p[k].cells[m]);
break;
}
}
}
this._copyColAttributes(this._owner.get_masterTableView().ColGroup.Cols[l], this._owner.get_masterTableView().ColGroup.Cols[m]);
if (this._owner.get_masterTableViewHeader() && this._owner.get_masterTableViewHeader().ColGroup) {
this._copyColAttributes(this._owner.get_masterTableViewHeader().ColGroup.Cols[l], this._owner.get_masterTableViewHeader().ColGroup.Cols[m]);
}
if (this._owner.get_masterTableViewFooter() && this._owner.get_masterTableViewFooter().ColGroup) {
this._copyColAttributes(this._owner.get_masterTableViewFooter().ColGroup.Cols[l], this._owner.get_masterTableViewFooter().ColGroup.Cols[m]);
}
var b = new Sys.EventArgs();
b.get_gridSourceColumn = function () {
return e;
};
b.get_gridTargetColumn = function () {
return f;
};
this._createColumnsByUniqueNameHash();
this._owner.raise_columnSwapped(b);
var a = this._data.UniqueID + "," + g + "," + h;
Array.add(this._owner._reorderedColumns, a);
this._owner.updateClientState();
if (this._owner.ClientSettings.Resizing.AllowColumnResize && this._owner.ClientSettings.Resizing.AllowResizeToFit) {
Telerik.Web.UI.Grid.ClearBestFitCache(this.get_columns());
}
}, _copyColAttributes: function (e, f) {
if (e && f) {
var z = document.createElement("col");
var h = false;
var j = false;
if (e.style.width == "" && f.style.width != "") {
j = true;
}
if (f.style.width == "" && e.style.width != "") {
h = true;
}
var c = e.style.display;
var d = f.style.display;
$telerik.mergeElementAttributes(e, z, false);
$telerik.mergeElementAttributes(f, e, false);
$telerik.mergeElementAttributes(z, f, false);
e.style.display = d;
f.style.display = c;
if (h) {
e.style.width = "";
}
if (j) {
f.style.width = "";
}
var p = ($telerik.isIE6 || $telerik.isIE7) && this._hasMultiHeaders;
var s = this._owner.ClientSettings.Scrolling;
var q = s && s.AllowScroll && s.UseStaticHeaders;
var r = e.parentNode;
if (!r) {
return;
}
var y = r.parentNode;
if (!y) {
return;
}
var a = $telerik.$, A, B;
var t = p && q && y.id.indexOf("_Header") != -1;
if (t) {
var l = y.tHead ? a(y.tHead).find("tr.rgMultiHeaderRow")[0] : null;
if (l) {
var b = l.cells;
var n = a(e).index();
var o = a(f).index();
var x = 0, g = 0;
var u = false;
for (var m = 0;
m < b.length;
m++) {
var k = b[m];
u = (x == n || x == o);
if (u) {
g = Telerik.Web.UI.Grid.correctWidthForIE(k);
var v = x == n ? -1 : 1, w = x == o ? -1 : 1;
if (e.style.width) {
e.style.width = (parseInt(e.style.width) + v * g) + "px";
}
if (f.style.width) {
f.style.width = (parseInt(f.style.width) + w * g) + "px";
}
break;
}
x += k.colSpan;
}
}
}
}
}, _reorderFooterInStaticHeaders: function (c, d) {
for (var e = 0;
e < this.get_element().rows.length;
e++) {
var f = this.get_element().rows[e];
var a = this._getCellByFooterColumnUniqueNameFromTableRowElement(f, c);
var b = this._getCellByFooterColumnUniqueNameFromTableRowElement(f, d);
if (!a || !b) {
continue;
}
this._reorderControls(a, b);
}
}, _getCellByFooterColumnUniqueNameFromTableRowElement: function (c, d) {
for (var a = 0, b = this._owner.get_masterTableView().get_columns().length;
a < b;
a++) {
if (this._owner.get_masterTableView().get_columns()[a].get_element().UniqueName.toUpperCase() == d.toUpperCase()) {
return c.cells[a];
}
}
return null;
}, _reorderColumnsInternal: function (c, d) {
var g = (this._owner.ClientSettings.Scrolling && this._owner.ClientSettings.Scrolling.AllowScroll && this._owner.ClientSettings.Scrolling.UseStaticHeaders);
var h = false;
for (var e = 0;
e < this.get_element().rows.length;
e++) {
var j = this.get_element().rows[e];
if (!j.id && j.parentNode.tagName.toLowerCase() == "tbody") {
continue;
}
var a = this._getCellByColumnUniqueNameFromTableRowElement(j, c);
var b = this._getCellByColumnUniqueNameFromTableRowElement(j, d);
var f = this._hasMultiHeaders && j.className.indexOf("rgMultiHeaderRow") > -1;
if (f) {
if (h) {
continue;
}
h = true;
header1 = this._getMultiHeaderByColumnUniqueName(c);
if (header1) {
a = header1.cell;
}
header2 = this._getMultiHeaderByColumnUniqueName(d);
if (header2) {
b = header2.cell;
}
}
if (!a || !b) {
continue;
}
this._reorderControls(a, b);
}
}, _reorderControls: function (e, h) {
var a = document.createElement("div");
var b = document.createElement("div");
document.body.appendChild(a);
document.body.appendChild(b);
this._moveNodes(e, b);
this._moveNodes(h, a);
var f = e.style.cssText;
var g = h.style.cssText;
var c = e.className;
var d = h.className;
e.innerHTML = h.innerHTML = "";
this._moveNodes(b, h);
this._moveNodes(a, e);
this._recreateControls(e);
this._recreateControls(h);
e.style.cssText = g;
h.style.cssText = f;
e.className = d;
h.className = c;
a.parentNode.removeChild(a);
b.parentNode.removeChild(b);
}, _moveNodes: function (b, c) {
var a = b.childNodes;
while (a.length > 0) {
c.appendChild(a[0]);
}
}, _recreateControls: function (f) {
var e = f.getElementsByTagName("*");
for (var b = 0, c = e.length;
b < c;
b++) {
var d = e[b];
if (typeof(d.id) != "undefined" && d.id != "") {
var a = $find(d.id);
if (!a) {
continue;
}
a._element = $get(d.id);
}
}
}, getColumnByUniqueName: function (b) {
for (var a = 0;
a < this.get_columns().length;
a++) {
if (this.get_columns()[a].get_element().UniqueName == b) {
return this.get_columns()[a];
}
}
return null;
}, getCellByColumnUniqueName: function (a, b) {
return this._getCellByColumnUniqueNameFromTableRowElement(a.get_element(), b);
}, _getCellByColumnUniqueNameFromTableRowElement: function (b, d) {
var c = this, a = c._cellsByUniqueName = c._cellsByUniqueName || c._createColumnsByUniqueNameHash();
return b.cells[a[d]] || null;
}, _createColumnsByUniqueNameHash: function () {
var j = this, g = {}, a = j._columnsInternal, f = j._owner, e = j.get_id(), h = f.get_masterTableView(), b = f.get_masterTableViewFooter(), c = f.get_masterTableViewHeader();
for (var d = 0;
d < a.length;
d++) {
g[a[d].get_uniqueName()] = d;
}
if (e == h.get_id() || (b && e == b.get_id()) || (c && e == c.get_id())) {
f.get_masterTableView()._cellsByUniqueName = g;
if (c) {
c._cellsByUniqueName = g;
}
if (b) {
b._cellsByUniqueName = g;
}
} else {
j._cellsByUniqueName = g;
}
return g;
}, _getCellIndexByColumnUniqueNameFromTableRowElement: function (b, c) {
if (!c || c == "") {
return null;
}
for (var a = 0;
a < this.get_columns().length;
a++) {
if (this.get_columns()[a].get_element().UniqueName.toUpperCase() == c.toUpperCase()) {
return a;
}
}
return null;
}, getColumnUniqueNameByCellIndex: function (d, c) {
var a = this._toArray(d.cells).sort(function (e, f) {
return e.cellIndex - f.cellIndex;
});
for (var b = 0;
b < a.length;
b++) {
if (a[b].UniqueName && b == c) {
return a[b].UniqueName;
}
}
return null;
}, _toArray: function (a) {
var c = Array(a.length);
for (var b = 0;
b < c.length;
b++) {
c[b] = a[b];
}
return c;
}, _getMultiHeaderByColumnUniqueName: function (f) {
if (this._hasMultiHeaders) {
var c = this.getColumnByUniqueName(f);
if (c) {
var e = c.get_element().parentNode;
var b = e.cells;
for (var d = 0;
d < b.length;
d++) {
var a = b[d];
if (a.UniqueName == f) {
return {index: d, cell: a};
}
}
}
}
return null;
}, _sliderClientValueChanged: function (c, g, e) {
var b = $get(c);
var f = $find(g);
var a = "-2147483648";
if (b && f) {
var d = f.get_value();
if (!e) {
this._applyPagerLabelText(b, d, this.get_pageCount());
}
}
if (e) {
window.location.href = e.replace(a, d + 1);
}
}, _applyPagerLabelText: function (d, f, e) {
var h = this._owner.ClientSettings.ClientMessages.PagerTooltipFormatString;
var c = /\{0[^\}]*\}/g;
var b = /\{1[^\}]*\}/g;
var g = ((f == 0) ? 1 : f + 1);
var a = e;
h = h.replace(c, g).replace(b, a);
d.innerHTML = h;
}, resizeItem: function (f, e, g) {
if (!this._owner.ClientSettings.Resizing.AllowRowResize) {
return;
}
var c = this.get_element().rows[f];
if (c && c.id != "" && c.id.split("__").length == 2) {
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(c, null);
this._owner.raise_rowResizing(a);
if (a.get_cancel()) {
return false;
}
}
var b = this.get_element().style.tableLayout;
this.get_element().style.tableLayout = "";
var i = this.get_element().parentNode.parentNode.parentNode.parentNode;
var d = $find(i.id);
var j;
if (d != null) {
j = d.get_element().style.tableLayout;
d.get_element().style.tableLayout = "";
}
if (!g) {
if (this.get_element()) {
if (this.get_element().rows[f]) {
if (this.get_element().rows[f].cells[0]) {
this.get_element().rows[f].cells[0].style.height = e + "px";
this.get_element().rows[f].style.height = e + "px";
}
}
}
} else {
if (this.get_element()) {
if (this.get_element().tBodies[0]) {
if (this.get_element().tBodies[0].rows[f]) {
if (this.get_element().tBodies[0].rows[f].cells[0]) {
this.get_element().tBodies[0].rows[f].cells[0].style.height = e + "px";
this.get_element().tBodies[0].rows[f].style.height = e + "px";
}
}
}
}
}
this.get_element().style.tableLayout = b;
if (d != null) {
d.get_element().style.tableLayout = j;
}
if (c && c.id != "" && c.id.split("__").length == 2) {
var h = c.id.split("__")[1];
var k = this._resizedItemsData;
k.add(String.format("{0},{1}", this.get_id(), h), e);
this._owner._resizedItems = k.toString();
this._owner.raise_rowResized(new Telerik.Web.UI.GridDataItemEventArgs(c, null));
}
this._owner.updateClientState();
}, resizeColumn: function (k, q) {
var r = false;
var f = this._hasMultiHeaders;
if (($telerik.isIE7 || $telerik.isIE6) && !$telerik.quirksMode) {
var g = this.get_columns()[k].get_element();
var o = parseInt($telerik.getCurrentStyle(g, "borderLeftWidth", 0), 10) + parseInt($telerik.getCurrentStyle(g, "paddingLeft", 0), 10) + parseInt($telerik.getCurrentStyle(g, "paddingRight", 0), 10) + parseInt($telerik.getCurrentStyle(g, "borderRightWidth", 0), 10);
if (q > o) {
q -= o;
r = true;
}
}
if (!this._validateResizeColumnParams(k, q)) {
return;
}
if (typeof(k) == "string") {
k = parseInt(k);
}
var a = new Telerik.Web.UI.GridColumnCancelEventArgs(this.get_columns()[k], null);
this._owner.raise_columnResizing(a);
if (a.get_cancel()) {
return false;
}
var n = this.get_element().offsetWidth;
var m = this._owner.get_element().offsetWidth - parseInt($telerik.getCurrentStyle(this._owner.get_element(), "borderLeftWidth", 0)) - parseInt($telerik.getCurrentStyle(this._owner.get_element(), "borderRightWidth", 0));
if (this == this._owner.get_masterTableView() && this._owner.get_masterTableViewHeader()) {
this._owner.get_masterTableViewHeader().resizeColumn(k, q);
}
if (this.HeaderRow || this.MultiHeaderCells) {
var b = k;
var h = f ? this.MultiHeaderCells : this.HeaderRow.cells;
if ($telerik.isIE7 || $telerik.isIE6) {
var i = 0;
var p = 0;
for (var l = 0;
l < h.length;
l++) {
if (h[l].style.display == "none") {
i++;
} else {
p++;
if (p == k + 1) {
break;
}
}
}
b = parseInt(i + p) - 1;
}
var c = h[b].offsetWidth - q;
if (($telerik.isIE7 || $telerik.isIE6) && !$telerik.quirksMode && r) {
c -= o;
}
}
if (($telerik.isFirefox2 && this.get_element().style.tableLayout == "fixed")) {
if (this.HeaderRow || this.MultiHeaderCells) {
var h = f ? this.MultiHeaderCells : this.HeaderRow.cells;
if (h[k]) {
h[k].style.width = q + "px";
}
}
if (this._owner.get_masterTableViewHeader() && (this.get_id() == this._owner.get_masterTableViewHeader().get_id())) {
var d = this._owner.get_masterTableView().get_element().tBodies[0].rows[this._owner.ClientSettings.FirstDataRowClientRowIndex];
if (d) {
if (d.cells[k]) {
d.cells[k].style.width = q + "px";
}
}
if (this._owner.get_masterTableViewFooter() && this._owner.get_masterTableViewFooter().get_element()) {
if (this._owner.get_masterTableViewFooter().get_element().tBodies[0].rows[0] && this._owner.get_masterTableViewFooter().get_element().tBodies[0].rows[0].cells[k]) {
if (q > 0) {
this._owner.get_masterTableViewFooter().get_element().tBodies[0].rows[0].cells[k].style.width = q + "px";
}
}
}
}
}
if (this.ColGroup) {
if (this.ColGroup.Cols[k]) {
if (q > 0) {
this.ColGroup.Cols[k].style.width = q + "px";
}
}
}
if (this._owner.get_masterTableViewHeader() && (this.get_id() == this._owner.get_masterTableViewHeader().get_id())) {
if (this._owner.get_masterTableView().ColGroup) {
if (this._owner.get_masterTableView().ColGroup.Cols[k]) {
if (q > 0) {
this._owner.get_masterTableView().ColGroup.Cols[k].style.width = q + "px";
}
}
}
if (this._owner.get_masterTableViewFooter() && this._owner.get_masterTableViewFooter().ColGroup) {
if (this._owner.get_masterTableViewFooter().ColGroup.Cols[k]) {
if (q > 0) {
this._owner.get_masterTableViewFooter().ColGroup.Cols[k].style.width = q + "px";
}
}
}
}
if (q.toString().indexOf("px") != -1) {
q = q.replace("px", "");
}
if (q.toString().indexOf("%") == -1) {
q = q + "px";
}
this._resizedColumnsData.add(String.format("{0},{1}", this._data.UniqueID, this.get_columns()[k].get_uniqueName()), q);
if (this._owner.get_masterTableViewHeader()) {
this._owner.ClientSettings.Resizing.ResizeGridOnColumnResize = true;
}
if (this._owner.ClientSettings.Resizing.ResizeGridOnColumnResize) {
if (c != null) {
this._resizeGridOnColumnResize(k, c, n);
}
} else {
this._noResizeGridOnColumnResize(n, k, m);
}
this._owner._resizedColumns = this._resizedColumnsData.toString();
this._owner.updateClientState();
if (this._owner.GroupPanelObject && this._owner.GroupPanelObject.Items.length > 0 && navigator.userAgent.toLowerCase().indexOf("msie") != -1) {
if (this._owner.get_masterTableView() && this._owner.get_masterTableViewHeader()) {
this._owner.get_masterTableView().get_element().style.width = this._owner.get_masterTableViewHeader().get_element().offsetWidth + "px";
}
}
var a = new Telerik.Web.UI.GridColumnEventArgs(this.get_columns()[k], null);
this._owner.raise_columnResized(a);
if (window.netscape) {
this.get_element().style.cssText = this.get_element().style.cssText;
}
if ($get(this._owner.ClientID + "_Frozen") && c != null) {
var e = $get(this._owner.ClientID + "_FrozenScroll");
e.style.width = e.offsetWidth - c + "px";
}
}, _resizeGridOnColumnResize: function (m, f, o) {
var a;
var c;
var b;
if (this._owner.get_masterTableViewHeader() && (this.get_id() == this._owner.get_masterTableViewHeader().get_id())) {
this.get_element().style.width = (o - f) + "px";
this._owner.get_masterTableView().get_element().style.width = this.get_element().style.width;
for (var l = 0;
l < this.ColGroup.Cols.length;
l++) {
if (l != m && this.ColGroup.Cols[l].style.width == "") {
var e = l;
var h = this._hasMultiHeaders ? this.MultiHeaderCells : this.HeaderRow.cells;
if ($telerik.isIE7 || $telerik.isIE6) {
var k = 0;
var s = 0;
for (var n = 0;
n < h.length;
n++) {
if (h[n].style.display == "none") {
k++;
} else {
s++;
if (s == l + 1) {
break;
}
}
}
e = parseInt(k + s) - 1;
}
if (h[e].style.display != "none") {
var t = h[e].offsetWidth;
if (($telerik.isIE7 || $telerik.isIE6) && !$telerik.quirksMode) {
var g = h[e];
var p = parseInt($telerik.getCurrentStyle(g, "borderLeftWidth", 0), 10) + parseInt($telerik.getCurrentStyle(g, "paddingLeft", 0), 10) + parseInt($telerik.getCurrentStyle(g, "paddingRight", 0), 10) + parseInt($telerik.getCurrentStyle(g, "borderRightWidth", 0), 10);
if (t > p) {
t -= p;
}
}
this.ColGroup.Cols[l].style.width = t + "px";
this._owner.get_masterTableView().ColGroup.Cols[l].style.width = this.ColGroup.Cols[l].style.width;
if (this._owner.get_masterTableViewFooter() && this._owner.get_masterTableViewFooter().ColGroup) {
this._owner.get_masterTableViewFooter().ColGroup.Cols[l].style.width = this.ColGroup.Cols[l].style.width;
}
}
}
}
if (this._owner.get_masterTableViewFooter() && this._owner.get_masterTableViewFooter().get_element()) {
this._owner.get_masterTableViewFooter().get_element().style.width = this.get_element().style.width;
}
var d = this.get_element().offsetWidth;
var r = this._owner._gridDataDiv.offsetWidth;
a = d + "px";
c = r + "px";
b = this._owner.get_element().offsetHeight + "px";
} else {
if (this.get_element().offsetWidth <= this._owner.get_element().offsetWidth) {
if ((this.get_element().offsetWidth - f) > 0) {
this.get_element().style.width = (this.get_element().offsetWidth - f) + "px";
} else {
this.get_element().style.width = this.get_element().offsetWidth + "px";
}
} else {
this.get_element().style.width = this.get_element().offsetWidth + "px";
}
this._owner.get_element().style.width = this.get_element().style.width;
var d = this.get_element().offsetWidth;
a = d + "px";
c = this._owner.get_element().offsetWidth + "px";
b = this._owner.get_element().offsetHeight + "px";
}
var q = this._resizedControlData;
q.add(this._data.UniqueID, String.format("{0},{1},{2}", a, c, b));
this._owner._resizedControl = q.toString();
this._owner.updateClientState();
}, _noResizeGridOnColumnResize: function (e, c, d) {
var a = this._hasMultiHeaders ? this.MultiHeaderCells : this.HeaderRow.cells;
for (var b = c + 1;
b < this.ColGroup.Cols.length;
b++) {
a[b].style.width = "";
this.ColGroup.Cols[b].style.width = "";
if (this._owner.get_masterTableViewHeader() && this.get_id() == this._owner.get_masterTableViewHeader().get_id()) {
this._owner.get_masterTableView().ColGroup.Cols[b].style.width = "";
this._owner.get_masterTableViewHeader().get_element().cells[b].style.width = "";
}
if (this._owner.get_masterTableViewFooter()) {
this._owner.get_masterTableViewFooter().ColGroup.Cols[b].style.width = "";
this._owner.get_masterTableViewFooter().get_element().cells[b].style.width = "";
}
this._resizedColumnsData.add(String.format("{0},{1}", this._data.UniqueID, this.get_columns()[b].get_uniqueName()), "");
}
if (d > 0) {
this._owner.get_element().style.width = d + "px";
}
this.get_element().style.width = e + "px";
if (this._owner.get_masterTableViewHeader() && this.get_id() == this._owner.get_masterTableViewHeader().get_id()) {
this._owner.get_masterTableView().get_element().style.width = this.get_element().style.width;
}
if (this._owner.get_masterTableViewFooter()) {
this._owner.get_masterTableViewFooter().get_element().style.width = this.get_element().style.width;
}
}, _validateResizeColumnParams: function (a, c) {
if (isNaN(parseInt(a))) {
var b = 'Column index must be of type "Number"!';
alert(b);
return false;
}
if (isNaN(parseInt(c))) {
var b = 'Column width must be of type "Number"!';
alert(b);
return false;
}
if (a < 0) {
var b = "Column index must be non-negative!";
alert(b);
return false;
}
if (c < 0) {
var b = "Column width must be non-negative!";
alert(b);
return false;
}
if (a > (this.get_columns().length - 1)) {
var b = "Column index must be less than columns count!";
alert(b);
return false;
}
if (!this._owner.ClientSettings.Resizing.AllowColumnResize) {
return false;
}
if (!this.get_columns()) {
return false;
}
if (!this.get_columns()[a].get_resizable()) {
return false;
}
return true;
}, resizeColumnToFit: function (a) {
if (typeof(a) === "string") {
a = this.getColumnByUniqueName(a);
}
if (typeof(a) === "number") {
a = this.get_columns()[a];
}
if (typeof(a) === "object" && a.resizeToFit) {
a.resizeToFit();
}
}, get_allowPaging: function () {
return !!this._data.AllowPaging;
}, get_pageCount: function () {
return this.PageCount;
}, get_pageSize: function () {
return this.PageSize;
}, set_pageSize: function (b) {
var a = this.PageSize;
if (this.PageSize != b) {
this.PageSize = b;
this.set_currentPageIndex(0, true);
if (!this.fireCommand("PageSize", b) && this._preventUpdatePager) {
this.PageSize = a;
this._refreshPagerSlider();
this._refreshAdvancedPageTextBoxes();
this._refreshDropDownPager();
this._generateNumericPager();
this._preventUpdatePager = false;
} else {
this._updatePager();
}
}
}, get_virtualItemCount: function () {
return this._virtualItemCount;
}, set_virtualItemCount: function (a) {
if (this._virtualItemCount != a || a === 0) {
this._virtualItemCount = a;
if (a == 0 && (!this._dataSource || this._dataSource.length == 0)) {
this.set_currentPageIndex(0, true);
} else {
this.set_currentPageIndex(0, false);
}
this._updatePager();
this._initializeVirtualScrollPaging();
if (this._virtualization) {
this._virtualization.set_virtualItemCount(a);
}
}
}, set_pageButtonCount: function (a) {
this._pageButtonCount = a;
this._updatePager();
}, get_pageButtonCount: function () {
return this._pageButtonCount;
}, _initializeVirtualScrollPaging: function () {
var a = $find(this._owner.get_id());
if (a._scrolling) {
a._scrolling._initializeVirtualScrollPaging(true);
}
}, _updatePager: function () {
var a = Math.ceil(this.get_virtualItemCount() / this.get_pageSize());
this.PageCount = a;
var b = String.format("{0}PCN", this.get_id());
var c = String.format("{0}FIP", this.get_id());
var e = String.format("{0}DSC", this.get_id());
var d = String.format("{0}LIP", this.get_id());
var f = this._data.pageOfLabelClientID;
this._populatePagerStatsElements(b, c, d, e, f);
b = String.format("{0}PCNTop", this.get_id());
c = String.format("{0}FIPTop", this.get_id());
e = String.format("{0}DSCTop", this.get_id());
d = String.format("{0}LIPTop", this.get_id());
f = this._data.pageOfLabelTopClientID;
this._populatePagerStatsElements(b, c, d, e, f);
this._refreshPagerSlider();
this._refreshAdvancedPageTextBoxes();
this._refreshDropDownPager();
this._generateNumericPager();
this._setPagerVisibility(a > 1 || this._data.PagerAlwaysVisible);
}, _refreshPagerSlider: function () {
if (this._data.sliderClientID && this._data.sliderClientID != "") {
this._setSliderValue($find(this._data.sliderClientID), this.get_pageCount(), this._data.sliderLabelClientID);
}
if (this._data.sliderTopClientID && this._data.sliderTopClientID != "") {
this._setSliderValue($find(this._data.sliderTopClientID), this.get_pageCount(), this._data.sliderTopLabelClientID);
}
}, _refreshAdvancedPageTextBoxes: function () {
if (this._data.goToPageTextBoxClientID && this._data.goToPageTextBoxClientID != "") {
this._setTextBoxValue($find(this._data.goToPageTextBoxClientID), this.PageCount || 1);
}
if (this._data.goToPageTextBoxTopClientID && this._data.goToPageTextBoxTopClientID != "") {
this._setTextBoxValue($find(this._data.goToPageTextBoxTopClientID), this.PageCount || 1);
}
if (this._data.changePageSizeTextBoxClientID && this._data.changePageSizeTextBoxClientID != "") {
this._setTextBoxValue($find(this._data.changePageSizeTextBoxClientID), this.get_virtualItemCount() || 1, this.PageSize);
}
if (this._data.changePageSizeTextBoxTopClientID && this._data.changePageSizeTextBoxTopClientID != "") {
this._setTextBoxValue($find(this._data.changePageSizeTextBoxTopClientID), this.get_virtualItemCount() || 1, this.PageSize);
}
}, _refreshDropDownPager: function () {
if (this._data.changePageSizeComboBoxTopClientID && this._data.changePageSizeComboBoxTopClientID != "") {
this._setChangePageComboSelectedValue($find(this._data.changePageSizeComboBoxTopClientID), this.PageSize);
}
if (this._data.changePageSizeComboBoxClientID && this._data.changePageSizeComboBoxClientID != "") {
this._setChangePageComboSelectedValue($find(this._data.changePageSizeComboBoxClientID), this.PageSize);
}
}, _setChangePageComboSelectedValue: function (a, j) {
if (a != null) {
var e = a.findItemByValue(j);
if (e) {
a.trackChanges();
e.select();
a.commitChanges();
} else {
var f = a.get_items();
var d = f.get_count();
var h;
for (var c = 0, g = f.get_count();
c < g;
c++) {
if (f.getItem(c).get_value() > j) {
h = f.getItem(c).get_attributes().getAttribute("ownerTableViewId");
d = c;
break;
}
}
a.trackChanges();
var b;
if (a.get_id().indexOf("PageSizeCombo") > -1) {
b = new Telerik.Web.UI.RadComboBoxItem();
} else {
b = new Telerik.Web.UI.DropDownListItem();
}
b.set_text(j.toString());
b.set_value(j);
f.insert(d, b);
b.get_attributes().setAttribute("ownerTableViewId", h);
b.select();
a.commitChanges();
}
}
}, _setSliderValue: function (c, a, b) {
if (c != null) {
a = Math.max(a - 1, 0);
c.set_maximumValue(a);
this._applyPagerLabelText($get(b), 0, a + 1);
}
}, _setTextBoxValue: function (b, a, c) {
if (b != null) {
if (typeof(a) != "undefined") {
b.set_maxValue(a);
}
if (typeof(c) != "undefined") {
b.set_value(Math.min(c, a));
}
}
}, _populatePagerStatsElements: function (a, b, c, d, e) {
if ($get(a)) {
$get(a).innerHTML = this.PageCount;
}
if (e && e != "" && $get(e)) {
$get(e).innerHTML = String.format(" of {0}", this.PageCount || 1);
}
if ($get(b)) {
if (this.get_virtualItemCount() == 0) {
$get(b).innerHTML = 0;
} else {
$get(b).innerHTML = (this.get_currentPageIndex() + 1) * this.get_pageSize() - this.get_pageSize() + 1;
}
}
if ($get(d)) {
$get(d).innerHTML = this.get_virtualItemCount();
}
if ($get(c)) {
var g = this.get_virtualItemCount();
var f = (this.get_currentPageIndex() + 1) * this.get_pageSize();
if (f > g) {
f = g;
}
$get(c).innerHTML = f;
}
if ($get(c) && $get(d)) {
var h = parseInt($get(c).innerHTML);
var i = parseInt($get(d).innerHTML);
if (h > i) {
$get(c).innerHTML = i;
}
}
}, _generateNumericPager: function () {
this._populateNumericPagerDiv($get(String.format("{0}NPPHTop", this.get_id())));
this._populateNumericPagerDiv($get(String.format("{0}NPPH", this.get_id())));
}, _populateNumericPagerDiv: function (e) {
if (e) {
e.innerHTML = "";
var f = new Sys.StringBuilder();
var g = 1;
var a = this._pageButtonCount;
if (this.get_currentPageIndex() + 1 > a) {
g = (Math.floor(this.get_currentPageIndex() / a) * a) + 1;
}
var b = Math.min(this.PageCount, (g + a) - 1);
if (g > a) {
f.append('<a href="#"');
f.append(String.format(" onclick=\"Telerik.Web.UI.Grid.NavigateToPage('{0}',{1}); return false;\"", this.get_id(), Math.max(g - a, 0)));
f.append("><span>...</span></a>");
}
for (var c = g, d = b;
c <= d;
c++) {
if (c == (this.get_currentPageIndex() + 1)) {
f.append('<a href="#"');
f.append(' onclick="return false;" class="rgCurrentPage"');
f.append(String.format("><span>{0}</span></a>", c));
} else {
f.append('<a href="#"');
f.append(String.format(" onclick=\"Telerik.Web.UI.Grid.NavigateToPage('{0}',{1}); return false;\"", this.get_id(), c));
f.append(String.format("><span>{0}</span></a>", c));
}
}
if (b < this.PageCount) {
f.append('<a href="#"');
f.append(String.format(" onclick=\"Telerik.Web.UI.Grid.NavigateToPage('{0}',{1}); return false;\"", this.get_id(), b + 1));
f.append("><span>...</span></a>");
}
e.innerHTML = f.toString();
}
}, get_currentPageIndex: function () {
return this.CurrentPageIndex;
}, set_currentPageIndex: function (p, a) {
if (this.CurrentPageIndex != p) {
this.CurrentPageIndex = p;
var b = String.format("{0}CPI", this.get_id());
var d = String.format("{0}PCN", this.get_id());
var f = String.format("{0}FIP", this.get_id());
var h = String.format("{0}LIP", this.get_id());
var j = String.format("{0}DSC", this.get_id());
var c = String.format("{0}CPITop", this.get_id());
var e = String.format("{0}PCNTop", this.get_id());
var g = String.format("{0}FIPTop", this.get_id());
var i = String.format("{0}LIPTop", this.get_id());
var k = String.format("{0}DSCTop", this.get_id());
if ($get(b)) {
$get(b).innerHTML = p + 1;
}
if ($get(f)) {
$get(f).innerHTML = (p + 1) * this.get_pageSize() - this.get_pageSize() + 1;
}
var o = 0;
if ($get(j)) {
o = parseInt($get(j).innerHTML);
}
if ($get(h)) {
var l = (p + 1) * this.get_pageSize();
if (l > o) {
l = o;
}
$get(h).innerHTML = l;
}
if ($get(c)) {
$get(c).innerHTML = p + 1;
}
if ($get(g)) {
$get(g).innerHTML = (p + 1) * this.get_pageSize() - this.get_pageSize() + 1;
}
var o = 0;
if ($get(k)) {
o = parseInt($get(k).innerHTML);
}
if ($get(i)) {
var l = (p + 1) * this.get_pageSize();
if (l > o) {
l = o;
}
$get(i).innerHTML = l;
}
this._generateNumericPager();
if (this._data.sliderClientID && this._data.sliderClientID != "" && this._data.sliderTopClientID && this._data.sliderTopClientID != "") {
var m = $find(this._data.sliderClientID);
if (m) {
m.set_value(p);
}
m = $find(this._data.sliderTopClientID);
if (m) {
m.set_value(p);
}
}
if (this._data.goToPageTextBoxClientID && this._data.goToPageTextBoxClientID != "" && this._data.goToPageTextBoxTopClientID && this._data.goToPageTextBoxTopClientID != "") {
var n = $find(this._data.goToPageTextBoxClientID);
if (n != null) {
n.set_value(p + 1);
}
n = $find(this._data.goToPageTextBoxTopClientID);
if (n != null) {
n.set_value(p + 1);
}
}
if (!a) {
this.fireCommand("Page", p);
}
}
}, get_dataSource: function () {
return this._dataSource;
}, set_dataSource: function (a) {
if (this._dataSource != a) {
this._dataSource = a;
}
}, get_allowMultiColumnSorting: function () {
return this._data.AllowMultiColumnSorting;
}, set_allowMultiColumnSorting: function (a) {
if (this._data.AllowMultiColumnSorting != a) {
this._data.AllowMultiColumnSorting = a;
}
}, get_allowNaturalSort: function () {
return this._data.AllowNaturalSort;
}, set_allowNaturalSort: function (a) {
if (this._data.AllowNaturalSort != a) {
this._data.AllowNaturalSort = a;
}
}, _setPagerVisibility: function (j) {
var b = j ? "" : "none";
if (this.get_element().tFoot) {
var f = this.get_element().tFoot;
if (f.rows) {
for (var c = 0, d = f.rows.length;
c < d;
c++) {
if (f.rows[c].className.indexOf("rgPager") > -1) {
f.rows[c].style.display = b;
}
}
}
} else {
var a = $get(String.format("{0}_Pager", this.get_id()));
if (a) {
var e = a.rows || (a.tBodies && a.tBodies[0].rows);
if (e && e.length) {
for (var c = 0, d = e.length;
c < d;
c++) {
if (e[c].className.indexOf("rgPager") > -1) {
e[c].style.display = b;
}
}
}
}
}
var g = this.get_element().tHead;
if (g) {
for (var c = 0, d = g.rows.length;
c < d;
c++) {
if (g.rows[c].className.indexOf("rgPager") > -1) {
g.rows[c].style.display = b;
}
}
} else {
var h = $get(String.format("{0}_TopPager", this.get_id()));
if (h) {
var e = h.rows || (h.tBodies && h.tBodies[0].rows);
if (e && e.length) {
for (var c = 0, d = e.length;
c < d;
c++) {
if (e[c].className.indexOf("rgPager") > -1) {
e[c].style.display = b;
}
}
}
}
}
}, _fixRowsClassNames: function () {
var d = this.get_element().tBodies[0].rows, c = 0, b;
for (var a = 0;
a < d.length;
a++) {
b = d[a];
if ((b.className.indexOf("rgRow") !== -1 || b.className.indexOf("rgAltRow") !== -1) && b.style.display !== "none") {
if (c % 2 == 0 || this._owner.ClientSettings.EnableAlternatingItems == false) {
Sys.UI.DomElement.removeCssClass(b, "rgAltRow");
Sys.UI.DomElement.addCssClass(b, "rgRow");
} else {
Sys.UI.DomElement.removeCssClass(b, "rgRow");
Sys.UI.DomElement.addCssClass(b, "rgAltRow");
}
c++;
}
}
}, expandItem: function (b) {
b = this._getRowByIndexOrItemIndexHierarchical(b);
var a = this._getExpandButton(b);
this._ensureExpandCollapseButtons(a, false);
return this._expandRow(b);
}, _expandRow: function (l) {
if (!this._owner.ClientSettings.AllowExpandCollapse) {
return false;
}
var b = l;
var f = b.id.split("__")[1];
var h = 1;
if (!$find(b.id)) {
var m = $find(b.id.split("__")[0]);
if (m) {
m.get_dataItems();
}
}
var d = $find(b.id);
if (d && d.get_isInEditMode() && this._data.EditMode != "InPlace") {
h = 2;
}
var c = this._data.hasDetailItemTemplate ? 1 : 0;
var g = b.parentNode.rows[b.sectionRowIndex + h + c];
if (g && g.style.display == "none") {
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(b, null);
a.get_nestedViewItem = function () {
return g;
};
this._owner.raise_hierarchyExpanding(a);
if (a.get_cancel()) {
return false;
}
var e = $find(b.id);
if (e) {
e._expanded = true;
}
g.style.display = (window.netscape) ? "table-row" : "";
var a = new Telerik.Web.UI.GridDataItemEventArgs(b, null);
a.get_nestedViewItem = function () {
return g;
};
this._owner.raise_hierarchyExpanded(a);
Array.add(this._owner._expandedItems, f);
this._owner.updateClientState();
}
if (this.get_element().parentNode.parentNode.tagName.toLowerCase() == "tr") {
if (this.get_id() != this._owner._masterClientID) {
var k = this.get_element().parentNode.parentNode.parentNode.parentNode;
var j = $find(k.id);
var i = k.rows[this.get_element().parentNode.parentNode.rowIndex - 1];
if (i) {
j._expandRow(i);
}
}
}
return true;
}, collapseItem: function (b) {
b = this._getRowByIndexOrItemIndexHierarchical(b);
var a = this._getExpandButton(b);
this._ensureExpandCollapseButtons(a, true);
return this._collapseRow(b);
}, _performCollapseItem: function (c) {
c = this._getRowByIndexOrItemIndexHierarchical(c);
var b = 0;
if (this._data._columnsData && this._data._columnsData.length > 0 && this._data._columnsData[0].ColumnType == "GridGroupSplitterColumn") {
b = 1;
}
var a = c.cells[b].getElementsByTagName("input")[0];
if (a == undefined) {
a = c.cells[b].getElementsByTagName("img")[0];
}
this._ensureExpandCollapseButtons(a, true);
if (!$find(c.id)) {
var d = $find(c.id.split("__")[0]);
this._owner._ensureDataItemsCreated(d);
}
return this._collapseRow(c);
}, _collapseRow: function (j) {
if (!this._owner.ClientSettings.AllowExpandCollapse) {
return false;
}
var d = j;
var h = d.id.split("__")[1];
var f = 1;
if (this._owner._editIndexes.length > 0 && (this._hierarchyLoadMode == "Client" || this._hierarchyLoadMode == "Conditional") && this._data.EditMode != "InPlace") {
var c = this.get_dataItems(), b = $find(d.id);
if (b && b.get_isInEditMode()) {
f += 1;
}
}
var e = this._data.hasDetailItemTemplate ? 1 : 0;
var i = d.parentNode.rows[d.sectionRowIndex + f + e];
if (i && i.style.display != "none") {
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(d, null);
a.get_nestedViewItem = function () {
return i;
};
this._owner.raise_hierarchyCollapsing(a);
if (a.get_cancel()) {
return false;
}
var g = $find(d.id);
if (g) {
g._expanded = false;
}
i.style.display = "none";
var a = new Telerik.Web.UI.GridDataItemEventArgs(d, null);
a.get_nestedViewItem = function () {
return i;
};
this._owner.raise_hierarchyCollapsed(a);
Array.add(this._owner._expandedItems, h);
this._owner.updateClientState();
}
return true;
}, _ensureExpandCollapseButtons: function (b, c) {
if (!b) {
return;
}
if (c) {
if (b.title == this._owner._hierarchySettings.CollapseTooltip) {
b.title = this._owner._hierarchySettings.ExpandTooltip;
}
if (b.src) {
var a = this.get_columns()[b.parentNode.cellIndex];
if (a) {
b.src = a._data.ExpandImageUrl;
}
} else {
var a = this.get_columns()[b.parentNode.cellIndex];
if (a && b.className.indexOf("rgCollapse") !== -1) {
b.className = "rgExpand";
}
if (b.textContent && b.textContent == "-") {
b.textContent = "+";
}
}
if (this._owner.get_enableAriaSupport()) {
b.setAttribute("aria-expanded", "false");
b.parentNode.parentNode.setAttribute("aria-expanded", "false");
}
} else {
if (b.title == this._owner._hierarchySettings.ExpandTooltip) {
b.title = this._owner._hierarchySettings.CollapseTooltip;
}
if (b.src) {
var a = this.get_columns()[b.parentNode.cellIndex];
if (a) {
b.src = a._data.CollapseImageUrl;
}
} else {
var a = this.get_columns()[b.parentNode.cellIndex];
if (a && b.className.indexOf("rgExpand") !== -1) {
b.className = "rgCollapse";
}
if (b.textContent && b.textContent == "+") {
b.textContent = "-";
}
}
if (this._owner.get_enableAriaSupport()) {
b.setAttribute("aria-expanded", "true");
b.parentNode.parentNode.setAttribute("aria-expanded", "true");
}
}
}, _toggleExpand: function (i, d) {
if (!this._owner.ClientSettings.AllowExpandCollapse) {
return;
}
var b = i.parentNode.parentNode;
var g = 1;
if (this._owner._editIndexes.length > 0 && (this._hierarchyLoadMode == "Client" || this._hierarchyLoadMode == "Conditional") && this._data.EditMode != "InPlace") {
var a = this.get_dataItems();
if ($find(b.id).get_isInEditMode()) {
g += 1;
}
}
var c = this._data.hasDetailItemTemplate ? 1 : 0;
var h = b.parentNode.rows[b.sectionRowIndex + g + c];
var f = $find(this._owner.get_id());
if (h.style.display != "none") {
if (!this._collapseRow(b)) {
return false;
}
this._ensureExpandCollapseButtons(i, true);
} else {
if (!this._expandRow(b)) {
return false;
}
this._ensureExpandCollapseButtons(i, false);
}
if (f.ClientSettings.AllowKeyboardNavigation) {
f.get_element().focus();
}
if (f.ClientSettings.AllowKeyboardNavigation || f.get_allowMultiRowSelection()) {
f._getPositionedDataItems(true);
}
if (this._enableHierarchyExpandAll) {
this._toggleHierarchyExpandAllHeaderButtons();
}
}, _toggleExpandByRowElement: function (c, a) {
if (!this._owner.ClientSettings.AllowExpandCollapse) {
return;
}
var h = 1;
if (this._owner._editIndexes.length > 0 && (this._hierarchyLoadMode == "Client" || this._hierarchyLoadMode == "Conditional") && this._data.EditMode != "InPlace") {
var b = this.get_dataItems();
if ($find(c.id).get_isInEditMode()) {
h += 1;
}
}
var d = this._data.hasDetailItemTemplate ? 1 : 0;
var i = c.parentNode.rows[c.sectionRowIndex + h + d];
var g = $find(this._owner.get_id());
var f = 0;
if (this._data._columnsData && this._data._columnsData.length > 0 && this._data._columnsData[0].ColumnType == "GridGroupSplitterColumn") {
f = 1;
}
var e = c.cells[f].getElementsByTagName("input")[0];
if (e == undefined) {
e = c.cells[f].getElementsByTagName("img")[0];
}
if (a) {
if (!this._collapseRow(c)) {
return false;
}
this._ensureExpandCollapseButtons(e, true);
} else {
if (!this._expandRow(c)) {
return false;
}
this._ensureExpandCollapseButtons(e, false);
}
if (g.ClientSettings.AllowKeyboardNavigation) {
g.get_element().focus();
}
if (g.ClientSettings.AllowKeyboardNavigation || g.get_allowMultiRowSelection()) {
g._getPositionedDataItems(true);
}
}, _expandAll: function (b) {
var c = b ? b : window.event;
var k = c.srcElement ? c.srcElement : c.target;
c.returnValue = false;
c.cancelBubble = true;
if (c.preventDefault) {
c.preventDefault();
c.stopPropagation();
}
var a = k.className.indexOf("rgCollapse") > -1 ? true : false;
var g = this.get_element();
var m = ($telerik.isOpera) ? g : g.tBodies[0];
var j = m.rows;
for (var d = 0, f = j.length;
d < f;
d++) {
var h = j[d];
if (!h.id) {
continue;
} else {
this._toggleExpandByRowElement(h, a);
}
}
if (a) {
k.className = "rgExpand";
this._owner.get_hierarchyColsExpandedState()[this._data.UniqueID] = false;
} else {
k.className = "rgCollapse";
this._owner.get_hierarchyColsExpandedState()[this._data.UniqueID] = true;
}
this._owner.updateClientState();
}, _toggleHierarchyExpandAllHeaderButtons: function () {
var b = this.get_dataItems();
var a = this._getHierarchyColExpButtons();
var c = b[0].get_expanded();
var e = true;
for (var d = 0;
d < b.length;
d++) {
if (c != b[d].get_expanded()) {
e = false;
break;
}
}
if (e) {
for (var d = 0;
d < a.length;
d++) {
if (c) {
a[d].className = "rgCollapse";
} else {
a[d].className = "rgExpand";
}
}
this._owner.get_hierarchyColsExpandedState()[this._data.UniqueID] = c;
this._owner.updateClientState();
}
}, _toggleDisplayHierarchyExpandAllButtons: function () {
var b = this._isLastLevelGroupAllButtonOpen() ? "" : "none";
var a = this._getHeaderHierarchyExpandAllButtons();
for (var c = 0;
c < a.length;
c++) {
a[c].style.display = b;
}
}, _getHeaderHierarchyExpandAllButtons: function () {
var a = [];
var b = this.get_columns();
for (var e = 0;
e < b.length;
e++) {
var d = b[e].get_element();
if (d.className.indexOf("rgExpandCol") > -1) {
var c = d.getElementsByTagName("input")[0];
if (c) {
Array.add(a, c);
continue;
}
c = d.getElementsByTagName("img")[0];
if (c) {
Array.add(a, c);
}
}
}
return a;
}, _isLastLevelGroupAllButtonOpen: function () {
var c = false;
var a = this._getGroupColExpButtons();
var b = a[a.length - 1];
if (b.style.display != "none" && b.className == "rgCollapse") {
c = true;
}
return c;
}, _expandAllGroups: function (a, c) {
var b = a ? a : window.event;
var d = b.target || b.srcElement;
this._groupExpandAll(d, c);
this._toggleDisplayHierarchyExpandAllButtons();
}, _createFakeElement: function (c, a) {
var b = document.createElement(c);
b.className = a;
return b;
}, _getGroupColExpButtons: function () {
var a = [];
var b = this.get_columns();
for (var e = 0;
e < b.length;
e++) {
var d = b[e].get_element();
if (d.className.indexOf("rgGroupCol") > -1) {
var c = d.getElementsByTagName("input")[0];
if (c) {
Array.add(a, c);
continue;
}
c = d.getElementsByTagName("img")[0];
if (!c) {
c = this._createFakeElement("input", "rgExpand");
}
if (c) {
Array.add(a, c);
}
}
}
return a;
}, _getHierarchyColExpButtons: function () {
var a = [];
var b = this.get_columns();
for (var e = 0;
e < b.length;
e++) {
var d = b[e].get_element();
if (d.className.indexOf("rgExpandCol") > -1) {
var c = d.getElementsByTagName("input")[0];
Array.add(a, c);
}
}
return a;
}, _showGroupColExpButtonsOnCollapse: function (d, b) {
var a = this._getGroupColExpButtons();
for (var c = b + 1;
c < a.length;
c++) {
if (d.className.indexOf("rgCollapse") > -1 && d.style.display != "none") {
a[c].style.display = "";
}
d = a[c];
}
}, _hideGroupColExpButtonsOnCollapse: function (d, b) {
var a = this._getGroupColExpButtons();
for (var c = b + 1;
c < a.length;
c++) {
a[c].style.display = "none";
}
}, _updateGroupsColState: function (a, b) {
if (this._owner._groupColsState[this._data.UniqueID]) {
this._owner._groupColsState[this._data.UniqueID][b] = a;
} else {
this._owner._groupColsState[this._data.UniqueID] = new Array(this._data.GroupLevelsCount * 1);
this._owner._groupColsState[this._data.UniqueID][b] = a;
}
}, _groupExpandAll: function (k, c) {
if (!this._owner.ClientSettings.AllowExpandCollapse) {
return;
}
var f = this.get_element();
var m = ($telerik.isOpera) ? f : f.tBodies[0];
var j = m.rows;
for (var d = 0, e = j.length;
d < e;
d++) {
var h = j[d];
if (h.id || h.className.indexOf("rgGroupHeader") !== -1) {
var a = this._getGroupExpandButton(h);
if (a) {
var g = k;
var b = a.id.split("__")[2];
if (b == c) {
if (k.className.indexOf("rgCollapse") == 0) {
this._toggleGroupsExpandAll(a, {}, true);
this._hideGroupColExpButtonsOnCollapse(a, c);
this._updateGroupsColState(false, c);
} else {
this._toggleGroupsExpandAll(a, {}, false);
this._showGroupColExpButtonsOnCollapse(a, c);
this._updateGroupsColState(true, c);
}
}
}
}
}
if (k.className.indexOf("rgCollapse") == 0) {
k.className = "rgExpand";
} else {
k.className = "rgCollapse";
}
this._owner.updateClientState();
}, _toggleGroupsExpandAll: function (E, n, v, A) {
var G = false;
if (!A) {
G = true;
}
var o = E;
var w = typeof(A) === "undefined" ? false : true;
if (typeof(A) === "undefined") {
A = o;
}
if (!this._owner.ClientSettings.AllowGroupExpandCollapse) {
return;
}
var K = o.id.split("__")[0];
var J = $find(K);
var F = o.id.split("__")[1];
var s = o.id.split("__")[2];
var t = false;
if (!this._originalGroupLevel) {
this._originalGroupLevel = s;
}
if (parseInt(s, 10) < parseInt(this._originalGroupLevel) || G) {
this._originalGroupLevel = s;
}
var g = o.parentNode.cellIndex;
var D = o.parentNode.parentNode.sectionRowIndex;
var I = J.get_element().tBodies[0];
var k = this.get_columns()[g];
var a = new Sys.CancelEventArgs();
if (!w) {
if (v) {
this._owner.raise_groupCollapsing(a);
} else {
this._owner.raise_groupExpanding(a);
}
}
if (a.get_cancel()) {
return false;
}
if (o === A) {
if (k) {
if (o.src) {
if (!v && o.src !== k._data.CollapseImageUrl) {
t = true;
o.src = k._data.CollapseImageUrl;
o.title = J._owner._groupingSettings.CollapseTooltip;
if (this._owner.get_enableAriaSupport()) {
o.setAttribute("aria-expanded", "true");
o.parentNode.parentNode.setAttribute("aria-expanded", "true");
}
} else {
if (v && o.src !== k._data.ExpandImageUrl) {
t = true;
o.src = k._data.ExpandImageUrl;
o.title = J._owner._groupingSettings.ExpandTooltip;
if (this._owner.get_enableAriaSupport()) {
o.setAttribute("aria-expanded", "false");
o.parentNode.parentNode.setAttribute("aria-expanded", "false");
}
}
}
} else {
if (!v && o.className.indexOf("rgCollapse") === -1) {
t = true;
o.className = "rgCollapse";
o.title = J._owner._groupingSettings.CollapseTooltip;
if (this._owner.get_enableAriaSupport()) {
o.setAttribute("aria-expanded", "true");
o.parentNode.parentNode.setAttribute("aria-expanded", "true");
}
} else {
if (v && o.className.indexOf("rgExpand") === -1) {
t = true;
o.className = "rgExpand";
o.title = J._owner._groupingSettings.ExpandTooltip;
if (this._owner.get_enableAriaSupport()) {
o.setAttribute("aria-expanded", "false");
o.parentNode.parentNode.setAttribute("aria-expanded", "false");
}
}
}
}
}
}
var m = "none";
if (!v && o.offsetHeight !== 0 && this._isGroupButtonCollapse(o)) {
m = (window.netscape) ? "table-row" : "";
}
if (this._owner._groupingSettings.RetainGroupFootersVisibility && !n.groupLevel) {
n.groupLevel = s;
}
var z = s;
var c = false;
var l = parseInt(this._groupLevelsCount) - parseInt(this._originalGroupLevel, 10);
var H = parseInt(this._groupLevelsCount, 10) - parseInt(s, 10);
for (var u = D + 1;
u < I.rows.length;
u++) {
var C = I.rows[u];
var B = this._previousRow(I.rows[u]);
if (C.className.indexOf("rgRow") < 0 && C.className.indexOf("rgAltRow") < 0 && B && B.id) {
var q = this._getExpandButton(B);
if (q && !this._isGroupButtonCollapse(q) && C.className.indexOf("rgFooter") == -1) {
continue;
}
}
var f;
if (C.id || C.className.indexOf("rgGroupHeader") !== -1) {
f = this._getGroupExpandButton(C);
}
if (!f) {
if (z == s) {
if (l > 0) {
C.style.display = m;
}
if (C.className.indexOf("rgFooter") != -1) {
l--;
} else {
C.style.display = m;
}
}
if (m == "" || m == "table-row") {
if (C.className.indexOf("rgFooter") != -1) {
var d = 1;
if (this._owner._groupingSettings.RetainGroupFootersVisibility) {
d = 2;
}
if (H <= d) {
C.style.display = m;
}
H--;
}
}
} else {
z = f.id.split("__")[2];
if (z == s || (parseInt(z) < parseInt(s))) {
if (n.groupLevel && s == n.groupLevel && m == "none") {
var b = s - z + 1;
for (var x = 0;
x < b;
x++) {
var C = I.rows[u - x - 1];
if (!C.id) {
C.style.display = "";
}
}
}
break;
} else {
if (parseInt(z) - parseInt(s) == 1) {
if (f.src == o.src || (o.className == f.className)) {
if (f === A) {
if (m == "none") {
if (o.src) {
f.src = k._data.CollapseImageUrl;
} else {
f.className = "rgCollapse";
}
}
}
var h = false;
if (!v) {
if (!this._isGroupButtonCollapse(o)) {
h = true;
}
} else {
h = v;
}
C.style.display = m;
this._toggleGroupsExpand(f, n, o, h);
H = parseInt(this._groupLevelsCount, 10) - parseInt(s, 10);
}
C.style.display = m;
}
}
}
if (u == I.rows.length - 1) {
c = true;
}
}
if (n.groupLevel && c && n.groupLevel == s && m == "none") {
var b = s * 1 + 1;
for (var x = 0;
x < b;
x++) {
var C = I.rows[I.rows.length - x - 1];
if (!C.id) {
C.style.display = "";
}
}
}
if (o === A && t) {
var p = this._owner._expandedGroupItems, y = J._data.UniqueID + "!" + F, l = 0;
for (var u = 0;
u < p.length;
u++) {
if (p[u] == y) {
l++;
}
}
if (l === 2) {
Array.remove(p, y);
} else {
Array.add(p, y);
}
}
this._owner.updateClientState();
var a = new Sys.EventArgs();
if (!w) {
if (v) {
this._owner.raise_groupCollapsed(a);
} else {
this._owner.raise_groupExpanded(a);
}
}
var r = $find(this._owner.get_id());
r._getPositionedDataItems(true);
}, _previousRow: function (b) {
var a = b.previousSibling;
if (this._data.hasDetailItemTemplate && a.className && (a.className.indexOf("rgRow") != -1 || a.className.indexOf("rgAltRow") != -1)) {
a = b.previousSibling;
}
return a;
}, _previousDataItemElement: function (a) {
var b = this;
if (b._isDataItemElement(a)) {
return a;
}
while (!b._isDataItemElement(a) && a) {
a = a.previousSibling;
}
if (!b._isDataItemElement(a)) {
return null;
}
return a;
}, _isDataItemElement: function (a) {
return (a && (a.className && ((a.className.indexOf("rgRow") != -1 || a.className.indexOf("rgAltRow") != -1) && a.id.indexOf("__") != -1)));
}, _expandCollapseGroup: function (k, j, h) {
var e = {
expandChildren: false,
expandParents: true,
collapseChildren: false,
collapseParents: false,
toggleChildren: false,
toggleParents: false,
findClosestGroup: true
}, n = this, j = j || {}, m = k.parentNode.parentNode.rows, l, f, d, g = !h, b = h === true ? "rgExpand" : h === false ? "rgCollapse" : undefined;
for (var i in e) {
if (typeof j[i] === "undefined") {
j[i] = e[i];
}
}
if (j.findClosestGroup) {
l = k.rowIndex;
while (m[l] && !Sys.UI.DomElement.containsCssClass(m[l], "rgGroupHeader")) {
l--;
}
k = m[l];
if (!k) {
return;
}
}
f = n._getGroupExpandButton(k);
if (!f) {
f = $telerik.getElementByClassName(k, "rgGroupCol");
if (f) {
f = $telerik.getElementByClassName(f, "rgExpand");
}
}
if (!f) {
f = $telerik.getElementByClassName(k, "rgGroupCol");
if (f) {
f = $telerik.getElementByClassName(f, "rgCollapse");
}
}
if (f) {
if (!b || Sys.UI.DomElement.containsCssClass(f, b)) {
if (!b) {
b = f.className;
}
n._toggleGroupsExpand(f, {});
} else {
return false;
}
if ((j.expandParents && h && h !== undefined) || (j.collapseParents && g && h !== undefined) || j.toggleParents) {
d = $telerik.getElementsByClassName(k, "rgGroupCol").length - 1;
l = k.rowIndex - 1;
while (d > 0 && m[l]) {
if ($telerik.getElementsByClassName(m[l], "rgGroupCol").length === d) {
n._expandCollapseGroup(m[l], {expandParents: false, findClosestGroup: false}, h);
d--;
}
l--;
}
}
if ((j.expandChildren && h) || (j.collapseChildren && g) || j.toggleChildren) {
d = $telerik.getElementsByClassName(k, "rgGroupCol").length;
l = k.rowIndex + 1;
while (m[l]) {
if ($telerik.getElementsByClassName(m[l], "rgGroupCol").length === d) {
break;
}
n._expandCollapseGroup(m[l], {expandParents: false, findClosestGroup: false}, h);
l++;
}
}
if (this._data.GroupLoadMode === "Server") {
var c = "", a = f.id.split("__");
if (j.expandChildren || (j.toggleChildren && b === "rgExpand")) {
c = "expandChildren;" + a[1] + ";" + a[2];
}
this.fireCommand("GroupsCustomExpandCollapse", c);
}
return true;
}
return false;
}, toggleGroup: function (b, a) {
return this._expandCollapseGroup(b, a);
}, expandGroup: function (b, a) {
return this._expandCollapseGroup(b, a, true);
}, collapseGroup: function (b, a) {
return this._expandCollapseGroup(b, a, false);
}, _expandCollapseAllGroups: function (f, b) {
f = parseInt(f);
var g = isNaN(f) || f === 0;
var d = this._getGroupColExpButtons();
var c = g ? b === "rgExpand" ? "expandToLevel" : "collapseToLevel" : b === "rgExpand" ? "expandLevel" : "collapseLevel";
var a;
if (g) {
for (var e = 0;
e < d.length;
e++) {
a = d[e];
a.className = b;
this._groupExpandAll(a, e);
f = e;
}
} else {
a = d[f];
if (!a) {
return false;
}
a.className = b;
this._groupExpandAll(a, f);
}
if (this._data.GroupLoadMode === "Server") {
this.fireCommand("GroupsCustomExpandCollapse", String.format("{0};{1}", c, f));
}
return true;
}, expandAllGroups: function (a) {
return this._expandCollapseAllGroups(a, "rgExpand");
}, collapseAllGroups: function (a) {
return this._expandCollapseAllGroups(a, "rgCollapse");
}, _toggleGroupsExpand: function (F, n, B, w) {
var H = false;
if (!B) {
H = true;
}
var o = F;
var x = typeof(B) === "undefined" ? false : true;
if (typeof(B) === "undefined") {
B = o;
}
if (!this._owner.ClientSettings.AllowGroupExpandCollapse) {
return;
}
var L = o.id.split("__")[0];
var K = $find(L);
var G = o.id.split("__")[1];
var s = o.id.split("__")[2];
var t = false;
if (!this._originalGroupLevel) {
this._originalGroupLevel = s;
}
if (parseInt(s, 10) < parseInt(this._originalGroupLevel) || H) {
this._originalGroupLevel = s;
}
var g = o.parentNode.cellIndex;
var E = o.parentNode.parentNode.sectionRowIndex;
var J = K.get_element().tBodies[0];
var k = this.get_columns()[g];
var a = new Sys.CancelEventArgs();
var v = false;
if (this._isGroupButtonCollapse(o)) {
v = true;
}
if (typeof(w) !== "undefined") {
v = w;
}
if (!x) {
if (v) {
this._owner.raise_groupCollapsing(a);
} else {
this._owner.raise_groupExpanding(a);
}
}
if (a.get_cancel()) {
return false;
}
if (o === B) {
if (k) {
if (o.src) {
if (!v && o.src !== k._data.CollapseImageUrl) {
t = true;
o.src = k._data.CollapseImageUrl;
o.title = K._owner._groupingSettings.CollapseTooltip;
if (this._owner.get_enableAriaSupport()) {
o.setAttribute("aria-expanded", "true");
o.parentNode.parentNode.setAttribute("aria-expanded", "true");
}
} else {
if (v && o.src !== k._data.ExpandImageUrl) {
t = true;
o.src = k._data.ExpandImageUrl;
o.title = K._owner._groupingSettings.ExpandTooltip;
if (this._owner.get_enableAriaSupport()) {
o.setAttribute("aria-expanded", "false");
o.parentNode.parentNode.setAttribute("aria-expanded", "false");
}
}
}
} else {
if (!v && o.className.indexOf("rgCollapse") === -1) {
t = true;
o.className = "rgCollapse";
o.title = K._owner._groupingSettings.CollapseTooltip;
if (this._owner.get_enableAriaSupport()) {
o.setAttribute("aria-expanded", "true");
o.parentNode.parentNode.setAttribute("aria-expanded", "true");
}
} else {
if (v && o.className.indexOf("rgExpand") === -1) {
t = true;
o.className = "rgExpand";
o.title = K._owner._groupingSettings.ExpandTooltip;
if (this._owner.get_enableAriaSupport()) {
o.setAttribute("aria-expanded", "false");
o.parentNode.parentNode.setAttribute("aria-expanded", "false");
}
}
}
}
}
}
var m = "none";
if (!v && o.offsetHeight !== 0 && this._isGroupButtonCollapse(o)) {
m = (window.netscape) ? "table-row" : "";
}
if (this._owner._groupingSettings.RetainGroupFootersVisibility && !n.groupLevel) {
n.groupLevel = s;
}
var A = s;
var c = false;
var l = parseInt(this._groupLevelsCount) - parseInt(this._originalGroupLevel, 10);
var I = parseInt(this._groupLevelsCount, 10) - parseInt(s, 10);
for (var u = E + 1;
u < J.rows.length;
u++) {
var D = J.rows[u];
var C = this._previousRow(J.rows[u]);
if (D.className.indexOf("rgRow") < 0 && D.className.indexOf("rgAltRow") < 0 && C && C.id) {
var q = this._getExpandButton(C);
if (q && !this._isGroupButtonCollapse(q) && D.className.indexOf("rgFooter") == -1) {
continue;
}
}
var f;
if (D.id || D.className.indexOf("rgGroupHeader") !== -1) {
f = this._getGroupExpandButton(D);
}
if (!f) {
if (A == s) {
if (l > 0) {
D.style.display = m;
}
if (D.className.indexOf("rgFooter") != -1) {
l--;
} else {
D.style.display = m;
}
}
if (m == "" || m == "table-row") {
if (D.className.indexOf("rgFooter") != -1) {
var d = 1;
if (this._owner._groupingSettings.RetainGroupFootersVisibility) {
d = 2;
}
if (I <= d) {
D.style.display = m;
}
I--;
}
}
} else {
A = f.id.split("__")[2];
if (A == s || (parseInt(A) < parseInt(s))) {
if (n.groupLevel && s == n.groupLevel && m == "none") {
var b = s - A + 1;
for (var y = 0;
y < b;
y++) {
var D = J.rows[u - y - 1];
if (!D.id) {
D.style.display = "";
}
}
}
break;
} else {
if (parseInt(A) - parseInt(s) == 1) {
if (f.src == o.src || (o.className == f.className)) {
if (f === B) {
if (m == "none") {
if (o.src) {
f.src = k._data.CollapseImageUrl;
} else {
f.className = "rgCollapse";
}
}
}
var h = false;
if (!v) {
if (!this._isGroupButtonCollapse(o)) {
h = true;
}
} else {
h = v;
}
D.style.display = m;
this._toggleGroupsExpand(f, n, o, h);
I = parseInt(this._groupLevelsCount, 10) - parseInt(s, 10);
}
D.style.display = m;
}
}
}
if (u == J.rows.length - 1) {
c = true;
}
}
if (n.groupLevel && c && n.groupLevel == s && m == "none") {
var b = s * 1 + 1;
for (var y = 0;
y < b;
y++) {
var D = J.rows[J.rows.length - y - 1];
if (!D.id) {
D.style.display = "";
}
}
}
if (o === B && t) {
var p = this._owner._expandedGroupItems, z = K._data.UniqueID + "!" + G + "!" + s;
l = 0;
for (var u = 0;
u < p.length;
u++) {
if (p[u] == z) {
l++;
}
}
if (l === 2) {
Array.remove(p, z);
if (this._enableGroupsExpandAll) {
this._toggleGroupsExpandAllButton(s * 1);
}
} else {
Array.add(p, z);
if (this._enableGroupsExpandAll) {
this._toggleGroupsExpandAllButton(s * 1);
}
}
}
this._owner.updateClientState();
var a = new Sys.EventArgs();
if (!x) {
if (v) {
this._owner.raise_groupCollapsed(a);
} else {
this._owner.raise_groupExpanded(a);
}
}
var r = $find(this._owner.get_id());
r._getPositionedDataItems(true);
}, _arrayContains: function (b, d) {
var c = b.length;
while (c--) {
if (b[c] === d) {
return true;
}
}
return false;
}, _toggleGroupsExpandAllButton: function (c) {
var b = this._owner._expandedGroupItems;
var k = false;
var d = this._getGroupColExpButtons()[c];
var f = d.className == "rgCollapse";
var g = this._groupHeadersCount[c];
var h = g;
var j = [];
for (var e = 0;
e < b.length;
e++) {
var a = b[e].split("!")[2];
if (a == c) {
if (this._arrayContains(j, b[e])) {
h--;
}
Array.add(j, b[e]);
}
}
if (h == 0 && this._exapndedGroupItemsTemp[c] != j.length && (j.length == g || j.length == g * 2)) {
this._exapndedGroupItemsTemp[c] = j.length;
if (!f) {
d.className = "rgCollapse";
this._showGroupColExpButtonsOnCollapse(d, c * 1);
this._updateGroupsColState(true, c);
this._toggleDisplayHierarchyExpandAllButtons();
} else {
d.className = "rgExpand";
this._hideGroupColExpButtonsOnCollapse(d, c * 1);
this._updateGroupsColState(false, c);
this._toggleDisplayHierarchyExpandAllButtons();
}
}
}, _isGroupButtonCollapse: function (a) {
var b = a.parentNode.cellIndex;
var e = a.parentNode.parentNode.sectionRowIndex;
var d = this.get_columns()[b];
var c = d._data.CollapseImageUrl;
if ((a.className && a.className.indexOf("rgCollapse") !== -1) || (a.src && a.src.indexOf(c) !== -1)) {
return true;
}
return false;
}, _getGroupExpandButton: function (b) {
var a = this._findButtonByClickScript(b, "_toggleGroupsExpand");
if (!a && b.className.indexOf("rgGroupHeader") != -1) {
return $telerik.getElementByClassName(b, "rgCollapse") || $telerik.getElementByClassName(b, "rgExpand");
}
return a;
}, _getExpandButton: function (a) {
return this._findButtonByClickScript(a, "_toggleExpand");
}, _findButtonByClickScript: function (b, j) {
var a = null;
var d = b.getElementsByTagName("img");
for (var c = 0, h = d.length;
c < h;
c++) {
var e = d[c];
if (e.onclick != null && e.onclick.toString().indexOf(j) != -1) {
a = e;
break;
}
}
var g = b.getElementsByTagName("input");
for (var c = 0, h = g.length;
c < h;
c++) {
var f = g[c];
if (f.onclick != null && f.onclick.toString().indexOf(j) != -1) {
a = f;
break;
}
}
return a;
}, editItem: function (b) {
b = this._getRowByIndexOrItemIndexHierarchical(b);
var a = b.id.split("__")[1];
if (!this.fireCommand("Edit", a)) {
return false;
}
}, updateItem: function (b) {
b = this._getRowByIndexOrItemIndexHierarchical(b);
var a = b.id.split("__")[1];
if (!this.fireCommand("Update", a)) {
return false;
}
}, deleteItem: function (b) {
b = this._getRowByIndexOrItemIndexHierarchical(b);
var a = b.id.split("__")[1];
if (!this.fireCommand("Delete", a)) {
return false;
}
}, rebind: function () {
this._forceRebind = true;
if (!this.fireCommand("RebindGrid", "")) {
return false;
}
}, insertItem: function () {
if (!this.fireCommand("PerformInsert", "")) {
return false;
}
}, showInsertItem: function () {
if (!this.fireCommand("InitInsert", "")) {
return false;
}
}, cancelInsert: function () {
if (!this.fireCommand("CancelInsert", "")) {
return false;
}
}, sort: function (b) {
var f = new Telerik.Web.UI.GridSortExpression();
var c = b.split(" ")[0];
var g = Telerik.Web.UI.GridSortOrder.Ascending;
var a = -1;
var d = this._sortExpressions.find(c);
if (d != null) {
a = d.get_sortOrder();
}
if (b.toUpperCase().indexOf(" ASC") != -1) {
g = Telerik.Web.UI.GridSortOrder.Ascending;
} else {
if (b.toUpperCase().indexOf(" DESC") != -1) {
g = Telerik.Web.UI.GridSortOrder.Descending;
} else {
if (d != null) {
if (a == Telerik.Web.UI.GridSortOrder.None) {
g = Telerik.Web.UI.GridSortOrder.Ascending;
} else {
if (a == Telerik.Web.UI.GridSortOrder.Ascending) {
g = Telerik.Web.UI.GridSortOrder.Descending;
} else {
if (this.get_allowNaturalSort()) {
g = Telerik.Web.UI.GridSortOrder.None;
} else {
g = Telerik.Web.UI.GridSortOrder.Ascending;
}
}
}
} else {
g = Telerik.Web.UI.GridSortOrder.Ascending;
}
}
}
if (d != null) {
this._sortExpressions.remove(d);
}
if (!this.get_allowMultiColumnSorting()) {
for (var e = 0;
e < this._sortExpressions._array.length;
e++) {
this._showSortIconForField(this._sortExpressions._array[e].get_fieldName(), Telerik.Web.UI.GridSortOrder.None);
}
this._sortExpressions.clear();
}
if (g != a) {
this._showSortIconForField(c, g);
}
if (g != Telerik.Web.UI.GridSortOrder.None) {
f.set_fieldName(c);
f.set_sortOrder(g);
this._sortExpressions.add(f);
}
if (!this.fireCommand("Sort", b)) {
return false;
}
}, _showSortIconForField: function (f, g) {
if (!f || f == "") {
return;
}
if (typeof g == "undefined") {
return;
}
var b = g == Telerik.Web.UI.GridSortOrder.Ascending ? "" : "none";
var e = g == Telerik.Web.UI.GridSortOrder.Descending ? "" : "none";
var d = this.get_columns();
for (var c = 0;
c < d.length;
c++) {
if (d[c]._data.SortExpression == f) {
var a = $telerik.getChildrenByClassName(d[c].get_element(), "rgSort");
if (a && a.length > 1) {
a[0].style.display = b;
a[1].style.display = e;
}
}
}
}, clearSort: function (b) {
if (!b) {
var a = this.get_sortExpressions();
for (var c = 0;
c < a.get_count();
c++) {
this._showSortIconForField(a.getItem(c).get_fieldName(), Telerik.Web.UI.GridSortOrder.None);
}
this.get_sortExpressions().clear();
return this.fireCommand("ClearSort", "");
}
var d = this.get_sortExpressions().find(b);
if (d) {
this._showSortIconForField(b, Telerik.Web.UI.GridSortOrder.None);
this.get_sortExpressions().remove(d);
}
return this.fireCommand("ClearSort", b);
}, get_sortExpressions: function () {
return this._sortExpressions;
}, filter: function (b, m, g, l, j) {
var f = new Telerik.Web.UI.GridFilterExpression(), e = "rgFiltered", d = $telerik.getElementByClassName(this._getFilterCellByColumnUniqueName(b), "rgFilter");
var a = this.getColumnByUniqueName(b);
if (!a) {
return;
}
this._owner._resetCheckListFilterOfColumn(a);
var i = false;
if (typeof(g) == "undefined") {
g = a.get_filterFunction();
i = true;
} else {
if (typeof(g) == "string") {
a.set_filterFunction(g);
}
}
if (((typeof(g) == "number" && Telerik.Web.UI.GridFilterFunction.NoFilter == g) || (typeof(g) == "string" && Telerik.Web.UI.GridFilterFunction.parse(g) == Telerik.Web.UI.GridFilterFunction.NoFilter)) && (a.get_filterDelay() != null || (m != null && m !== "" && i))) {
if (a._data.Acff && a._data.Acff != "NoFilter") {
g = a._data.Acff;
} else {
g = (a.get_dataType() == "System.String") ? "Contains" : "EqualTo";
}
if (a._data.EnableRangeFiltering) {
g = "Between";
}
}
if (d) {
if (g === "NoFilter" || m === "") {
Sys.UI.DomElement.removeCssClass(d, e);
} else {
if (d.className.indexOf(e) < 0) {
Sys.UI.DomElement.addCssClass(d, e);
}
}
}
var c = "";
switch (a._data.ColumnType) {
case"GridHyperLinkColumn":
c = a._data.DataTextField;
break;
case"GridImageColumn":
c = a._data.DataAlternateTextField;
break;
case"GridBinaryImageColumn":
c = a._data.DataAlternateTextField;
break;
case"GridCalculatedColumn":
c = String.format("{0}Result", a._data.UniqueName);
break;
case"GridAttachmentColumn":
c = a._data.DataTextField + "" != "" ? a._data.DataTextField : a._data.FileNameTextField;
break;
default:
c = a._data.DataField;
break;
}
if (l) {
this._updateFilterControlValue(m, b, g);
}
f.set_fieldName(c);
f.set_columnUniqueName(b);
f.set_dataTypeName(a._data.DataTypeName);
if (m && m.replace) {
m = m.replace(/'/g, "\\'");
}
var h = this._filterExpressions.find(f.get_columnUniqueName());
if (h != null && !j) {
if (Telerik.Web.UI.GridFilterFunction.parse(g) == Telerik.Web.UI.GridFilterFunction.NoFilter) {
this._filterExpressions.remove(h);
}
h.set_filterFunction(g);
h.set_fieldValue(m);
} else {
f.set_filterFunction(g);
f.set_fieldValue(m);
this._filterExpressions.add(f);
}
this.set_currentPageIndex(0, true);
if (m && m.indexOf && m.replace) {
if (m.indexOf(";") != -1) {
m = m.replace(/;/g, "^#");
}
if (m.indexOf("\\") != -1) {
m = m.replace(/\\/g, "\\\\");
}
}
if (!j) {
if (!this.fireCommand("Filter", b + "|?" + m + "|?" + g)) {
var k = ("NoFilter" == g);
if (k && a._data.ColumnType == "GridDateTimeColumn") {
this._updateFilterControlValue(m, b, g);
}
return false;
}
}
}, _updateFilterControlValue: function (i, b, f) {
var h = Array.contains(["NoFilter", "IsNull", "NotIsNull", "IsEmpty", "NotIsEmpty"], f);
var e = this._getFilterCellByColumnUniqueName(b);
var g = e.getElementsByTagName("input")[0];
if (!g) {
return;
}
var a = this.getColumnByUniqueName(b);
if (typeof i == "object" && i === null) {
i = "";
}
if (a && a._data.ColumnType == "GridDateTimeColumn") {
var d = $find(g.id);
if (d && (Object.getType(d).getName() == "Telerik.Web.UI.RadDateTimePicker" || Object.getType(d).getName() == "Telerik.Web.UI.RadDatePicker")) {
if (h) {
d.get_dateInput().clear();
} else {
if (typeof i == "string") {
d.set_selectedDate(new Date(i));
} else {
d.set_selectedDate(i);
}
}
} else {
if (!d) {
d = $find(g.id.replace("_text", ""));
if (d && Object.getType(d).getName() == "Telerik.Web.UI.RadDateInput") {
if (h) {
d.clear();
} else {
if (typeof i == "string") {
d.set_selectedDate(new Date(i));
} else {
d.set_selectedDate(i);
}
}
}
}
}
} else {
if (a && a._data.ColumnType == "GridNumericColumn") {
var c = $find(g.id.replace("_text", ""));
if (c && Object.getType(c).getName() == "Telerik.Web.UI.RadNumericTextBox") {
if (h) {
c.clear();
} else {
c.set_value(i);
}
}
} else {
if (g.type && g.type == "checkbox") {
g.checked = (h) ? false : !!i;
} else {
if (g.type && g.type == "text") {
g.value = (h) ? "" : i;
}
}
}
}
}, _getFilterControlValue: function (a) {
var d = this._getFilterControlValueByIndex(a, 0);
if (this.getColumnByUniqueName(a)._data.EnableRangeFiltering) {
var c = this._getFilterCellByColumnUniqueName(a);
var b;
var e = $telerik.findControl(c, String.format("RDIPF2{0}", a));
if (e) {
b = e.get_dateInput();
} else {
b = $telerik.findControl(c, String.format("RDIF2{0}", a));
}
var f = b.get_value();
if (d == null || d == "" || f == null || f == "") {
return null;
}
d = d.replace(/\s/g, ",");
f = f.replace(/\s/g, ",");
d += " " + f;
}
return d;
}, _getFilterControlValueByIndex: function (a, e, f) {
var c = this._getFilterCellByColumnUniqueName(a);
var d = c.getElementsByTagName("input")[e];
if (!d) {
return null;
}
if (d.type == "checkbox") {
return d.checked;
}
var b = d.id.endsWith("_text") ? $find(d.id.substr(0, d.id.length - 5)) : d.id.endsWith("_ClientState") ? $find(d.id.substr(0, d.id.length - 12)) : d.id.endsWith("_Input") ? $find(d.id.substr(0, d.id.length - 6)) : $find(d.id);
if (b) {
switch (Object.getType(b).getName()) {
case"Telerik.Web.UI.RadAutoCompleteBox":
return b.get_text();
case"Telerik.Web.UI.RadDatePicker":
case"Telerik.Web.UI.RadDateTimePicker":
case"Telerik.Web.UI.RadTimePicker":
return b.get_dateInput().get_value();
default:
if (typeof(b.get_value) === "function") {
return b.get_value();
}
}
}
if (f && !b) {
return null;
}
return d.value;
}, _rangeValidationHandler: function (i, e, b) {
if (this._rangeValidationInProcess) {
return;
}
this._rangeValidationInProcess = true;
var f = this._getFilterCellByColumnUniqueName(b);
var d = $telerik.findControl(f, String.format("RDIPF{0}", b));
var c;
var g;
if (d) {
c = d.get_dateInput();
var h = $telerik.findControl(f, String.format("RDIPF2{0}", b));
g = h.get_dateInput();
} else {
c = $telerik.findControl(f, String.format("RDIF{0}", b));
g = $telerik.findControl(f, String.format("RDIF2{0}", b));
}
if (Telerik.Web.UI.DatePickerPopupOpeningEventArgs.isInstanceOfType(e)) {
this._setControlsRangeValidation(i, d, h);
} else {
if (Telerik.Web.UI.DatePickerPopupClosingEventArgs.isInstanceOfType(e)) {
this._clearControlsRangeValidation(d, h);
} else {
if (Telerik.Web.UI.InputValueChangingEventArgs.isInstanceOfType(e)) {
var a = true;
if (d.get_dateInput && i.get_id() === d.get_dateInput().get_id()) {
if (!e.get_newValue() || !g.get_selectedDate()) {
a = false;
}
} else {
if (!d.get_selectedDate() || !e.get_newValue()) {
a = false;
}
}
this._shouldAutoPostBackOnFilter = a;
this._setControlsRangeValidation(i, c, g);
} else {
if (Telerik.Web.UI.DateInputValueChangedEventArgs.isInstanceOfType(e)) {
this._clearControlsRangeValidation(c, g);
}
}
}
}
this._rangeValidationInProcess = false;
}, _getFilterCellByColumnUniqueName: function (a) {
var b = this._getTableFilterRow();
if (!b) {
return null;
}
var c = this._getCellIndexByColumnUniqueNameFromTableRowElement(b, a);
if (c == null) {
return null;
}
return b.cells[c];
}, _setControlsRangeValidation: function (e, a, c) {
this._clearControlsRangeValidation(a, c);
if (e.get_id() === a.get_id()) {
var d = c.get_selectedDate();
if (d) {
e.set_maxDate(c.get_selectedDate());
} else {
if (c.set_value) {
c.set_value(c.get_textBoxValue());
}
}
} else {
if (e.get_id() === c.get_id()) {
var b = a.get_selectedDate();
if (b) {
c.set_minDate(b);
} else {
if (a.set_value) {
a.set_value(a.get_textBoxValue());
}
}
}
}
}, _clearControlsRangeValidation: function (a, d) {
var c = new Date(1900, 1, 1);
var b = new Date(2099, 12, 31);
a.set_maxDate(b);
d.set_minDate(c);
}, clearSelectedColumns: function () {
var a = this.get_columns();
for (var b = 0;
b < a.length;
b++) {
if (a[b].get_selected()) {
a[b].set_selected(false);
}
}
}, clearFilter: function (b) {
if (!b) {
for (var e = 0;
e < this._filterExpressions.get_count();
e++) {
var c = this._filterExpressions.getItem(e);
this._updateFilterControlValue(null, c.get_columnUniqueName(), Telerik.Web.UI.GridFilterFunction.NoFilter);
var a = this.getColumnByUniqueName(c.get_columnUniqueName());
if (a) {
a.set_filterFunction("NoFilter");
}
}
this._filterExpressions.clear();
return this.fireCommand("ClearFilter", "");
}
var a = this.getColumnByUniqueName(b);
if (!a) {
return false;
}
var d = this._filterExpressions.find(b);
if (!d) {
d = new Telerik.Web.UI.GridFilterExpression();
d.set_columnUniqueName(b);
d.set_filterFunction("NoFilter");
this._filterExpressions.add(d);
}
return this.filter(b, "", "NoFilter", true);
}, get_filterExpressions: function () {
return this._filterExpressions;
}, page: function (a) {
var c = this.get_currentPageIndex();
var b = c;
if (a == "Next") {
b++;
} else {
if (a == "Prev") {
b--;
} else {
if (a == "First") {
b = 0;
} else {
if (a == "Last") {
b = this.get_pageCount() - 1;
} else {
b = parseInt(a) - 1;
}
}
}
}
if (b < 0 || b > (this.get_pageCount() - 1)) {
return false;
}
this.set_currentPageIndex(b, true);
if (!this.fireCommand("Page", a)) {
if (this._preventUpdatePager) {
this.set_currentPageIndex(c, true);
this._preventUpdatePager = false;
}
return false;
}
}, exportToExcel: function () {
if (!this.fireCommand("ExportToExcel", "")) {
return false;
}
}, exportToWord: function () {
if (!this.fireCommand("ExportToWord", "")) {
return false;
}
}, exportToCsv: function () {
if (!this.fireCommand("ExportToCsv", "")) {
return false;
}
}, exportToPdf: function () {
if (!this.fireCommand("ExportToPdf", "")) {
return false;
}
}, editSelectedItems: function () {
if (!this.fireCommand("EditSelected", "")) {
return false;
}
}, updateEditedItems: function () {
if (!this.fireCommand("UpdateEdited", "")) {
return false;
}
}, deleteSelectedItems: function () {
if (!this.fireCommand("DeleteSelected", "")) {
return false;
}
}, editAllItems: function () {
if (!this.fireCommand("EditAll", "")) {
return false;
}
}, cancelAll: function () {
if (!this.fireCommand("CancelAll", "")) {
return false;
}
}, cancelUpdate: function (b) {
b = this._getRowByIndexOrItemIndexHierarchical(b);
var a = b.id.split("__")[1];
if (!this.fireCommand("CancelUpdate", a)) {
return false;
}
}, groupColumn: function (a) {
if (!this.fireCommand("GroupByColumn", a)) {
return false;
}
}, ungroupColumn: function (a) {
if (!this.fireCommand("UnGroupByColumn", a)) {
return false;
}
}, _ungroupByExpression: function (a) {
if (!this.fireCommand("UnGroupByExpression", a)) {
return false;
}
}, _deleteRow: function (d, c) {
var g = d.parentNode.parentNode, b = $find(d.id), e = d.rowIndex, a = d.cells.length, f;
g.deleteRow(e);
f = g.rows[e];
while (f && f.style.display !== "none" && f.cells.length !== a && !Sys.UI.DomElement.containsCssClass(f, "rgGroupHeader")) {
g.deleteRow(e);
e++;
f = g.rows[e];
}
if (g.tBodies[0].rows.length === 1 && g.tBodies[0].rows[0].style.display == "none") {
g.tBodies[0].rows[0].style.display = "";
}
this.deselectItem(d);
Array.add(this._owner._deletedItems, c);
if (b) {
b.dispose();
Array.remove(this._dataItems, b);
}
this._fixRowsClassNames();
}, _clientDelete: function (c) {
var b = Telerik.Web.UI.Grid.GetCurrentElement(c), f = b.parentNode.parentNode, d = f.id.split("__")[1], a = new Telerik.Web.UI.GridDataItemCancelEventArgs(f, c);
this._owner.raise_rowDeleting(a);
if (a.get_cancel()) {
return false;
}
if (this._owner.get_events().getHandler("command") != null) {
this.fireCommand("Delete", d);
}
this._deleteRow(f, d);
this._owner.raise_rowDeleted(new Telerik.Web.UI.GridDataItemEventArgs(f, c));
this._owner.updateClientState();
}, fireCommand: function (b, a) {
if (this._raiseCommandEvent(b, a)) {
this._executePostBackEvent("FireCommand:" + this._data.UniqueID + ";" + b + ";" + a);
}
}, _raiseCommandEvent: function (c, b) {
var a = new Sys.CancelEventArgs();
a.get_commandName = function () {
return c;
};
a.get_commandArgument = function () {
return b;
};
var d = this;
a.get_tableView = function () {
return d;
};
this._owner.raise_command(a);
if (a.get_cancel()) {
return false;
}
return true;
}, _executePostBackEvent: function (a) {
var b = this._owner.ClientSettings.PostBackFunction;
b = b.replace("{0}", this._owner.UniqueID);
b = b.replace("{1}", a);
eval(b);
}, _raiseAction: function (a, b) {
var e = this, c = new Sys.CancelEventArgs(), d;
if (b) {
for (d in b) {
(function (f) {
c["_" + f] = b[f];
c["get_" + f] = function () {
return b[f];
};
c["set_" + f] = function (g) {
b[f] = g;
};
})(d);
}
}
c.get_actionName = function () {
return a;
};
c.get_tableView = function () {
return e;
};
e._owner.raise_userAction(c);
return c;
}
};
Telerik.Web.UI.GridTableView.registerClass("Telerik.Web.UI.GridTableView", Sys.UI.Control);
Telerik.Web.UI.GridFilterFunction = function () {
};
Telerik.Web.UI.GridFilterFunction.prototype = {
NoFilter: 0,
Contains: 1,
DoesNotContain: 2,
StartsWith: 3,
EndsWith: 4,
EqualTo: 5,
NotEqualTo: 6,
GreaterThan: 7,
LessThan: 8,
GreaterThanOrEqualTo: 9,
LessThanOrEqualTo: 10,
Between: 11,
NotBetween: 12,
IsEmpty: 13,
NotIsEmpty: 14,
IsNull: 15,
NotIsNull: 16,
Custom: 17
};
Telerik.Web.UI.GridFilterFunction.registerEnum("Telerik.Web.UI.GridFilterFunction", false);
Telerik.Web.UI.GridFilterFunction._wrapMethod = function (a, c, d) {
var b = a[c];
a[c] = function () {
var e = Array.prototype.slice.call(arguments);
var f = function () {
return b.apply(a, e);
};
return d.apply(a, [f].concat(e));
};
};
Telerik.Web.UI.GridFilterFunction._enumParseMethod = function (b, c, a) {
return (typeof c == "number") ? resolvedValue = c : b(c, !!a);
};
Telerik.Web.UI.GridFilterFunction._wrapMethod(Telerik.Web.UI.GridFilterFunction, "parse", Telerik.Web.UI.GridFilterFunction._enumParseMethod);
Telerik.Web.UI.GridSortOrder = function () {
};
Telerik.Web.UI.GridSortOrder.prototype = {None: 0, Ascending: 1, Descending: 2};
Telerik.Web.UI.GridSortOrder.registerEnum("Telerik.Web.UI.GridSortOrder", false);
Telerik.Web.UI.GridSortExpression = function () {
this._fieldName = "";
this._sortOrder = null;
};
Telerik.Web.UI.GridSortExpression.prototype = {
get_fieldName: function () {
return this._fieldName;
}, set_fieldName: function (a) {
if (this._fieldName != a) {
this._fieldName = a;
this.FieldName = a;
}
}, get_sortOrder: function () {
return this._sortOrder;
}, set_sortOrder: function (a) {
if (this._sortOrder != a) {
this._sortOrder = a;
this.SortOrder = a;
}
}, dispose: function () {
this._fieldName = null;
this._sortOrder = null;
}
};
Telerik.Web.UI.GridSortExpression.registerClass("Telerik.Web.UI.GridSortExpression", null, Sys.IDisposable);
Telerik.Web.UI.GridFilterFunctionsOqlFormat = function () {
var a = {};
a[Telerik.Web.UI.GridFilterFunction.Contains] = "{0} LIKE '*{1}*'";
a[Telerik.Web.UI.GridFilterFunction.DoesNotContain] = "NOT ({0} LIKE '*{1}*'";
a[Telerik.Web.UI.GridFilterFunction.StartsWith] = "{0} LIKE '{1}*'";
a[Telerik.Web.UI.GridFilterFunction.EndsWith] = "{0} LIKE '*{1}";
a[Telerik.Web.UI.GridFilterFunction.EqualTo] = "{0} = {1}";
a[Telerik.Web.UI.GridFilterFunction.NotEqualTo] = "{0} <> {1}";
a[Telerik.Web.UI.GridFilterFunction.GreaterThan] = "{0} > {1}";
a[Telerik.Web.UI.GridFilterFunction.LessThan] = "{0} < {1}";
a[Telerik.Web.UI.GridFilterFunction.GreaterThanOrEqualTo] = "{0} >= {1}";
a[Telerik.Web.UI.GridFilterFunction.LessThanOrEqualTo] = "{0} <= {1}";
a[Telerik.Web.UI.GridFilterFunction.Between] = "({0} >= {1}) AND ({0} <= {2})";
a[Telerik.Web.UI.GridFilterFunction.NotBetween] = "({0} < {1}) OR ({0} > {2})";
a[Telerik.Web.UI.GridFilterFunction.IsEmpty] = "{0} = ''";
a[Telerik.Web.UI.GridFilterFunction.NotIsEmpty] = "{0} <> ''";
a[Telerik.Web.UI.GridFilterFunction.IsNull] = "{0} == nil";
a[Telerik.Web.UI.GridFilterFunction.NotIsNull] = "({0} != nil)";
return a;
};
Telerik.Web.UI.GridFilterFunctionsSqlFormat = function () {
var a = {};
a[Telerik.Web.UI.GridFilterFunction.Contains] = "[{0}] LIKE '%{1}%'";
a[Telerik.Web.UI.GridFilterFunction.DoesNotContain] = "[{0}] NOT LIKE '%{1}%'";
a[Telerik.Web.UI.GridFilterFunction.StartsWith] = "[{0}] LIKE '{1}%'";
a[Telerik.Web.UI.GridFilterFunction.EndsWith] = "[{0}] LIKE '%{1}'";
a[Telerik.Web.UI.GridFilterFunction.EqualTo] = "[{0}] = {1}";
a[Telerik.Web.UI.GridFilterFunction.NotEqualTo] = "[{0}] <> {1}";
a[Telerik.Web.UI.GridFilterFunction.GreaterThan] = "[{0}] > {1}";
a[Telerik.Web.UI.GridFilterFunction.LessThan] = "[{0}] < {1}";
a[Telerik.Web.UI.GridFilterFunction.GreaterThanOrEqualTo] = "[{0}] >= {1}";
a[Telerik.Web.UI.GridFilterFunction.LessThanOrEqualTo] = "[{0}] <= {1}";
a[Telerik.Web.UI.GridFilterFunction.Between] = "([{0}] >= {1}) AND ([{0}] <= {2})";
a[Telerik.Web.UI.GridFilterFunction.NotBetween] = "([{0}] < {1}) OR ([{0}] > {2})";
a[Telerik.Web.UI.GridFilterFunction.IsEmpty] = "[{0}] = ''";
a[Telerik.Web.UI.GridFilterFunction.NotIsEmpty] = "[{0}] <> ''";
a[Telerik.Web.UI.GridFilterFunction.IsNull] = "[{0}] IS NULL";
a[Telerik.Web.UI.GridFilterFunction.NotIsNull] = "NOT ([{0}] IS NULL)";
return a;
};
Telerik.Web.UI.GridFilterFunctionsDynamicLinqFormat = function () {
var a = {};
a[Telerik.Web.UI.GridFilterFunction.Contains] = "{0}.Contains({1}){2}";
a[Telerik.Web.UI.GridFilterFunction.DoesNotContain] = "!{0}.Contains({1}){2}";
a[Telerik.Web.UI.GridFilterFunction.StartsWith] = "{0}.StartsWith({1}){2}";
a[Telerik.Web.UI.GridFilterFunction.EndsWith] = "{0}.EndsWith({1}){2}";
a[Telerik.Web.UI.GridFilterFunction.EqualTo] = "{0} = {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.NotEqualTo] = "{0} <> {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.GreaterThan] = "{0} > {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.LessThan] = "{0} < {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.GreaterThanOrEqualTo] = "{0} >= {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.LessThanOrEqualTo] = "{0} <= {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.Between] = "({0} >= {1}) AND ({0} <= {2})";
a[Telerik.Web.UI.GridFilterFunction.NotBetween] = "({0} < {1}) OR ({0} > {2})";
a[Telerik.Web.UI.GridFilterFunction.IsEmpty] = '{0} = ""{1}{2}';
a[Telerik.Web.UI.GridFilterFunction.NotIsEmpty] = '{0} <> ""{1}{2}';
a[Telerik.Web.UI.GridFilterFunction.IsNull] = "{0} == null{1}{2}";
a[Telerik.Web.UI.GridFilterFunction.NotIsNull] = "({0} != null){1}{2}";
return a;
};
Telerik.Web.UI.GridFilterFunctionsADONetDataServices = function () {
var a = {};
a[Telerik.Web.UI.GridFilterFunction.Contains] = "substringof({1},{0}){2}";
a[Telerik.Web.UI.GridFilterFunction.DoesNotContain] = "not substringof({1},{0}){2}";
a[Telerik.Web.UI.GridFilterFunction.StartsWith] = "startswith({0},{1}){2}";
a[Telerik.Web.UI.GridFilterFunction.EndsWith] = "endswith({0},{1}){2}";
a[Telerik.Web.UI.GridFilterFunction.EqualTo] = "{0} eq {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.NotEqualTo] = "{0} ne {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.GreaterThan] = "{0} gt {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.LessThan] = "{0} lt {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.GreaterThanOrEqualTo] = "{0} ge {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.LessThanOrEqualTo] = "{0} le {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.Between] = "({0} ge {1} and {0} le {2})";
a[Telerik.Web.UI.GridFilterFunction.NotBetween] = "({0} le {1} or {0} ge {2})";
a[Telerik.Web.UI.GridFilterFunction.IsEmpty] = "{0} eq ''{2}";
a[Telerik.Web.UI.GridFilterFunction.NotIsEmpty] = "{0} ne ''{2}";
a[Telerik.Web.UI.GridFilterFunction.IsNull] = "{0} eq null{2}";
a[Telerik.Web.UI.GridFilterFunction.NotIsNull] = "{0} ne null{2}";
return a;
};
Telerik.Web.UI.GridFilterExpression = function () {
this._fieldName = "";
this._fieldValue = null;
this._filterFunction = null;
this._columnUniqueName = null;
this._dataTypeName = null;
};
Telerik.Web.UI.GridFilterExpression.prototype = {
get_columnUniqueName: function () {
return this._columnUniqueName;
}, set_columnUniqueName: function (a) {
if (this._columnUniqueName != a) {
this._columnUniqueName = a;
this.ColumnUniqueName = a;
}
}, get_fieldName: function () {
return this._fieldName;
}, set_fieldName: function (a) {
if (this._fieldName != a) {
this._fieldName = a;
this.FieldName = a;
}
}, get_fieldValue: function () {
return this._fieldValue;
}, set_fieldValue: function (a) {
if (this._fieldValue != a) {
this._fieldValue = a;
this.FieldValue = a;
}
}, get_filterFunction: function () {
return this._filterFunction;
}, set_filterFunction: function (a) {
if (this._filterFunction != a) {
this._filterFunction = a;
this.FilterFunction = a;
}
}, get_dataTypeName: function () {
return this._dataTypeName;
}, set_dataTypeName: function (a) {
if (this._dataTypeName != a) {
this._dataTypeName = a;
this.DataTypeName = a;
}
}, toString: function (g) {
var e = "";
if (typeof(g) != "undefined") {
e = g;
}
var b = this._fieldName;
if (e != "") {
b = String.format("{0}.{1}", e, b);
}
var i = "";
if (this._filterFunction != null) {
var d = Telerik.Web.UI.GridFilterFunctionsSqlFormat();
var h = Telerik.Web.UI.GridFilterFunction.parse(this._filterFunction);
var c = d[h];
if (c != null) {
if (this._checkListFilterValues && this._checkListFilterValues.length > 0 && h == Telerik.Web.UI.GridFilterFunction.EqualTo) {
var i = [];
for (var a = 0;
a < this._checkListFilterValues.length;
a++) {
var f = this.getQuotedValue(this._checkListFilterValues[a]);
i[i.length] = String.format(c, this._fieldName, f, "");
}
return "(" + i.join(" OR ") + ")";
} else {
if (h != Telerik.Web.UI.GridFilterFunction.Between && h != Telerik.Web.UI.GridFilterFunction.NotBetween) {
if ((this.get_dataTypeName() == "System.String" || this.get_dataTypeName() == "System.Char") && h == Telerik.Web.UI.GridFilterFunction.Contains || h == Telerik.Web.UI.GridFilterFunction.DoesNotContain || h == Telerik.Web.UI.GridFilterFunction.StartsWith || h == Telerik.Web.UI.GridFilterFunction.EndsWith) {
i = String.format(c, b, this._fieldValue);
} else {
i = String.format(c, b, this.getQuotedValue(this._fieldValue));
}
} else {
var j = this._fieldValue.split(" ")[0];
var k = (this._fieldValue.split(" ").length > 0) ? this._fieldValue.split(" ")[1] : "";
i = String.format(c, b, this.getQuotedValue(j), this.getQuotedValue(k));
}
}
}
}
return i;
}, toOql: function (g) {
var e = "";
if (typeof(g) != "undefined") {
e = g;
}
var b = this._fieldName;
if (e != "") {
b = String.format("{0}.{1}", e, b);
}
var i = "";
if (this._filterFunction != null) {
var d = Telerik.Web.UI.GridFilterFunctionsOqlFormat();
var h = Telerik.Web.UI.GridFilterFunction.parse(this._filterFunction);
var c = d[h];
if (c != null) {
if (this._checkListFilterValues && this._checkListFilterValues.length > 0 && h == Telerik.Web.UI.GridFilterFunction.EqualTo) {
var i = [];
for (var a = 0;
a < this._checkListFilterValues.length;
a++) {
var f = this.getQuotedValue(this._checkListFilterValues[a]);
i[i.length] = String.format(c, b, this.getQuotedValue(this._fieldValue));
}
return "(" + i.join(" OR ") + ")";
} else {
if (h != Telerik.Web.UI.GridFilterFunction.Between && h != Telerik.Web.UI.GridFilterFunction.NotBetween) {
if ((this.get_dataTypeName() == "System.String" || this.get_dataTypeName() == "System.Char") && h == Telerik.Web.UI.GridFilterFunction.Contains || h == Telerik.Web.UI.GridFilterFunction.DoesNotContain || h == Telerik.Web.UI.GridFilterFunction.StartsWith || h == Telerik.Web.UI.GridFilterFunction.EndsWith) {
i = String.format(c, b, this._fieldValue);
} else {
i = String.format(c, b, this.getQuotedValue(this._fieldValue));
}
} else {
var j = this._fieldValue.split(" ")[0];
var k = (this._fieldValue.split(" ").length > 0) ? this._fieldValue.split(" ")[1] : "";
i = String.format(c, b, this.getQuotedValue(j), this.getQuotedValue(k));
}
}
}
}
return i;
}, getQuotedValue: function (a) {
if (this.get_dataTypeName() == "System.String" || this.get_dataTypeName() == "System.Char" || this.get_dataTypeName() == "System.DateTime" || this.get_dataTypeName() == "System.TimeSpan" || this.get_dataTypeName() == "System.Guid") {
return String.format("'{0}'", a);
}
return a;
}, getDataServiceValue: function (a) {
if (this.get_dataTypeName() == "System.String" || this.get_dataTypeName() == "System.Char") {
return String.format("'{0}'", a);
} else {
if (this.get_dataTypeName() == "System.DateTime") {
return String.format("datetime'{0}'", new Date(a).format("yyyy-MM-ddThh:mm:ss"));
} else {
if (this.get_dataTypeName() == "System.TimeSpan") {
return String.format("time'{0}'", a);
} else {
if (this.get_dataTypeName() == "System.Guid") {
return String.format("guid'{0}'", a);
}
}
}
}
return a;
}, getDynamicLinqValue: function (a) {
if (this.get_dataTypeName() == "System.String") {
return String.format('"{0}"', a);
} else {
if (this.get_dataTypeName().indexOf("DateTime") != -1) {
return String.format('DateTime.Parse("{0}")', a);
} else {
if (this.get_dataTypeName().indexOf("TimeSpan") != -1) {
return String.format('TimeSpan.Parse("{0}")', a);
} else {
if (this.get_dataTypeName().indexOf("Guid") != -1) {
return String.format('Guid({0}")', a);
}
}
}
}
return a;
}, toDynamicLinq: function (h) {
var e = "";
if (typeof(h) != "undefined") {
e = h;
}
var j = "";
if (this._filterFunction != null) {
var d = Telerik.Web.UI.GridFilterFunctionsDynamicLinqFormat();
var i = Telerik.Web.UI.GridFilterFunction.parse(this._filterFunction);
var c = d[i];
if (c != null) {
if (this._checkListFilterValues && this._checkListFilterValues.length > 0 && i == Telerik.Web.UI.GridFilterFunction.EqualTo) {
var j = [];
for (var a = 0;
a < this._checkListFilterValues.length;
a++) {
var f = this.getDynamicLinqValue(this._checkListFilterValues[a]);
j[j.length] = String.format(c, this._fieldName, f, "");
}
return "(" + j.join(" OR ") + ")";
} else {
var f = "";
var g = "";
if (i == Telerik.Web.UI.GridFilterFunction.IsNull || i == Telerik.Web.UI.GridFilterFunction.NotIsNull) {
f = "";
} else {
if (i == Telerik.Web.UI.GridFilterFunction.Between || i == Telerik.Web.UI.GridFilterFunction.NotBetween) {
g = this.getDynamicLinqValue(this._fieldValue.split(" ")[1]);
f = this.getDynamicLinqValue(this._fieldValue.split(" ")[0]);
} else {
f = this.getDynamicLinqValue(this._fieldValue);
}
}
var b = this._fieldName;
if (e != "") {
b = String.format("{0}.{1}", e, b);
}
j = String.format(c, b, f, g);
}
}
}
return j;
}, toDataService: function () {
var g = "";
if (this._filterFunction != null) {
var c = Telerik.Web.UI.GridFilterFunctionsADONetDataServices();
var f = Telerik.Web.UI.GridFilterFunction.parse(this._filterFunction);
var b = c[f];
if (b != null) {
if (this._checkListFilterValues && this._checkListFilterValues.length > 0 && f == Telerik.Web.UI.GridFilterFunction.EqualTo) {
var g = [];
for (var a = 0;
a < this._checkListFilterValues.length;
a++) {
g[g.length] = String.format(b, this._fieldName, this.getDataServiceValue(this._checkListFilterValues[a]));
}
return "(" + g.join(" or ") + ")";
} else {
var d = "";
var e = "";
if (f == Telerik.Web.UI.GridFilterFunction.IsNull || f == Telerik.Web.UI.GridFilterFunction.NotIsNull) {
d = "";
} else {
if (f == Telerik.Web.UI.GridFilterFunction.Between || f == Telerik.Web.UI.GridFilterFunction.NotBetween) {
e = this._fieldValue.split(" ")[1];
d = this._fieldValue.split(" ")[0];
} else {
d = this._fieldValue;
}
}
g = String.format(b, this._fieldName, this.getDataServiceValue(d), (e != "") ? this.getDataServiceValue(e) : e);
}
}
}
return g;
}, dispose: function () {
this._fieldName = null;
this._fieldValue = null;
this._filterFunction = null;
this._columnUniqueName = null;
this._dataTypeName = null;
}
};
Telerik.Web.UI.GridFilterExpression.registerClass("Telerik.Web.UI.GridFilterExpression", null, Sys.IDisposable);
Telerik.Web.UI.Collection = function () {
this._array = new Array();
};
Telerik.Web.UI.Collection.prototype = {
add: function (b) {
var a = this._array.length;
this.insert(a, b);
}, insert: function (a, b) {
Array.insert(this._array, a, b);
}, remove: function (a) {
Array.remove(this._array, a);
}, removeAt: function (a) {
var b = this.getItem(a);
if (b) {
this.remove(b);
}
}, clear: function () {
this._array = new Array();
}, toList: function () {
return this._array;
}, get_count: function () {
return this._array.length;
}, getItem: function (a) {
return this._array[a];
}, indexOf: function (a) {
return Array.indexOf(this._array, a);
}, forEach: function (c) {
for (var b = 0, a = this.get_count();
b < a;
b++) {
c(this._array[b]);
}
}, dispose: function () {
this._array = null;
}
};
Telerik.Web.UI.Collection.registerClass("Telerik.Web.UI.Collection", null, Sys.IDisposable);
Telerik.Web.UI.GridSortExpressions = function () {
Telerik.Web.UI.GridSortExpressions.initializeBase(this);
};
Telerik.Web.UI.GridSortExpressions.prototype = {
find: function (b) {
for (var c = 0, a = this.get_count();
c < a;
c++) {
var d = this.getItem(c);
if (d.get_fieldName() == b) {
return d;
}
}
return null;
}, sortOrderAsString: function (a) {
if (a == 0) {
return "";
} else {
if (a == 1) {
return "ASC";
} else {
if (a == 2) {
return "DESC";
}
}
}
}, toString: function () {
var d = [];
for (var b = 0, a = this.get_count();
b < a;
b++) {
var c = this.getItem(b);
d[d.length] = String.format("{0} {1}", c.get_fieldName(), this.sortOrderAsString(c.get_sortOrder()));
}
return d.join(",");
}, toClientDataSourceList: function () {
var a = [];
Array.forEach(this._array, function (c, b) {
a[b] = {fieldName: c.FieldName, sortOrder: c.SortOrder};
});
return a;
}
};
Telerik.Web.UI.GridSortExpressions.registerClass("Telerik.Web.UI.GridSortExpressions", Telerik.Web.UI.Collection);
Telerik.Web.UI.GridFilterExpressions = function () {
Telerik.Web.UI.GridFilterExpressions.initializeBase(this);
};
Telerik.Web.UI.GridFilterExpressions.prototype = {
find: function (a) {
for (var c = 0, b = this.get_count();
c < b;
c++) {
var d = this.getItem(c);
if (d.get_columnUniqueName() == a) {
return d;
}
}
return null;
}, toString: function (e) {
var c = "";
if (typeof(e) != "undefined") {
c = e;
}
var f = [];
for (var b = 0, a = this.get_count();
b < a;
b++) {
var d = this.getItem(b);
f[f.length] = d.toString(c);
}
return f.join(" AND ");
}, toOql: function (e) {
var c = "";
if (typeof(e) != "undefined") {
c = e;
}
var f = [];
for (var b = 0, a = this.get_count();
b < a;
b++) {
var d = this.getItem(b);
f[f.length] = d.toOql(c);
}
return f.join(" AND ");
}, toDynamicLinq: function (e) {
var c = "";
if (typeof(e) != "undefined") {
c = e;
}
var f = [];
for (var b = 0, a = this.get_count();
b < a;
b++) {
var d = this.getItem(b);
f[f.length] = d.toDynamicLinq(c);
}
return f.join(" AND ");
}, toDataService: function () {
var d = [];
for (var b = 0, a = this.get_count();
b < a;
b++) {
var c = this.getItem(b);
d[d.length] = c.toDataService();
}
return d.join(" and ");
}, toClientDataSourceList: function () {
var a = [];
Array.forEach(this._array, function (c, b) {
if (c.FilterFunction != "NoFilter") {
a[b] = {
field: c.FieldName,
operator: Telerik.Web.UI.ClientDataSource.FilterOperator[c.FilterFunction],
value: c.FieldValue
};
}
});
return {logicOperator: Telerik.Web.UI.ClientDataSource.FilterLogicOperator.And, filters: a};
}
};
Telerik.Web.UI.GridFilterExpressions.registerClass("Telerik.Web.UI.GridFilterExpressions", Telerik.Web.UI.Collection);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.GridGroupPanel = function (a) {
Telerik.Web.UI.GridGroupPanel.initializeBase(this, [a]);
this._owner = {};
};
Telerik.Web.UI.GridGroupPanel.prototype = {
initialize: function () {
Telerik.Web.UI.GridGroupPanel.callBaseMethod(this, "initialize");
this.groupPanelItemCounter = 0;
this._createGroupPanelItems(this.get_element(), 0);
this._initializeEvents();
}, dispose: function () {
$clearHandlers(this.get_element());
this._element.control = null;
this._groupTouchItems = [];
Telerik.Web.UI.GridGroupPanel.callBaseMethod(this, "dispose");
}, _initializeEvents: function () {
if (this._owner._clientDataSourceID) {
$addHandler(this.get_element(), "click", Function.createDelegate(this, this._click));
}
}, _click: function (b) {
var d = Telerik.Web.UI.Grid.GetCurrentElement(b);
if (Sys.UI.DomElement.containsCssClass(d, "rgUngroup")) {
this._ungroup(d);
} else {
if (Sys.UI.DomElement.containsCssClass(d, "rgSortAsc") || Sys.UI.DomElement.containsCssClass(d, "rgSortDesc")) {
var a = d.parentNode;
var c = "";
c = this._getFieldNameFromTarget(a);
d.className = d.className.indexOf("rgSortAsc") > -1 ? "rgSortDesc" : "rgSortAsc";
d.title = d.className.indexOf("rgSortAsc") > -1 ? "Sorted asc" : "Sorted desc";
this._sort(c);
$telerik.preventDefault(b);
}
}
}, _getFieldNameFromTarget: function (g) {
var e = $telerik.getElementsByClassName(this.get_element(), "rgGroupItem");
var d = null;
var a = "";
for (var f = 0;
f < e.length;
f++) {
var c = e[f];
if (c == g) {
d = f;
}
}
var b = this._owner.get_masterTableView()._data.GroupByExpressions;
if (d != null && d < b.length) {
a = b[d].field;
}
return a;
}, _sort: function (a) {
this._owner.get_masterTableView().fireCommand("SortGroup", a);
}, _ungroup: function (g) {
var a = g.parentNode, f = a.parentNode, d = f.parentNode.parentNode.parentNode, b = this._getFieldNameFromTarget(a), e = $telerik.previousElement(a), c = $telerik.nextElement(a);
this._owner.get_masterTableView().ungroupColumn(b);
if (e) {
f.removeChild(e);
} else {
if (c) {
f.removeChild(c);
}
}
f.removeChild(a);
if (f.cells.length <= 1) {
d.removeChild(d.childNodes[0]);
d.innerHTML = this._owner._groupPanelText;
}
}, _create: function (c, b) {
var g = this.get_element().getElementsByTagName("table"), f = g[g.length - 1], e = f.tBodies[0].rows[0], d = Telerik.Web.UI.GridGroupPanelItem.Create(this._owner, c, g.length != 1, b), a;
if (g.length == 1) {
f = document.createElement("table");
f.cellPadding = 2;
f.style.cssText = "border-style:None;width:100%;border-spacing:0;";
f.appendChild(document.createElement("tbody"));
e.cells[0].innerHTML = "";
e.cells[0].appendChild(f);
e = f.tBodies[0].appendChild(document.createElement("tr"));
e.appendChild(d);
a = document.createElement("td");
a.style.width = "100%";
e.appendChild(a);
} else {
e.insertBefore(d, e.cells[e.cells.length - 1]);
}
}, _createGroupPanelItems: function (h) {
this._itemsInternal = eval(this._owner._groupPanelItems);
this._items = [];
var g = h.tBodies[0].rows;
for (var d = 0;
d < g.length;
d++) {
var b = false;
var f = g[d];
for (var e = 0;
e < f.cells.length;
e++) {
var a = f.cells[e];
if (a.tagName.toLowerCase() == "th") {
var c;
if (this._itemsInternal[this.groupPanelItemCounter]) {
c = this._itemsInternal[this.groupPanelItemCounter].HierarchicalIndex;
}
if (c) {
this._items[this._items.length] = $create(Telerik.Web.UI.GridGroupPanelItem, {
_hierarchicalIndex: c,
_owner: this
}, null, null, a);
b = true;
this.groupPanelItemCounter++;
}
}
if ((a.firstChild) && (a.firstChild.tagName)) {
if (a.firstChild.tagName.toLowerCase() == "table") {
this._createGroupPanelItems(a.firstChild);
}
}
}
}
}, _isItem: function (a) {
for (var b = 0;
b < this._items.length;
b++) {
if (this._items[b].get_element() == a) {
return this._items[b];
}
}
return null;
}
};
Telerik.Web.UI.GridGroupPanel.registerClass("Telerik.Web.UI.GridGroupPanel", Sys.UI.Control);
Telerik.Web.UI.GridGroupPanelItem = function (a) {
Telerik.Web.UI.GridGroupPanelItem.initializeBase(this, [a]);
this._hierarchicalIndex = null;
this._owner = {};
this._dataField = null;
};
Telerik.Web.UI.GridGroupPanelItem.Create = function (g, e, a, c) {
g = $find(g.get_id());
var f = document.createDocumentFragment();
var b = document.createElement("th");
b.setAttribute("scope", "col");
b.title = g._unGroupTooltip || "Drag out of the bar to ungroup";
b.className = "rgGroupItem";
b.style.cssText = "white-space: nowrap; cursor: move;";
b.appendChild(document.createTextNode(e + " "));
var h = document.createElement("input");
h.setAttribute("type", "submit");
h.value = " ";
h.title = "Sorted asc";
h.className = "rgSortAsc";
b.appendChild(h);
if (g._showUnGroupButton) {
var i = document.createElement("input");
i.setAttribute("type", "submit");
i.title = g._unGroupButtonTooltip || "Click here to ungroup";
i.value = " ";
i.className = "rgUngroup";
b.appendChild(i);
}
if (a) {
var d = document.createElement("td");
d.innerHTML = "-";
f.appendChild(d);
}
f.appendChild(b);
g._groupPanel._items[g._groupPanel._items.length] = $create(Telerik.Web.UI.GridGroupPanelItem, {
_hierarchicalIndex: "0:" + (g.get_masterTableView()._data.GroupByExpressions.length - 1),
_owner: g._groupPanel,
_dataField: c
}, null, null, b);
return f;
};
Telerik.Web.UI.GridGroupPanelItem.prototype = {
initialize: function () {
Telerik.Web.UI.GridGroupPanelItem.callBaseMethod(this, "initialize");
this.get_element().style.cursor = "move";
this._onMouseDownDelegate = $telerik.addMobileHandler(this, this.get_element(), "mousedown", this._onMouseDownHandler);
}, dispose: function () {
$clearHandlers(this.get_element());
this._element.control = null;
Telerik.Web.UI.GridGroupPanelItem.callBaseMethod(this, "dispose");
}, _onMouseDownHandler: function (a) {
this._onMouseUpDelegate = $telerik.addMobileHandler(this, document, "mouseup", this._onMouseUpHandler, null, true);
this._onMouseMoveDelegate = $telerik.addMobileHandler(this, document, "mousemove", this._onMouseMoveHandler, null, true);
Telerik.Web.UI.Grid.CreateDragDrop(a, this, false);
Telerik.Web.UI.Grid.CreateReorderIndicators(this.get_element(), this._owner._owner.Skin, this._owner._owner.ImagesPath, false, this._owner._owner.get_id());
}, _onMouseUpHandler: function (b) {
$telerik.removeMobileHandler(document, "mouseup", this._onMouseUpDelegate, null, true);
$telerik.removeMobileHandler(document, "mousemove", this._onMouseMoveDelegate, null, true);
var d = this._fireDropAction(b);
var c = this._owner._owner;
var a = c.ClientSettings.Animation && c.ClientSettings.Animation.AllowColumnRevertAnimation;
if (a && !d) {
Telerik.Web.UI.Grid.AnimateRevertDragDrop(this, c.ClientSettings.Animation.ColumnRevertAnimationDuration);
} else {
Telerik.Web.UI.Grid.DestroyDragDrop();
}
}, _onMouseMoveHandler: function (a) {
if ($telerik.isTouchDevice) {
a.preventDefault();
}
Telerik.Web.UI.Grid.MoveDragDrop(a, this, false);
}, _fireDropAction: function (d) {
if ($telerik.isTouchDevice) {
currentElement = $telerik.getTouchTarget(d);
} else {
currentElement = Telerik.Web.UI.Grid.GetCurrentElement(d);
}
if (currentElement != null) {
var f = this._owner._owner;
var g = null;
var k = false;
var h = $telerik.getElementsByClassName(f.get_element(), "rgGroupItem", "th");
for (var j = 0;
j < h.length;
j++) {
if ($telerik.isMouseOverElement(h[j], d)) {
k = true;
g = h[j];
break;
}
}
if ($telerik.isMouseOverElement(this._owner.get_element(), d)) {
k = true;
}
var m = this._owner._owner.ClientSettings.PostBackFunction;
m = m.replace("{0}", this._owner._owner.UniqueID);
if (!k && (!(Telerik.Web.UI.Grid.IsChildOf(currentElement, this._owner.get_element()) || $telerik.isTouchDevice && currentElement == this._owner.get_element()))) {
var c = "UnGroupByExpression";
var b = this._hierarchicalIndex;
var a = new Sys.CancelEventArgs();
a.get_commandName = function () {
return c;
};
a.get_commandArgument = function () {
return b;
};
if (this._owner._owner._clientDataSourceID) {
a.set_cancel(true);
} else {
this._owner._owner.raise_command(a);
}
if (a.get_cancel()) {
if (this._owner._owner._clientDataSourceID) {
this._owner._ungroup(this.get_element().childNodes[0]);
}
return false;
}
m = m.replace("{1}", "UnGroupByExpression," + this._hierarchicalIndex);
eval(m);
return true;
} else {
var l = this._owner._isItem(currentElement);
if (l == null && g != null) {
currentElement = g;
l = this._owner._isItem(currentElement);
}
if ((currentElement != this.get_element()) && (l != null) && (currentElement.parentNode == this.get_element().parentNode)) {
var c = "ReorderGroupByExpression";
var b = this._hierarchicalIndex + "," + l._hierarchicalIndex;
var a = new Sys.CancelEventArgs();
a.get_commandName = function () {
return c;
};
a.get_commandArgument = function () {
return b;
};
this._owner._owner.raise_command(a);
if (a.get_cancel()) {
return false;
}
m = m.replace("{1}", "ReorderGroupByExpression," + this._hierarchicalIndex + "," + l._hierarchicalIndex);
eval(m);
return true;
}
}
}
return false;
}
};
Telerik.Web.UI.GridGroupPanelItem.registerClass("Telerik.Web.UI.GridGroupPanelItem", Sys.UI.Control);
Type.registerNamespace("Telerik.Web.UI");
$telerik.findGrid = $find;
$telerik.toGrid = function (a) {
return a;
};
Telerik.Web.UI.RadGrid = function (a) {
var b = ["gridCreating", "gridCreated", "gridDestroying", "masterTableViewCreating", "masterTableViewCreated", "tableCreating", "tableCreated", "tableDestroying", "cellDeselected", "cellDeselecting", "cellSelected", "cellSelecting", "columnCreating", "columnCreated", "columnDestroying", "columnResizing", "columnResized", "columnSwapping", "columnSwapped", "columnMovingToLeft", "columnMovedToLeft", "columnMovingToRight", "columnMovedToRight", "columnHiding", "columnHidden", "columnShowing", "columnShown", "rowCreating", "rowCreated", "rowDestroying", "rowResizing", "rowResized", "rowHiding", "rowHidden", "rowShowing", "rowShown", "rowClick", "rowDblClick", "columnClick", "columnDblClick", "rowSelecting", "rowSelected", "rowDeselecting", "rowDeselected", "rowMouseOver", "rowMouseOut", "columnMouseOver", "columnMouseOut", "columnContextMenu", "rowContextMenu", "scroll", "keyPress", "hierarchyExpanding", "hierarchyExpanded", "hierarchyCollapsing", "hierarchyCollapsed", "groupExpanding", "groupExpanded", "groupCollapsing", "groupCollapsed", "activeRowChanging", "activeRowChanged", "rowDeleting", "rowDeleted", "filterMenuShowing", "rowDropping", "rowDropped", "rowDragStarted", "rowDragging", "popUpShowing", "command", "userAction", "rowDataBound", "dataBinding", "dataBound", "headerMenuShowing", "dataBindingFailed", "dataSourceResolved", "batchEditGetEditorValue", "batchEditSetEditorValue", "batchEditGetCellValue", "batchEditSetCellValue", "batchEditCellValueChanging", "batchEditCellValueChanged", "batchEditOpening", "batchEditOpened", "batchEditClosing", "batchEditClosed"];
this._initializeEvents(b);
Telerik.Web.UI.RadGrid.initializeBase(this, [a]);
this.Skin = "Default";
this._imagesPath = "";
this._embeddedSkin = true;
this.ClientID = null;
this.UniqueID = null;
this._clientDataSourceID = null;
this._activeRowIndex = "";
this._activeRow = null;
this.ShowGroupPanel = false;
this._groupPanel = null;
this._groupPanelClientID = "";
this._groupPanelItems = "";
this._groupPanelText = "";
this._showUnGroupButton = false;
this._unGroupTooltip = "";
this._unGroupButtonTooltip = "";
this._gridTableViewsData = "";
this._popUpIds = "";
this._popUpSettings = {};
this.ClientSettings = {};
this._selection = null;
this._cellSelection = null;
this._selectedCellsIndexes = [];
this._selectedCellsInternal = [];
this._selectedIndexes = [];
this._selectedItemsInternal = [];
this._unselectableItemsInternal = [];
this._unselectableItemsIndexes = [];
this._masterClientID = "";
this._scrolling = null;
this._gridItemResizer = null;
this._resizedItems = "";
this._resizedColumns = "";
this._resizedControl = "";
this._hidedItems = "";
this._showedItems = "";
this._hidedColumns = [];
this._showedColumns = [];
this._reorderedColumns = [];
this._groupColsState = {};
this._hierarchyColsExpandedState = {};
this._filterMenuData = {};
this._filterMenu = null;
this._headerContextMenu = null;
this._detailTables = [];
this._clientKeyValues = {};
this._onKeyDownDelegate = null;
this._onMouseMoveDelegate = null;
this._hierarchySettings = {};
this._groupingSettings = {};
this._currentPageIndex = null;
this._expandItems = {};
this._expandedItems = [];
this._expandedGroupItems = [];
this._deletedItems = [];
this._expandedFilterItems = [];
this._initializeRequestHandler = null;
this._endRequestHandler = null;
this._statusLabelID = null;
this._loadingText = null;
this._readyText = null;
this._onFilterMenuClick = null;
this._popUpLocations = {};
this._submitControls = [];
this._allowSubmitOnEnter = false;
this._validationGroup = "";
window[this.ClientID] = this;
this._canMoveRow = false;
this._originalDragItem = null;
this._dropClue = null;
this._draggedItems = [];
this._draggedItemsIndexes = [];
this._draggingPosition = "above";
this._editIndexes = null;
this._controlToFocus = null;
this._documentKeyDownDelegate = null;
this._dataDivMouseDownDelegate = null;
this._dataDivMouseUpDelegate = null;
this._dataDivMouseMoveDelegate = null;
this._swipeStartDelegate = null;
this._swipeUpDelegate = null;
this._swipeMoveDelegate = null;
this._isTouchScrollInProgress = false;
this._documentMouseUpDelegate = null;
this._documentMouseMoveDelegate = null;
this._shouldFocusOnPage = null;
this._lastSelectedItemIndex = null;
this._filterCheckListClientID = null;
this._checkListFilterActiveColumn = "";
this._checkListFilterKeys = [];
this._checkListFilterValues = [];
this._filterApplyButton = null;
this._invisibleParentsArray = [];
this._animation = null;
this.ValidationSettings = {};
this._enableAriaSupport = false;
this._positionedDataItems = null;
this._positionedDataItemsIndexes = null;
this._keyboardNavigationProperties = {
positionedDataItems: null,
positionedDataItemsIndexes: null,
lastClickSelectedItem: null,
currentSelectedIndex: 0,
initialRowIndex: 0,
directionIndex: 0,
lastSelectedRowIndex: null,
holdingCtrl: false,
firstSelection: true,
unselectableItemsCount: 0,
setInitialState: function () {
this.initialRowIndex = this.currentSelectedIndex;
this.directionIndex = 0;
}
};
this.odataClientSettings = null;
this._dataBindingWithSelectMethod = false;
this._isBatchEditingEnabled = false;
this._batchEditingOpenForEditEvents = {};
this._defaultDateTimeFormat = null;
this._startTouchPoints = {};
this._endTouchPoints = {};
this._currentTouchPoints = {};
this._currentMovement = null;
this._validSwipe = true;
this._swipeThreshold = 20;
};
Telerik.Web.UI.RadGrid.prototype = {
initialize: function () {
Telerik.Web.UI.RadGrid.callBaseMethod(this, "initialize");
if ((!this._masterClientID) || (!$get(this._masterClientID))) {
return;
}
this._applyCellSpacingIfRequired();
if (this.ClientSettings) {
if (!this.ClientSettings.PostBackFunction) {
this.ClientSettings.PostBackFunction = "__doPostBack('{0}','{1}')";
}
if (!this.ClientSettings.AllowExpandCollapse) {
this.ClientSettings.AllowExpandCollapse = true;
}
if (this.ClientSettings.AllowGroupExpandCollapse == null) {
this.ClientSettings.AllowGroupExpandCollapse = true;
}
if (typeof(this.ClientSettings.EnableAlternatingItems) == "undefined") {
this.ClientSettings.EnableAlternatingItems = true;
}
if (!this.ClientSettings.ColumnsReorderMethod) {
this.ClientSettings.ColumnsReorderMethod = 0;
}
if (this.ClientSettings.ClientMessages) {
if (typeof(this.ClientSettings.ClientMessages.DragToGroupOrReorder) == "undefined" || this.ClientSettings.ClientMessages.DragToGroupOrReorder == null) {
this.ClientSettings.ClientMessages.DragToGroupOrReorder = "Drag to group or reorder";
}
if (typeof(this.ClientSettings.ClientMessages.DragToResize) == "undefined" || this.ClientSettings.ClientMessages.DragToResize == null) {
this.ClientSettings.ClientMessages.DragToResize = "Drag to resize";
}
if (typeof(this.ClientSettings.ClientMessages.DropHereToReorder) == "undefined" || this.ClientSettings.ClientMessages.DropHereToReorder == null) {
this.ClientSettings.ClientMessages.DropHereToReorder = "Drop here to reorder";
}
if (typeof(this.ClientSettings.ClientMessages.PagerTooltipFormatString) == "undefined" || this.ClientSettings.ClientMessages.PagerTooltipFormatString == null) {
this.ClientSettings.ClientMessages.PagerTooltipFormatString = "Page <strong>{0}</strong> of <strong>{1}</strong>";
}
if (typeof(this.ClientSettings.ClientMessages.ColumnResizeTooltipFormatString) == "undefined" || this.ClientSettings.ClientMessages.ColumnResizeTooltipFormatString == null) {
this.ClientSettings.ClientMessages.ColumnResizeTooltipFormatString = "Width: <strong>{0}</strong> <em>pixels</em>";
}
}
if (this.ClientSettings.DataBinding) {
if (!this.ClientSettings.DataBinding.MaximumRowsParameterName) {
this.ClientSettings.DataBinding.MaximumRowsParameterName = "maximumRows";
}
if (!this.ClientSettings.DataBinding.StartRowIndexParameterName) {
this.ClientSettings.DataBinding.StartRowIndexParameterName = "startRowIndex";
}
if (!this.ClientSettings.DataBinding.SortParameterName) {
this.ClientSettings.DataBinding.SortParameterName = "sortExpression";
}
if (!this.ClientSettings.DataBinding.FilterParameterName) {
this.ClientSettings.DataBinding.FilterParameterName = "filterExpression";
}
}
if (this.ClientSettings.KeyboardNavigationSettings.AllowSubmitOnEnter) {
this._allowSubmitOnEnter = this.ClientSettings.KeyboardNavigationSettings.AllowSubmitOnEnter;
}
if (this.ClientSettings.KeyboardNavigationSettings.ValidationGroup) {
this._validationGroup = this.ClientSettings.KeyboardNavigationSettings.ValidationGroup;
}
}
if (this.ClientSettings.Animation && ((this.ClientSettings.Animation.AllowColumnReorderAnimation && this.ClientSettings.ColumnsReorderMethod === 1) || this.ClientSettings.Animation.AllowColumnRevertAnimation)) {
this._animation = {};
this._animation.ColumnAnimation = $create(Telerik.Web.UI.GridColumnAnimation, {
reorderDuration: this.ClientSettings.Animation.ColumnReorderAnimationDuration,
revertDuration: this.ClientSettings.Animation.ColumnRevertAnimationDuration
}, null, {owner: this.ClientID});
}
if (this._editIndexes != null) {
this._editIndexes = eval(this._editIndexes);
}
if (this.ClientSettings.AllowKeyboardNavigation) {
this._documentKeyDownDelegate = Function.createDelegate(this, this._documentKeyDown);
$telerik.addExternalHandler(document, "keydown", this._documentKeyDownDelegate);
}
if (this.ClientSettings.AllowRowsDragDrop || (this.get_events().getHandler("rowDblClick") && $telerik.isTouchDevice)) {
this._onMouseDownDelegate = $telerik.addMobileHandler(this, this.get_element(), "mousedown", this._mouseDown);
}
if (this.ClientSettings.AllowRowsDragDrop) {
this._documentMouseUpDelegate = $telerik.addMobileHandler(this, document, "mouseup", this._mouseUp, null, true);
this._documentMouseMoveDelegate = $telerik.addMobileHandler(this, document, "mousemove", this._mouseMove, null, true);
}
$addHandlers(this.get_element(), {click: Function.createDelegate(this, this._click)});
$addHandlers(this.get_element(), {dblclick: Function.createDelegate(this, this._dblclick)});
if ($telerik.isTouchDevice && $telerik.$ && $telerik.$.fn.doubletap) {
var a = $telerik.$;
var c = a.proxy(this._dblclick, this);
a(this.get_element()).doubletap(c);
}
if ($telerik.isOpera) {
$addHandlers(this.get_element(), {mousedown: Function.createDelegate(this, this._contextmenu)});
} else {
$addHandlers(this.get_element(), {contextmenu: Function.createDelegate(this, this._contextmenu)});
}
if (!$telerik.isTouchDevice) {
this._attachMouseHandlers();
}
this._initializeSubmitControls();
this.raise_gridCreating(new Sys.EventArgs());
this.Control = this.get_element();
this.get_element().tabIndex = 0;
if (this.ShowGroupPanel) {
var g = $get(this._groupPanelClientID);
if (g) {
this._groupPanel = $create(Telerik.Web.UI.GridGroupPanel, {_owner: this}, null, null, $get(this._groupPanelClientID));
}
}
this._gridDataDiv = $get(this.get_id() + "_GridData");
this._fillSelectedCellsIndexes();
this._fillUnselectableItemsIndexes();
if (this.ClientSettings && this.ClientSettings.Selecting && this.get_allowCellSelection()) {
this._cellSelection = $create(Telerik.Web.UI.GridCellSelection, {
_owner: this,
multiple: this.get_allowMutliCellSelection(),
columnSelect: this.get_allowColumnSelection(),
multiColumnSelect: this.get_allowMultiColumnSelection()
}, null, {owner: this.ClientID});
}
if (this.ClientSettings && (this.ClientSettings.Selecting && this.ClientSettings.Selecting.AllowRowSelect) || this.ClientSettings.EnablePostBackOnRowClick) {
this._selection = $create(Telerik.Web.UI.GridSelection, {_owner: this}, null, {owner: this.ClientID});
}
this._initializeTableViews();
this.GridDataDiv = $get(this.ClientID + "_GridData");
this.GridHeaderDiv = $get(this.ClientID + "_GridHeader");
this.GridFooterDiv = $get(this.ClientID + "_GridFooter");
this.PagerControl = $get(this._masterClientID + "_Pager");
this.TopPagerControl = $get(this._masterClientID + "_TopPager");
this._getFilterMenu();
if (this._filterMenu) {
this._filterApplyButton = $telerik.getElementByClassName(this._filterMenu.get_element(), "rgFilterApply");
if (this._filterApplyButton) {
this._checkListFilterApplyButtonDelegate = $telerik.addMobileHandler(this, this._filterApplyButton, "click", this._checkListFilterApplyButtonHandler);
this._filterCancelButton = $telerik.getElementByClassName(this._filterMenu.get_element(), "rgFilterCancel");
this._checkListFilterCancelButtonDelegate = $telerik.addMobileHandler(this, this._filterCancelButton, "click", this._checkListFilterCancelButtonHandler);
}
}
if (this._checkListFilterKeys && this._checkListFilterKeys.length > 0) {
this.updateClientState();
}
if (this._filterCheckListClientID) {
var f = $find(this._filterCheckListClientID);
this._checkListItemsRequestedDelegate = Function.createDelegate(this, this._checkListItemsRequestedHandler);
f.add_itemsRequested(this._checkListItemsRequestedDelegate);
}
if ($telerik.isMobileIE10) {
if (this.get_events().getHandler("rowDblClick")) {
this.get_element().style.msTouchAction = "none";
}
if (!!this._groupPanel) {
this._groupPanel.get_element().style.msTouchAction = "none";
}
}
if (this.ClientSettings.Scrolling.AllowScroll && $telerik.isTouchDevice) {
this._dataDivMouseDownDelegate = $telerik.addMobileHandler(this, this.GridDataDiv, "mousedown", this._dataDivMouseDown);
this._dataDivMouseUpDelegate = $telerik.addMobileHandler(this, this.GridDataDiv, "mouseup", this._dataDivMouseUp);
this._dataDivMouseMoveDelegate = $telerik.addMobileHandler(this, this.GridDataDiv, "mousemove", this._dataDivMouseMove);
}
if (this.get_masterTableView().get_allowPaging() && $telerik.isTouchDevice) {
var p = this.ClientSettings.Scrolling.AllowScroll ? this.GridDataDiv : $telerik.getChildrenByTagName(this.get_masterTableView().get_element(), "tbody")[0];
this._swipeStartDelegate = $telerik.addMobileHandler(this, p, "mousedown", this._swipeStart);
this._swipeEndDelegate = $telerik.addMobileHandler(this, p, "mouseup", this._swipeEnd);
this._swipeMoveDelegate = $telerik.addMobileHandler(this, p, "mousemove", this._swipeMove);
}
var j = Telerik.Web.UI.Grid.IsRightToLeft(this.get_masterTableView().get_element());
if (j) {
this.get_element().className = String.format("{0} RadGridRTL RadGridRTL_{1}", this.get_element().className, this.Skin);
}
if (this.ClientSettings && this.ClientSettings.Scrolling && (this.ClientSettings.Scrolling.AllowScroll || (this.ClientSettings.Scrolling.AllowScroll && (this.ClientSettings.Scrolling.UseStaticHeaders || this.ClientSettings.Scrolling.EnableVirtualScrollPaging)))) {
if (($telerik.isIE7 || $telerik.isIE6) && this.ClientSettings.Scrolling.UseStaticHeaders) {
var k = this.get_masterTableView().get_element();
k.removeChild(k.tHead);
if (this.get_masterTableViewFooter()) {
var l = this.get_masterTableViewFooter().get_element();
l.removeChild(l.tHead);
}
}
this._scrolling = $create(Telerik.Web.UI.GridScrolling, {_owner: this}, null, null);
} else {
this.repaint();
}
if (this._activeRowIndex) {
var n = this.get_masterTableView()._getRowByIndexOrItemIndexHierarchical(this._activeRowIndex);
if (n) {
var o = this._selectedItemsInternal;
for (var h = 0;
h < o.length;
h++) {
Array.add(this._selectedIndexes, o[h].itemIndex);
}
this.set_activeRow(n);
}
}
if (this._lastSelectedItemIndex != null && this._selection) {
this._selection._lastSelectedItemIndex = this._lastSelectedItemIndex;
}
if (this._isBatchEditingEnabled) {
this._batchEditing = $create(Telerik.Web.UI.GridBatchEditing, null, null, {_owner: this.get_id()}, null);
}
this._attachDomEvents();
if (Sys.WebForms && Sys.WebForms.PageRequestManager) {
var m = Sys.WebForms.PageRequestManager.getInstance();
if (m) {
this._initializeRequestHandler = Function.createDelegate(this, this._initializeRequest);
m.add_initializeRequest(this._initializeRequestHandler);
}
}
if ($telerik.isIE7) {
this.get_masterTableView()._hideInvisibleColumns();
var b = $telerik.getElementsByClassName(this.get_masterTableView().get_element(), "rgDetailTable");
for (var h = 0;
h < b.length;
h++) {
var d = $find(b[h].id);
if (d._owner == this) {
d._hideInvisibleColumns();
}
}
}
if (this._clientDataSourceID) {
this._clientSideBinding = new Telerik.Web.UI.GridClientSideBinding(this);
}
this.raise_gridCreated(new Sys.EventArgs());
if (this._shouldFocusOnPage) {
try {
this._shouldFocusOnPage = false;
this.get_element().focus();
} catch (e) {
}
}
this._initializePopUpEditForm();
if (typeof(this.ClientSettings.DataBinding.Location) != "undefined" && this.ClientSettings.DataBinding.Location != "" && !this.get_masterTableView()._virtualization) {
this._onCommandDelegate = Function.createDelegate(this, this._onCommand);
this.add_command(this._onCommandDelegate);
if (!this._onSuccessDelegate && !this._onFailDelegate) {
this._onSuccessDelegate = Function.createDelegate(this, this._onSuccess);
this._onFailDelegate = Function.createDelegate(this, this._onFail);
}
if (typeof(this.ClientSettings.DataBinding.SelectMethod) != "undefined" && this.ClientSettings.DataBinding.SelectMethod != "") {
this._dataBindingWithSelectMethod = true;
this._getData(this.ClientSettings.DataBinding.Location, this.ClientSettings.DataBinding.SelectMethod, this._getRequestData(), this._onSuccessDelegate, this._onFailDelegate);
} else {
if (typeof(this.ClientSettings.DataBinding.DataService) != "undefined" && typeof(this.ClientSettings.DataBinding.DataService.TableName) != "undefined" && this.ClientSettings.DataBinding.DataService.TableName != "") {
this._getDataServiceData(this._onSuccessDelegate, this._onFailDelegate);
}
}
}
if (this.ClientSettings.Virtualization.EnableVirtualization) {
Telerik.Web.UI.GridVirtualization._handleRowHeightChangingEvents(this);
this._onVirtualizationCommandDelegate = Function.createDelegate(this, this._onVirtualizationCommand);
this.add_command(this._onVirtualizationCommandDelegate);
if (this.get_masterTableView()._virtualization) {
this.get_masterTableView()._virtualization.repaint();
}
}
if (this.get_isUsingODataSource()) {
this._initializeODataSourceBinder();
this._onCommandODataSourceDelegate = Function.createDelegate(this, this._onCommandODataSource);
this.add_command(this._onCommandODataSourceDelegate);
}
var q = this._controlToFocus;
if (this.ClientSettings.AllowKeyboardNavigation && q != null && q != "") {
setTimeout(function () {
try {
var s = false;
var i = $find(q);
if (i == null) {
i = $get(q);
} else {
s = true;
}
if (i == null) {
i = document.getElementsByName(q.replace(/_/ig, "$"))[0];
}
if (i != null) {
if (i.focus) {
i.focus();
} else {
if (s) {
if (i._focused != undefined) {
i._focused = true;
}
if (i.setFocus) {
i.setFocus();
}
}
}
if (i.select) {
i.select();
}
}
} catch (r) {
}
}, 0);
}
if (this.get_enableAriaSupport()) {
this._initializeAriaSupport();
}
}, _initializePopUpEditForm: function () {
if (this._popUpIds && this._popUpIds != "") {
var m = eval(this._popUpIds);
var g, o = 20;
for (var f = 0;
f < m.length;
f++) {
var l = m[f];
var k = $get(l);
if (k) {
var a = new Sys.CancelEventArgs();
a.get_popUp = function () {
return k;
};
this.raise_popUpShowing(a);
if (a.get_cancel()) {
continue;
}
if (this._popUpSettings.Modal) {
var j = String.format("modalDivId_{0}", this.get_id());
if (!$get(j)) {
var h = document.createElement("div");
h.id = j;
h.style.width = document.documentElement.scrollWidth + "px";
h.style.height = document.documentElement.scrollHeight + "px";
h.className = String.format("GridModal_{0}", this.Skin);
this._onResizeDelegate = Function.createDelegate(this, this.onWindowResize);
var n = this;
if (navigator.userAgent.toLowerCase().indexOf("msie") != -1) {
setTimeout(function () {
$addHandler(window, "resize", n._onResizeDelegate);
}, 0);
} else {
$addHandler(window, "resize", this._onResizeDelegate);
}
h.style.top = h.style.left = 0;
h.style.position = "absolute";
h.style.backgroundColor = "threedshadow";
h.style.zIndex = this._popUpSettings.ZIndex - 10;
try {
h.style.opacity = "0.5";
} catch (c) {
}
if (typeof(h.style.filter) != "undefined") {
h.style.filter = "alpha(opacity=50);";
} else {
if (typeof(h.style.MozOpacity) != "undefined") {
h.style.MozOpacity = 1 / 2;
}
}
var d = document.getElementsByTagName("form")[0];
d.appendChild(h);
}
}
k.style.zIndex = this._popUpSettings.ZIndex;
g = o += 20;
if (k.style.left == "") {
k.style.left = Telerik.Web.UI.Grid.FindPosX(this.get_element()) + g + "px";
}
if (k.style.top == "") {
k.style.top = Telerik.Web.UI.Grid.FindPosY(this.get_element()) + o + "px";
}
k.style.display = "";
k.tabIndex = 0;
var b = k.getElementsByTagName("div")[0];
if ($telerik.isIE6) {
b.style.width = k.offsetWidth + "px";
}
this.resizeModalBackground();
if (k.offsetHeight != 0) {
k.getElementsByTagName("div")[4].style.height = k.offsetHeight - b.offsetHeight + "px";
}
this._popUpLocations[b.id] = parseInt(k.style.left) + "px," + parseInt(k.style.top) + "px";
this.updateClientState();
$addHandlers(b, {mousedown: Function.createDelegate(k, this._popUpMouseDown)});
$addHandlers(document, {mouseup: Function.createDelegate(k, this._popUpMouseUp)});
$addHandlers(document, {mouseout: Function.createDelegate(k, this._popUpMouseOut)});
if (this.ClientSettings.AllowKeyboardNavigation && this.ClientSettings.KeyboardNavigationSettings.EnableKeyboardShortcuts) {
$addHandler(k, "keypress", Function.createDelegate({
popUpForm: k,
keyMappings: this.ClientSettings.KeyboardNavigationSettings
}, this._popUpKeyDown));
}
$telerik.addExternalHandler(document, "mousemove", Function.createDelegate(k, this._popUpMouseMove));
}
}
}
}, _initializeCallback: function (a, b) {
WebForm_DoCallback(this.UniqueID, a, b, "", null, false);
}, _dataDivMouseDown: function (a) {
this._isTouchScrollInProgress = false;
var c = $telerik.getTouchTarget(a);
if (this._scrolling) {
if (c) {
var b = c.tagName.toLowerCase() == "td" && Telerik.Web.UI.Grid.IsChildOf(c, this.GridDataDiv);
var d = a.changedTouches || (a.originalEvent ? a.originalEvent.touches : a.rawEvent ? a.rawEvent.touches : false);
if (!b || (d && d.length > 1)) {
this._scrolling._dropDownTouchScroll.disable();
}
}
if (this.get_allowCellSelection()) {
this._scrolling._dropDownTouchScroll.enable();
}
}
}, _dataDivMouseUp: function (a) {
if (this._scrolling) {
if (this.get_allowCellSelection() && !this._isTouchScrollInProgress) {
this._scrolling._dropDownTouchScroll.disable();
} else {
this._scrolling._dropDownTouchScroll.enable();
}
}
}, _dataDivMouseMove: function (a) {
if (this.get_allowCellSelection() && this._scrolling) {
this._isTouchScrollInProgress = true;
this._scrolling._dropDownTouchScroll.enable();
}
}, _swipeStart: function (a) {
this._startTouchPoints = {};
this._endTouchPoints = {};
this._currentTouchPoints = {};
this._currentMovement = null;
this._validSwipe = true;
var d = a.changedTouches || (a.originalEvent ? a.originalEvent.touches : a.rawEvent ? a.rawEvent.touches : false);
if (d && d.length > 1) {
for (var b = 0;
b < d.length;
b++) {
var c = d[b];
this._startTouchPoints[c.identifier] = {
x: c.clientX,
y: c.clientY,
direction: Telerik.Web.UI.Grid.TouchPointDirection.None,
movement: Telerik.Web.UI.Grid.TouchPointMovement.None
};
}
this._currentTouchPoints = $telerik.$.extend({}, this._startTouchPoints);
}
}, _swipeMove: function (f) {
var g = f.originalEvent || f.rawEvent || f;
var n = g.touches || g.changedTouches;
var c = false;
var h = null;
if (n && n.length > 1) {
for (var j = 0;
j < n.length;
j++) {
var d = n[j];
if (this._currentTouchPoints[d.identifier]) {
var m = this._currentTouchPoints[d.identifier];
if (!m || m.movement == Telerik.Web.UI.Grid.TouchPointMovement.Inconsistent) {
continue;
}
d = {
identifier: n[j].identifier,
x: n[j].clientX,
y: n[j].clientY,
direction: Telerik.Web.UI.Grid.TouchPointDirection.None,
movement: Telerik.Web.UI.Grid.TouchPointMovement.None
};
var a = Math.abs(d.x - m.x);
var b = Math.abs(d.y - m.y);
if (a <= this._swipeThreshold && b <= this._swipeThreshold) {
continue;
}
var k = Telerik.Web.UI.Grid.detectTouchPointDirection(m, d, a - b);
var l = Telerik.Web.UI.Grid.detectTouchPointMovement(k);
d.movement = l;
if (m && m.movement != Telerik.Web.UI.Grid.TouchPointMovement.None) {
if (m.movement != l) {
d.movement = Telerik.Web.UI.Grid.TouchPointMovement.Inconsistent;
}
}
d.direction = k;
this._currentTouchPoints[d.identifier] = d;
if (j == 0) {
h = d.movement;
} else {
if (h == d.movement) {
c = true;
}
}
}
}
}
if (c) {
$telerik.cancelRawEvent(f.originalEvent);
return false;
}
}, _swipeEnd: function (f) {
var h = f.originalEvent || f.rawEvent || f;
var k = h.changedTouches;
if (k && k.length > 0 && Object.keys(this._currentTouchPoints).length > 0) {
var d = k[0];
var c = d.identifier;
if (!this._currentMovement) {
this._currentMovement = this._currentTouchPoints[c].movement;
}
if (!this._validSwipe) {
return;
}
if (this._currentTouchPoints[c] && this._startTouchPoints[c]) {
var g = this._currentTouchPoints[c];
this._endTouchPoints[c] = g;
var j = this._startTouchPoints[c];
var a = Math.abs(g.x - j.x);
var b = Math.abs(g.y - j.y);
var i = (a > this._swipeThreshold || b > this._swipeThreshold) && g.movement != Telerik.Web.UI.Grid.TouchPointMovement.Inconsistent && g.movement == this._currentMovement;
this._validSwipe = this._validSwipe && i;
}
if (this._validSwipe && Object.keys(this._startTouchPoints).length == Object.keys(this._endTouchPoints).length) {
if (this._currentMovement == Telerik.Web.UI.Grid.TouchPointMovement.Left) {
this.get_masterTableView().page("Next");
}
if (this._currentMovement == Telerik.Web.UI.Grid.TouchPointMovement.Right) {
this.get_masterTableView().page("Prev");
}
}
}
}, _initializeSubmitControls: function () {
this._submitControls = [{Name: "input", Type: "text"}];
}, _shouldFocusGridOnDocumentKeyDown: function (a, b) {
var c = a.srcElement || a.explicitOriginalTarget;
if ((a.ctrlKey && b == this.ClientSettings.KeyboardNavigationSettings.FocusKey) || ((b == this.ClientSettings.KeyboardNavigationSettings.ExpandDetailTableKey || b == this.ClientSettings.KeyboardNavigationSettings.CollapseDetailTableKey) && this.ClientSettings && this.ClientSettings.AllowKeyboardNavigation && c && c.id == this.get_element().id)) {
return true;
}
return false;
}, _shouldFocusGridOnDocKeyDownWithCellSelection: function (a, c) {
var b = false;
var d = a.srcElement || a.explicitOriginalTarget;
if (a.ctrlKey && c == this.ClientSettings.KeyboardNavigationSettings.FocusKey) {
b = true;
}
return b;
}, _documentKeyDown: function (b) {
b = b || window.event;
var c = b.keyCode || b.charCode;
if (this.get_allowCellSelection()) {
if (this._shouldFocusGridOnDocKeyDownWithCellSelection(b, c)) {
this.get_element().focus();
}
return;
}
if (this._shouldFocusGridOnDocumentKeyDown(b, c)) {
if (this.get_element().focus) {
this.get_element().focus();
if (this.ClientSettings.AllowKeyboardNavigation && !this._activeRow) {
if (this.get_masterTableView().get_dataItems().length > 0) {
var a = null;
if (this._selectedItemsInternal.length > 0) {
a = $find(this._selectedItemsInternal[0].id);
} else {
a = this.get_masterTableView().get_dataItems()[0];
}
if (a != null) {
this._setActiveRow(a.get_element(), b);
if (this.ClientSettings.Selecting && this.ClientSettings.Selecting.AllowRowSelect) {
this._selection._selectRowInternal(a.get_element(), b, false, true, true, false);
}
}
}
}
}
}
}, _attachMouseHandlers: function () {
$addHandlers(this.get_element(), {mouseover: Function.createDelegate(this, this._mouseover)});
$addHandlers(this.get_element(), {mouseout: Function.createDelegate(this, this._mouseout)});
}, _getDataServiceData: function (j, i, o) {
var b = new Sys.CancelEventArgs();
var h = this.ClientSettings.DataBinding.Location;
b.get_location = function () {
return h;
};
b.set_location = function (e) {
h = e;
};
var n = this.ClientSettings.DataBinding.DataService.TableName;
b.get_tableName = function () {
return n;
};
b.set_tableName = function (e) {
n = e;
};
var g = this.ClientSettings.DataBinding.DataService.FilterQueryOption;
b.get_filterQueryOption = function () {
return g;
};
b.set_filterQueryOption = function (e) {
g = e;
};
var m = this.ClientSettings.DataBinding.DataService.SortQueryOption;
b.get_sortQueryOption = function () {
return m;
};
b.set_sortQueryOption = function (e) {
m = e;
};
var k = this.get_masterTableView().getDataServiceQuery(b.get_tableName(), b.get_filterQueryOption(), b.get_sortQueryOption());
b.get_query = function () {
return k;
};
b.set_query = function (e) {
k = e;
};
var l = this._getDataResponseType();
b.get_responseType = function () {
return l;
};
b.set_responseType = function (e) {
l = e;
};
var c = this._isBoundToServiceType(Telerik.Web.UI.GridClientDataServiceType.OData) ? "$callback" : null;
b.get_callback = function () {
return c;
};
b.set_callback = function (e) {
c = e;
};
this.raise_dataBinding(b);
if (b.get_cancel()) {
return false;
}
var p = (typeof(o) != "undefined") ? o : String.format("{0}/{1}", b.get_location(), b.get_query());
try {
var d = function (e, q) {
return e.replace(/\\'/g, "'");
};
if (l === "jsonp") {
d = null;
}
var a = {
type: "GET",
url: p,
contentType: "application/json; charset=utf-8",
dataFilter: d,
dataType: l,
jsonp: c,
success: j,
error: i
};
$telerik.$.ajax(a);
} catch (f) {
throw new Error(f);
}
}, _getData: function (d, g, f, i, h) {
var b = Sys.Serialization.JavaScriptSerializer.deserialize(f);
var a = new Sys.CancelEventArgs();
a.get_location = function () {
return d;
};
a.set_location = function (e) {
d = e;
};
a.get_methodName = function () {
return g;
};
a.set_methodName = function (e) {
g = e;
};
a.get_methodArguments = function () {
return b;
};
a.set_methodArguments = function (e) {
b = e;
};
this.raise_dataBinding(a);
if (a.get_cancel()) {
return false;
}
try {
$telerik.$.ajax({
type: "POST",
url: a.get_location() + "/" + a.get_methodName(),
data: Sys.Serialization.JavaScriptSerializer.serialize(b),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: i,
error: h
});
} catch (c) {
throw new Error(c);
}
}, _getCacheKey: function (a) {
return String.format("{0}{1}{2}{3}", a.get_currentPageIndex(), a.get_pageSize(), a.get_sortExpressions().toString(), a.get_filterExpressions().toString());
}, _getRequestData: function (e, b) {
var f = this.get_masterTableView(), c = {};
if (typeof e !== "undefined" && typeof b !== "undefined") {
c[this.ClientSettings.DataBinding.StartRowIndexParameterName] = e;
c[this.ClientSettings.DataBinding.MaximumRowsParameterName] = b;
} else {
c[this.ClientSettings.DataBinding.StartRowIndexParameterName] = f.get_currentPageIndex() * f.get_pageSize();
if (f._data && f._data.AllowPaging) {
c[this.ClientSettings.DataBinding.MaximumRowsParameterName] = f.get_pageSize();
} else {
c[this.ClientSettings.DataBinding.MaximumRowsParameterName] = Math.pow(2, 31) - 1;
}
}
var d = null;
if (typeof(this.ClientSettings.DataBinding.SortParameterType) == "undefined") {
d = f.get_sortExpressions().toList();
} else {
if (this.ClientSettings.DataBinding.SortParameterType == Telerik.Web.UI.GridClientDataBindingParameterType.String) {
d = f.get_sortExpressions().toString();
} else {
if (this.ClientSettings.DataBinding.SortParameterType == Telerik.Web.UI.GridClientDataBindingParameterType.Linq) {
d = f.get_sortExpressions().toString();
} else {
if (this.ClientSettings.DataBinding.SortParameterType == Telerik.Web.UI.GridClientDataBindingParameterType.Oql) {
d = f.get_sortExpressions().toString();
}
}
}
}
c[this.ClientSettings.DataBinding.SortParameterName] = d;
var a = null;
if (typeof(this.ClientSettings.DataBinding.FilterParameterType) == "undefined") {
a = f.get_filterExpressions().toList();
} else {
if (this.ClientSettings.DataBinding.FilterParameterType == Telerik.Web.UI.GridClientDataBindingParameterType.String) {
a = f.get_filterExpressions().toString();
} else {
if (this.ClientSettings.DataBinding.FilterParameterType == Telerik.Web.UI.GridClientDataBindingParameterType.Linq) {
a = f.get_filterExpressions().toDynamicLinq();
} else {
if (this.ClientSettings.DataBinding.FilterParameterType == Telerik.Web.UI.GridClientDataBindingParameterType.Oql) {
a = f.get_filterExpressions().toOql();
}
}
}
}
c[this.ClientSettings.DataBinding.FilterParameterName] = a;
return Sys.Serialization.JavaScriptSerializer.serialize(c);
}, _isBoundToServiceType: function (a) {
if (this.ClientSettings && this.ClientSettings.DataBinding && this.ClientSettings.DataBinding.DataService) {
if (typeof(this.ClientSettings.DataBinding.DataService.Type) !== "undefined") {
return this.ClientSettings.DataBinding.DataService.Type === a;
} else {
return a === Telerik.Web.UI.GridClientDataServiceType.ADONet;
}
}
return false;
}, _getDataResponseType: function () {
if (this.ClientSettings && this.ClientSettings.DataBinding && this.ClientSettings.DataBinding.ResponseType) {
switch (this.ClientSettings.DataBinding.ResponseType) {
case Telerik.Web.UI.GridClientDataResponseType.JSONP:
return "jsonp";
default:
return "json";
}
}
return "json";
}, _onSuccess: function (f) {
if (typeof(f) != "object" || f == null) {
return;
}
if (typeof(f.d) != "undefined") {
f = f.d;
}
var i = this.get_masterTableView();
if (this.ClientSettings.DataBinding.EnableCaching && !i._virtualization) {
var h = this._getCacheKey(i);
if (!this._cache) {
this._cache = {};
}
if (!this._cache[h]) {
this._cache[h] = f;
}
}
var g = true;
var d = f;
if (d.get_data) {
d = d.get_data();
}
var b = 0;
var e;
var c;
if (typeof(this.ClientSettings.DataBinding.DataPropertyName) == "undefined") {
e = "Data";
} else {
e = this.ClientSettings.DataBinding.DataPropertyName;
}
if (typeof(this.ClientSettings.DataBinding.CountPropertyName) == "undefined") {
c = "Count";
} else {
c = this.ClientSettings.DataBinding.CountPropertyName;
}
if (this._isBoundToServiceType(Telerik.Web.UI.GridClientDataServiceType.OData) && f.results) {
d = f.results;
if (!isNaN(f.__count)) {
b = f.__count;
g = false;
} else {
if (!i.get_allowPaging()) {
b = 0;
g = false;
}
}
} else {
if (typeof(f[e]) != "undefined" && typeof(f[c]) != "undefined") {
g = false;
d = f[e];
b = f[c];
}
}
if (g) {
if (typeof(this.ClientSettings.DataBinding.SelectCountMethod) != "undefined" && this.ClientSettings.DataBinding.SelectCountMethod != "") {
this._onSelectCountSuccessDelegate = Function.createDelegate(this, this._onSelectCountSuccess);
if (typeof(this.ClientSettings.DataBinding.DataService) != "undefined" && typeof(this.ClientSettings.DataBinding.DataService.TableName) != "undefined" && this.ClientSettings.DataBinding.DataService.TableName != "") {
var k = i.get_filterExpressions().toString("it").replace(/'/g, '"').replace(/\[/g, "").replace(/\]/g, "");
var j = String.format("{0}/{1}?where='{2}'", this.ClientSettings.DataBinding.Location, this.ClientSettings.DataBinding.SelectCountMethod, k);
this._getDataServiceData(this._onSelectCountSuccessDelegate, this._onFailDelegate, j);
} else {
this._getData(this.ClientSettings.DataBinding.Location, this.ClientSettings.DataBinding.SelectCountMethod, "{}", this._onSelectCountSuccessDelegate, this._onFailDelegate);
}
}
} else {
i.set_virtualItemCount(b);
}
var a = new Telerik.Web.UI.GridDataSourceResolvedEventArgs(d);
this.raise_dataSourceResolved(a);
d = a.get_data();
if (i.get_virtualItemCount() == 0) {
i._updatePager();
}
if (!i._virtualization) {
i.set_dataSource(d);
i.dataBind();
}
}, _onFail: function (g) {
if (typeof(g) != "undefined") {
var c = new Sys.EventArgs();
if (typeof(g.responseText) != "undefined") {
var f;
try {
f = Sys.Serialization.JavaScriptSerializer.deserialize(g.responseText);
} catch (a) {
f = null;
}
if (!f) {
return;
}
if (f.error) {
var b = f.error;
var d = (b.message && b.message.value) ? b.message.value : "";
c = this._constructErrorArgsObject(d, "", "");
} else {
c = this._constructErrorArgsObject(f.Message, f.ExceptionType, f.StackTrace);
}
}
}
this.raise_dataBindingFailed(c);
}, _constructErrorArgsObject: function (c, b, d) {
var a = new Sys.EventArgs();
a.get_message = function () {
return c;
};
a.get_exceptionType = function () {
return b;
};
a.get_stackTrace = function () {
return d;
};
return a;
}, _onSelectCountSuccess: function (a) {
if (typeof(a.d) != "undefined") {
a = a.d;
}
if (typeof(a[this.ClientSettings.DataBinding.SelectCountMethod]) != "undefined") {
a = a[this.ClientSettings.DataBinding.SelectCountMethod];
}
var b = this.get_masterTableView();
b.set_virtualItemCount(a);
}, _onCommandODataSource: function (b, a) {
a.set_cancel(true);
if (this.get_isUsingODataSource()) {
this._onDataNeeded();
}
}, _onCommand: function (c, a) {
a.set_cancel(true);
var e = this.get_masterTableView();
if (this.ClientSettings.DataBinding.EnableCaching) {
var d = this._getCacheKey(e);
if (!this._cache) {
this._cache = {};
}
if (this._cache[d]) {
this._onSuccess(this._cache[d]);
return;
}
}
if (typeof(this.ClientSettings.DataBinding.SelectMethod) != "undefined" && this.ClientSettings.DataBinding.SelectMethod != "") {
this._getData(this.ClientSettings.DataBinding.Location, this.ClientSettings.DataBinding.SelectMethod, this._getRequestData(), this._onSuccessDelegate, this._onFailDelegate);
} else {
if (typeof(this.ClientSettings.DataBinding.DataService) != "undefined" && typeof(this.ClientSettings.DataBinding.DataService.TableName) != "undefined" && this.ClientSettings.DataBinding.DataService.TableName != "") {
var b = e.getDataServiceQuery(this.ClientSettings.DataBinding.DataService.TableName, this.ClientSettings.DataBinding.DataService.FilterQueryOption, this.ClientSettings.DataBinding.DataService.SortQueryOption);
var f = String.format("{0}/{1}", this.ClientSettings.DataBinding.Location, b);
this._getDataServiceData(this._onSuccessDelegate, this._onFailDelegate);
}
}
}, _onVirtualizationCommand: function (d, a) {
var e = a.get_tableView(), f = e._virtualization, c = e.get_pageSize(), b = e.get_currentPageIndex();
if (f && a.get_commandName() === "Page") {
a.set_cancel(true);
f.scrollToIndex(c * b);
f.select(c * b);
}
}, repaint: function () {
if (!this.canRepaint()) {
this.add_parentShown(this.get_element());
return;
} else {
this._clearParentShowHandlers();
}
if (!this._scrolling && this.GridDataDiv) {
this._scrolling = $find(this.get_id())._scrolling;
}
if (Telerik.Web.UI.GridScrolling && this._scrolling) {
if (this._scrolling._shouldInitializeLayoutAndScroll) {
this._scrolling._shouldInitializeLayoutAndScroll = false;
this._scrolling._initializeDimensions();
this._scrolling._initializeScroll();
} else {
this._scrolling.onWindowResize();
}
} else {
if (this._repaintWidthFlag) {
this.get_element().style.width = "";
}
var a = 0;
if (!!this._masterClientID && this.get_masterTableView() != null) {
a = this.get_masterTableView().get_element().offsetWidth;
}
if (this.get_element().offsetWidth < a) {
this.get_element().style.width = a + "px";
this._repaintWidthFlag = true;
}
}
if (this._masterClientID && this.get_masterTableView() && this.get_masterTableView()._virtualization) {
this.get_masterTableView()._virtualization.repaint();
}
}, onWindowResize: function () {
this.resizeModalBackground();
}, resizeModalBackground: function () {
var d = String.format("modalDivId_{0}", this.get_id());
var c = $get(d);
if (c) {
c.style.width = "1px";
c.style.height = "1px";
var b = document.documentElement;
var a = document.body;
if ($telerik.isIE8 && ((b.scrollWidth < b.offsetWidth && b.scrollHeight > b.offsetHeight) || (b.scrollWidth < b.offsetWidth && b.scrollHeight < b.offsetHeight) || (b.scrollHeight < b.offsetHeight && b.scrollWidth > b.offsetWidth))) {
c.style.width = b.scrollWidth + "px";
c.style.height = b.scrollHeight + "px";
} else {
c.style.width = Math.max(Math.max(b.scrollWidth, a.scrollWidth), Math.max(b.offsetWidth, a.offsetWidth)) + "px";
c.style.height = Math.max(Math.max(b.scrollHeight, a.scrollHeight), Math.max(b.offsetHeight, a.offsetHeight)) + "px";
}
}
}, _popUpKeyDown: function (b) {
var d = b.keyCode || b.charCode;
var c = (d == this.keyMappings.ExitEditInsertModeKey);
var i = (d == this.keyMappings.UpdateInsertItemKey);
var h = Telerik.Web.UI.Grid.GetFirstParentByTagName(this.popUpForm, "tr").previousSibling;
if (h.id == "") {
return;
}
var g = h.id.split("__")[0];
var f = $find(g);
if (!f) {
return;
}
if (!f.get_owner()._canHandleKeyboardAction(b)) {
return;
}
if (c) {
var a = new Telerik.Web.UI.GridKeyPressEventArgs(b);
f.get_owner().raise_keyPress(a);
if (!a.get_cancel()) {
f.cancelUpdate(h);
}
b.preventDefault();
b.stopPropagation();
} else {
if (i) {
var a = new Telerik.Web.UI.GridKeyPressEventArgs(b);
f.get_owner().raise_keyPress(a);
if (!a.get_cancel()) {
f.updateItem(h);
}
b.preventDefault();
b.stopPropagation();
}
}
}, _popUpMouseDown: function (a) {
this.canMove = true;
this.originalLeft = this.offsetLeft - a.clientX;
this.originalTop = this.offsetTop - a.clientY;
if (!($telerik.isFirefox && a.button == 2 && navigator.userAgent.indexOf("Mac"))) {
Telerik.Web.UI.Grid.ClearDocumentEvents();
}
return false;
}, _popUpMouseOut: function (a) {
if (!this.canMove) {
return;
}
var b;
if (a.rawEvent.relatedTarget) {
b = a.rawEvent.relatedTarget;
} else {
b = a.rawEvent.toElement;
}
if (!b) {
this.canMove = false;
Telerik.Web.UI.Grid.RestoreDocumentEvents();
}
return false;
}, _popUpMouseUp: function (b) {
if (!this.canMove) {
return;
}
this.canMove = false;
var a = this.getElementsByTagName("div")[0];
var d = a.id;
var g = d.split("__")[0];
var f = $find(g);
if (f) {
var c = f._owner;
c._popUpLocations[d] = this.style.left + "," + this.style.top;
c.updateClientState();
c.resizeModalBackground();
}
Telerik.Web.UI.Grid.RestoreDocumentEvents();
}, _popUpMouseMove: function (a) {
if (this.canMove) {
this.style.left = a.clientX + this.originalLeft + "px";
this.style.top = a.clientY + this.originalTop + "px";
return false;
}
}, _isRowDragged: function (a) {
return $get(String.format("{0}_DraggedRows", this.get_id())) != null;
}, _mouseDown: function (d) {
if (!$telerik.isTouchDevice && d.rawEvent.button != Sys.UI.MouseButton.leftButton && this._draggedRow) {
if (!this.get_masterTableView()) {
this._clearDrag();
return;
}
this._draggedRow.parentNode.removeChild(this._draggedRow);
this._draggedRow = null;
this._clearDrag();
return;
}
var r;
if ($telerik.isTouchDevice) {
r = $telerik.getTouchTarget(d);
if (r.tagName && r.tagName.toLowerCase() == "td" && this.get_events().getHandler("rowDblClick")) {
$telerik.cancelRawEvent(d);
}
} else {
r = Telerik.Web.UI.Grid.GetCurrentElement(d);
}
var j = r.id && r.id.indexOf("RowDragHandle") > -1;
if (this.ClientSettings.Scrolling.AllowScroll && $telerik.isTouchDevice && this.ClientSettings.AllowRowsDragDrop && !j && r.tagName.toLowerCase() == "td" && Telerik.Web.UI.Grid.IsChildOf(r, this.GridDataDiv)) {
return $telerik.cancelRawEvent();
}
var o = Telerik.Web.UI.Grid.GetFirstParentByTagName(r, "tr");
if (!o || o.id == "") {
return;
}
var k = this.get_masterTableView()._getRowByIndexOrItemIndexHierarchical(o);
var n = k.id.split("__")[0];
var m = $find(n);
if (!m || (m._data._useDragColumn && !j)) {
return;
}
if ((!this._canRiseRowEvent(d) && !j) || (this._isRowResize && this._isRowResize == true)) {
return;
}
if (this._selectedIndexes.length == 0 && this.get_allowMultiRowSelection() && this.ClientSettings.Selecting.EnableDragToSelectRows && !j) {
return;
}
if (this.get_allowMultiRowSelection() && (d.ctrlKey || (d.rawEvent && d.rawEvent.metaKey))) {
return;
}
if (this._draggedItems) {
this._draggedItems = [];
}
var g = false;
for (var h = 0;
h < this._selectedItemsInternal.length;
h++) {
if (this._selectedItemsInternal[h].id == o.id) {
g = true;
break;
}
}
if (!g) {
var l = this.get_allowMultiRowSelection() && !this.ClientSettings.Selecting.EnableDragToSelectRows;
if (Telerik.Web.UI.GridSelection && this._selection && (l || !this.get_allowMultiRowSelection() || j)) {
var f = this.ClientSettings.EnablePostBackOnRowClick;
this.ClientSettings.EnablePostBackOnRowClick = false;
this._selection._click(d);
this.ClientSettings.EnablePostBackOnRowClick = f;
if (this._selectedItemsInternal.length == 0 || this._selectedItemsInternal[0].id != o.id) {
return;
}
} else {
return;
}
}
this._canMoveRow = true;
this._originalDragItem = o;
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(o, d);
this.raise_rowDragStarted(a);
if (a.get_cancel()) {
return;
}
this._draggedRow = document.createElement("div");
this._draggedRow.id = String.format("{0}_DraggedRows", this.get_id());
this._draggedRow.style.position = "absolute";
this._draggedRow.className = this.get_element().className;
var b = [];
var p = m.get_selectedItems();
for (var h = 0;
h < p.length;
h++) {
if (Array.contains(m.get_dataItems(), p[h])) {
var c = p[h].get_element();
if (this.get_enableAriaSupport()) {
c.removeAttribute("aria-dropeffect");
c.setAttribute("aria-grabbed", "true");
}
b[b.length] = String.format("<tr class='{0}'>", c.className);
b[b.length] = c.innerHTML;
b[b.length] = "</tr>";
Array.add(this._draggedItems, p[h]);
}
}
this._draggedRow.innerHTML = String.format("<table class='{0}'><tbody>{1}</tbody></table>", o.parentNode.parentNode.className, b.join(""));
var q = this._draggedRow.getElementsByTagName("table")[0];
if (this._draggedRow.mergeAttributes) {
this._draggedRow.mergeAttributes(this.get_element());
} else {
Telerik.Web.UI.Grid.CopyAttributes(this._draggedRow, this.get_element());
}
this._draggedRow.className += String.format(" GridDraggedRows GridDraggedRows_{0}", this.Skin);
this._draggedRow.style.height = "";
if (q.mergeAttributes) {
q.mergeAttributes(o.parentNode.parentNode);
} else {
Telerik.Web.UI.Grid.CopyAttributes(q, o.parentNode.parentNode);
}
q.style.height = "";
q.style.margin = "";
this._draggedRow.style.zIndex = 99999;
this._draggedRow.style.display = "none";
this._draggedRow.style.width = this.get_element().offsetWidth + "px";
document.body.insertBefore(this._draggedRow, document.body.firstChild);
this._createDropClue();
if (!($telerik.isFirefox && d.button == 2 && navigator.userAgent.indexOf("Mac"))) {
Telerik.Web.UI.Grid.ClearDocumentEvents();
}
return false;
}, _createDropClue: function () {
this._dropClue = document.createElement("div");
document.body.appendChild(this._dropClue);
this._dropClue.style.position = "absolute";
this._dropClue.style.height = "5px";
}, _positionDropClue: function (c) {
if (this._dropClue == c.target) {
return;
}
if (!this.get_masterTableView()) {
return;
}
var a;
if ($telerik.isTouchDevice) {
a = $telerik.getTouchTarget(c);
} else {
a = Telerik.Web.UI.Grid.GetCurrentElement(c);
}
var b = null;
if (a) {
var i = Telerik.Web.UI.Grid.GetFirstParentByTagName(a, "tr");
if (i && i.id != "") {
var h = this._getParentRadGridControl(a);
if (Telerik.Web.UI.Grid.IsChildOf(a, this.get_element())) {
if (i != this._originalDragItem) {
b = this.get_masterTableView()._getRowByIndexOrItemIndexHierarchical(i);
}
} else {
if (h) {
if (!h.get_masterTableView()) {
return;
}
var i = Telerik.Web.UI.Grid.GetFirstParentByTagName(a, "tr");
b = h.get_masterTableView()._getRowByIndexOrItemIndexHierarchical(i);
}
}
} else {
if (i && i.className && i.className.indexOf("rgNoRecords") != -1) {
b = i;
}
}
}
if (!b) {
this._dropClue.style.visibility = "hidden";
return;
}
this._dropClue.row = b;
this._dropClue.style.width = b.offsetWidth + "px";
var g = b;
var d = $telerik.getLocation(g);
this._dropClue.style.left = d.x + "px";
var f;
if ($telerik.isTouchDevice) {
f = $telerik.getTouchEventLocation(c);
} else {
f = this._getMousePosition(c);
}
this._dropClue.style.display = "";
this._dropClue.style.visibility = "visible";
if (f.y < (d.y + (g.offsetHeight / 2))) {
this._dropClue.style.top = (d.y) + "px";
if (this.Skin != "") {
this._dropClue.className = String.format("GridItemDropIndicator GridItemDropIndicator_{0}", this.Skin);
} else {
this._dropClue.style.borderTop = "1px dotted black";
this._dropClue.style["font-size"] = "3px";
this._dropClue.style["line-height"] = "3px";
this._dropClue.style.height = "1px";
this._dropClue.className = "GridItemDropIndicator";
}
this._draggingPosition = "above";
} else {
this._dropClue.style.top = (d.y + g.offsetHeight) + "px";
if (this.Skin != "") {
this._dropClue.className = String.format("GridItemDropIndicator GridItemDropIndicator_{0}", this.Skin);
} else {
this._dropClue.style.borderTop = "1px dotted black";
this._dropClue.style["font-size"] = "3px";
this._dropClue.style["line-height"] = "3px";
this._dropClue.style.height = "1px";
this._dropClue.className = "GridItemDropIndicator";
}
this._draggingPosition = "below";
}
}, _getMousePosition: function (a) {
var d = $telerik.getScrollOffset(document.body, true);
var b = a.clientX;
var c = a.clientY;
b += d.x;
c += d.y;
return {x: b, y: c};
}, _mouseUp: function (m) {
this._canMoveRow = false;
if (this._draggedRow) {
if (!this.get_masterTableView()) {
this._clearDrag();
return;
}
this._draggedRow.parentNode.removeChild(this._draggedRow);
this._draggedRow = null;
var c;
if ($telerik.isTouchDevice) {
c = $telerik.getTouchTarget(m);
} else {
c = Telerik.Web.UI.Grid.GetCurrentElement(m);
}
if (c) {
if (c == this._dropClue) {
c = this._dropClue.row;
} else {
if (c.id && c.id.indexOf("_GridData") != -1) {
var F = $find(c.id.replace("_GridData", ""));
if (F && Object.getType(F).getName() == "Telerik.Web.UI.RadGrid") {
var x = F.get_masterTableView().get_element().rows;
if (x.length > 0) {
c = x[x.length - 1].cells[0];
this._draggingPosition = "below";
}
}
}
}
var h = this._draggedItems;
var C = Telerik.Web.UI.Grid.GetFirstParentByTagName(c, "tr");
if (C == this._originalDragItem) {
if (this.get_enableAriaSupport()) {
for (var t = 0;
t < h.length;
t++) {
var l = h[t].get_element();
l.removeAttribute("aria-grabbed");
l.setAttribute("aria-dropeffect", "move");
}
}
this._clearDrag();
return;
}
var B = this._draggingPosition;
if (C && C.id == "") {
C = null;
B = null;
}
var o = new Telerik.Web.UI.GridDragDropCancelEventArgs(C, m, h, c, null, B);
this.raise_rowDropping(o);
if (!o.get_cancel()) {
var A = this._getParentRadGridControl(c);
if (A) {
var D = Telerik.Web.UI.Grid.GetFirstParentByTagName(c, "tr");
if (!D || D == this._originalDragItem || !A.get_masterTableView()) {
this._clearDrag();
return;
}
var d = D;
var y = A.get_masterTableView()._data.UniqueID;
if (D.id != "") {
d = A.get_masterTableView()._getRowByIndexOrItemIndexHierarchical(D);
var g = $find(d.id.split("__")[0]);
if (g) {
y = g._data.UniqueID;
}
} else {
var n = false;
if (A.get_masterTableView().get_element().tBodies.length > 0) {
for (var t = 0, w = A.get_masterTableView().get_element().tBodies[0].rows.length;
t < w;
t++) {
if (D == A.get_masterTableView().get_element().tBodies[0].rows[t]) {
n = true;
break;
}
var s = A.get_masterTableView().get_element().tBodies[0].rows[t].getElementsByTagName("table");
for (var u = 0, v = s.length;
u < v;
u++) {
if (s[u] && this._isChildRowElement(D, s[u])) {
var E = $find(s[u].id);
if (E) {
y = E._data.UniqueID;
}
n = true;
break;
}
}
if (n) {
break;
}
}
}
if (!n) {
return;
}
}
var h = this._draggedItems;
var a = null;
if (d.id != "") {
a = new Telerik.Web.UI.GridDragDropCancelEventArgs(d, m, h, null, A, this._draggingPosition);
} else {
var z = Telerik.Web.UI.Grid.GetFirstParentRowWithID(d);
if (z != null && z.id != "") {
d = z;
a = new Telerik.Web.UI.GridDragDropCancelEventArgs(d, m, h, null, A, this._draggingPosition);
} else {
a = new Telerik.Web.UI.GridDragDropCancelEventArgs(null, m, h, null, A, this._draggingPosition);
}
}
this.raise_rowDropped(a);
this._draggedItemsIndexes = [];
for (var q = 0;
q < h.length;
q++) {
Array.add(this._draggedItemsIndexes, h[q]._itemIndexHierarchical);
}
this.updateClientState();
var f = d.id.split("__")[1];
var b = String.format("{0},{1},{2},{3}", f, A.UniqueID, this._draggingPosition, y);
this.get_masterTableView().fireCommand("RowDropped", b);
} else {
var p = o.get_destinationHtmlElement();
var h = this._draggedItems;
var a = new Telerik.Web.UI.GridDragDropCancelEventArgs(null, m, h, p, null, null);
this.raise_rowDropped(a);
this._draggedItemsIndexes = [];
for (var q = 0;
q < h.length;
q++) {
Array.add(this._draggedItemsIndexes, h[q]._itemIndexHierarchical);
}
this.updateClientState();
if (p.id) {
var b = String.format("{0},{1},{2},{3}", p.id, "", "", "");
}
this.get_masterTableView().fireCommand("RowDroppedHtml", b);
}
}
}
Telerik.Web.UI.Grid.RestoreDocumentEvents();
}
this._clearDrag();
}, _clearDrag: function () {
if (this._dropClue) {
document.body.removeChild(this._dropClue);
this._dropClue = null;
}
if (this._draggedItems) {
this._draggedItems = [];
}
this._draggingPosition = "above";
Telerik.Web.UI.Grid.RestoreDocumentEvents();
}, _isChildRowElement: function (c, d) {
for (var a = 0, b = d.tBodies[0].rows.length;
a < b;
a++) {
if (c == d.tBodies[0].rows[a]) {
return true;
}
}
return false;
}, _getParentRadGridControl: function (b) {
while (b) {
if (b.id && b.id != "") {
try {
var c = $find(b.id);
if (c && Object.getType(c).getName() == "Telerik.Web.UI.RadGrid") {
return c;
}
} catch (a) {
}
}
b = b.parentNode;
}
return null;
}, _cancelEvent: function (a) {
return false;
}, _mouseMove: function (b) {
if (this._canMoveRow && this._draggedRow) {
var a = new Sys.EventArgs();
a.get_domEvent = function () {
return b;
};
this.raise_rowDragging(a);
this._draggedRow.style.display = "";
this._draggedRow.style.position = "absolute";
Telerik.Web.UI.Grid.PositionDragElement(this._draggedRow, b);
this._positionDropClue(b);
if (this.ClientSettings.Scrolling.AllowScroll && this.GridDataDiv && this.ClientSettings.AllowAutoScrollOnDragDrop) {
this._autoScroll();
}
if ($telerik.isTouchDevice) {
$telerik.cancelRawEvent(b);
}
return false;
}
}, _autoScroll: function () {
var j, a;
var d = this.GridDataDiv;
if (!this._draggedRow || !this.GridDataDiv) {
return;
}
var b = $telerik.getLocation(this._draggedRow);
j = $telerik.getLocation(d).y;
a = j + d.offsetHeight;
var h = d.scrollTop <= 0;
var g = d.scrollTop >= (d.scrollHeight - d.offsetHeight + 16);
var f = b.y - j;
var e = a - b.y;
var c = this;
if (f < 50 && !h) {
var i = (10 - (f / 5));
d.scrollTop = d.scrollTop - i;
window.setTimeout(function () {
c._autoScroll();
}, 100);
} else {
if (e < 50 && !g) {
var i = (10 - (e / 5));
d.scrollTop = d.scrollTop + i;
window.setTimeout(function () {
c._autoScroll(this._mousePos);
}, 100);
}
}
}, _fillSelectedCellsIndexes: function () {
if (this._selectedCellsInternal.length > 0) {
var a = null;
for (var b = 0;
b < this._selectedCellsInternal.length;
b++) {
a = this._selectedCellsInternal[b].cellIndex;
if (!Array.contains(this._selectedCellsIndexes, a)) {
Array.add(this._selectedCellsIndexes, a);
}
}
}
}, _fillUnselectableItemsIndexes: function () {
var c = this._unselectableItemsInternal;
if (c.length > 0) {
var a = null;
for (var b = 0;
len = c.length, b < len;
b++) {
a = c[b].itemIndex;
if (!Array.contains(c, a)) {
Array.add(this._unselectableItemsIndexes, a);
}
}
}
}, dispose: function () {
var h = $get(String.format("modalDivId_{0}", this.get_id()));
if (h) {
h.parentNode.removeChild(h);
}
if (this._onResizeDelegate) {
try {
$removeHandler(window, "resize", this._onResizeDelegate);
this._onResizeDelegate = null;
} catch (c) {
}
}
if (this._gridItemResizer) {
this._gridItemResizer.dispose();
}
if (this._popUpIds && this._popUpIds != "") {
var a = eval(this._popUpIds);
for (var g = 0;
g < a.length;
g++) {
var d = $get(a[g]);
if (d) {
var b = d.getElementsByTagName("div");
if (b.length > 0) {
$clearHandlers(b[0]);
}
}
}
}
this.raise_gridDestroying(new Sys.EventArgs());
if (this._filterCheckListClientID && this._checkListItemsRequestedDelegate) {
var f = $find(this._filterCheckListClientID);
if (f) {
f.remove_itemsRequested(this._checkListItemsRequestedDelegate);
this._checkListItemsRequestedDelegate = null;
}
}
this._detachDomEvents();
$clearHandlers(this.get_element());
this._events = null;
if (this._batchEditing) {
this._batchEditing.dispose();
}
if (this._selection) {
this._selection.dispose();
}
if (this._scrolling) {
this._scrolling.dispose();
}
if (this._filterMenu) {
if (this._onFilterMenuClick) {
this._filterMenu.remove_itemClicked(this._onFilterMenuClicking);
this._filterMenu.remove_itemClicked(this._onFilterMenuClick);
this._filterMenu.remove_hidden(this._onFilterMenuHiddenDelegate);
this._onFilterMenuHiddenDelegate = null;
}
this._filterMenu = null;
}
if (this._headerContextMenu) {
this._headerContextMenu = null;
}
if (Sys.WebForms && Sys.WebForms.PageRequestManager) {
var j = Sys.WebForms.PageRequestManager.getInstance();
if (j && this._initializeRequestHandler) {
j.remove_initializeRequest(this._initializeRequestHandler);
}
}
this._initializeRequestHandler = null;
if (this.GridDataDiv) {
$clearHandlers(this.GridDataDiv);
}
if (this.GridHeaderDiv) {
$clearHandlers(this.GridHeaderDiv);
}
if (this.GridFooterDiv) {
$clearHandlers(this.GridFooterDiv);
}
if (this._groupPanel && this._groupPanel.get_element()) {
$clearHandlers(this._groupPanel.get_element());
}
this._draggedItems = null;
this.Control = null;
this.GridDataDiv = null;
this.GridHeaderDiv = null;
this.GridFooterDiv = null;
this.PagerControl = null;
this.TopPagerControl = null;
this.MasterTableView = null;
this.MasterTableViewHeader = null;
this.MasterTableViewFooter = null;
this._hidedColumns = [];
this._showedColumns = [];
if (this.get_isUsingODataSource()) {
this._flatBinder._source.remove_requestSucceeded(this._oDataRequestSucceededDelegate);
this._oDataRequestSucceededDelegate = null;
}
if (this.ClientSettings.AllowKeyboardNavigation && this._documentKeyDownDelegate) {
$telerik.removeExternalHandler(document, "keydown", this._documentKeyDownDelegate);
this._documentKeyDownDelegate = null;
}
if (this.ClientSettings.AllowRowsDragDrop) {
if ($telerik.isTouchDevice) {
$telerik.removeMobileHandler(this.get_element(), "mousedown", this._onMouseDownDelegate);
this._onMouseDownDelegate = null;
}
$telerik.removeMobileHandler(document, "mouseup", this._documentMouseUpDelegate, null, true);
this._documentMouseUpDelegate = null;
$telerik.removeMobileHandler(document, "mousemove", this._documentMouseMoveDelegate, null, true);
this._documentMouseMoveDelegate = null;
}
if (this.ClientSettings.Scrolling.AllowScroll && $telerik.isTouchDevice) {
$telerik.removeMobileHandler(this.GridDataDiv, "mousedown", this._dataDivMouseDownDelegate);
this._dataDivMouseDownDelegate = null;
$telerik.removeMobileHandler(this.GridDataDiv, "mouseup", this._dataDivMouseUpDelegate);
this._dataDivMouseUpDelegate = null;
$telerik.removeMobileHandler(this.GridDataDiv, "mousemove", this._dataDivMouseMoveDelegate);
this._dataDivMouseMoveDelegate = null;
}
if ($telerik.isTouchDevice) {
$telerik.removeMobileHandler(this.GridDataDiv, "mousedown", this._swipeStartDelegate);
this._swipeStartDelegate = null;
$telerik.removeMobileHandler(this.GridDataDiv, "mouseup", this._swipeEndDelegate);
this._swipeEndDelegate = null;
$telerik.removeMobileHandler(this.GridDataDiv, "mousemove", this._swipeMoveDelegate);
this._swipeMoveDelegate = null;
}
window[this.ClientID] = null;
Telerik.Web.UI.RadGrid.callBaseMethod(this, "dispose");
}, _initializeRequest: function (f, a) {
var e = a.get_postBackElement();
if (a.get_postBackElement() == this.get_element() || Telerik.Web.UI.Grid.IsChildOf(e, this.get_element())) {
if (this._statusLabelID) {
var h = ["rgExpXLS", "rgExpDOC", "rgExpPDF", "rgExpCSV"];
var g = true;
var b = e.className;
for (var c = 0;
len = h.length, c < len;
c++) {
if (b.indexOf(h[c]) != -1) {
g = false;
break;
}
}
if (g) {
var d = $get(this._statusLabelID);
if (d) {
d.title = this._loadingText;
d.style.visibility = "visible";
}
}
}
this._isAjaxRequest = true;
}
}, _initializeODataSourceBinder: function () {
var d = this, b = d.get_odataClientSettings().ODataSourceID, a = $find(b);
if (!a) {
var c = String.format("DataSource with id {0} was not found on the page", b);
alert(c);
} else {
d._flatBinder = new Telerik.Web.UI.RadODataDataSource.Binder.Flat(a, d);
d._flatBinder.initialize();
d._oDataRequestSucceededDelegate = Function.createDelegate(d, d._onODataRequestSucceeded);
a.add_requestSucceeded(d._oDataRequestSucceededDelegate);
d._onDataNeeded();
}
}, _onDataNeeded: function (f) {
var e = {
events: {
fail: function (i) {
this._onFail(i);
}
}
};
var a = {};
a.filter = {};
a.filter.filters = [];
var c = this.get_masterTableView().get_filterExpressions();
for (var d = 0;
d < c.get_count();
d++) {
var b = c.getItem(d);
var h = b.get_fieldValue();
var j = [];
if (h.split) {
j = h.split(" ");
}
if (b.FilterFunction == "Between") {
b.set_filterFunction("GreaterThanOrEqualTo");
b.set_fieldValue(j[0]);
a.filter.filters.push(this._convertToODataFilterExprJson(b));
b.set_filterFunction("LessThanOrEqualTo");
b.set_fieldValue(j[1]);
a.filter.filters.push(this._convertToODataFilterExprJson(b));
} else {
if (b.FilterFunction == "NotBetween") {
b.set_filterFunction("LessThanOrEqualTo");
b.set_fieldValue(j[0]);
a.filter.filters.push(this._convertToODataFilterExprJson(b));
b.set_filterFunction("GreaterThanOrEqualTo");
b.set_fieldValue(j[1]);
a.filter.filters.push(this._convertToODataFilterExprJson(b));
a.filter.logic = "or";
} else {
if (b.FilterFunction == "DoesNotContain") {
return;
} else {
a.filter.filters.push(this._convertToODataFilterExprJson(b));
}
}
}
}
var g = this.get_masterTableView().get_sortExpressions();
a.sort = [];
for (var d = 0;
d < g.get_count();
d++) {
var b = g.getItem(d);
a.sort.push({field: b.FieldName, dir: b.SortOrder == 1 ? "asc" : "desc"});
}
a.page = this.get_masterTableView().get_currentPageIndex();
a.pageSize = this.get_masterTableView().get_pageSize();
if (e != undefined) {
e.data = a;
this._flatBinder.fetch(e);
} else {
this._flatBinder.fetch();
}
}, _onODataRequestSucceeded: function (e, b) {
var g = this.get_masterTableView();
if (this.ClientSettings.DataBinding.EnableCaching) {
var f = this._getCacheKey(g);
if (!this._cache) {
this._cache = {};
}
if (!this._cache[f]) {
this._cache[f] = b;
}
}
var d = b.get_data(), c = b.get_count(), a = new Telerik.Web.UI.GridDataSourceResolvedEventArgs(d);
g.set_virtualItemCount(c);
this.raise_dataSourceResolved(a);
if (g.get_virtualItemCount() == 0) {
g._updatePager();
}
g.set_dataSource(d);
g.dataBind();
}, _convertToODataFilterExprJson: function (a) {
var c = {}, b = a.get_fieldName();
switch (a.FilterFunction) {
case"EqualTo":
c = this._getODataFilterExpressionJson(b, "eq", a.FieldValue);
break;
case"NotEqualTo":
c = this._getODataFilterExpressionJson(b, "neq", a.FieldValue);
break;
case"GreaterThan":
c = this._getODataFilterExpressionJson(b, "gt", a.FieldValue);
break;
case"LessThan":
c = this._getODataFilterExpressionJson(b, "lt", a.FieldValue);
break;
case"GreaterThanOrEqualTo":
c = this._getODataFilterExpressionJson(b, "gte", a.FieldValue);
break;
case"LessThanOrEqualTo":
c = this._getODataFilterExpressionJson(b, "lte", a.FieldValue);
break;
case"StartsWith":
c = this._getODataFilterExpressionJson(b, "startswith", a.FieldValue);
break;
case"EndsWith":
c = this._getODataFilterExpressionJson(b, "endswith", a.FieldValue);
break;
case"Contains":
c = this._getODataFilterExpressionJson(b, "contains", a.FieldValue);
break;
case"Between":
c = this._getODataFilterExpressionJson(b, "contains", a.FieldValue);
break;
case"IsEmpty":
c = this._getODataFilterExpressionJson(b, "eq", "");
break;
case"NotIsEmpty":
c = this._getODataFilterExpressionJson(b, "neq", "");
break;
case"IsNull":
c = this._getODataFilterExpressionJson(b, "eq", null);
break;
case"NotIsNull":
c = this._getODataFilterExpressionJson(b, "neq", null);
break;
}
return c;
}, _getODataFilterExpressionJson: function (b, a, d) {
var c = {};
c = {field: b, operator: a, value: d};
return c;
}, get_flatModel: function () {
var b = this.get_odataClientSettings();
var a = Telerik.Web.UI.RadODataDataSource.Binder.Flat.Model(b);
a.parse = function (c) {
return c;
};
return a;
}, get_allowActiveRowCycle: function () {
return this.ClientSettings.KeyboardNavigationSettings.AllowActiveRowCycle;
}, set_allowActiveRowCycle: function (a) {
this.ClientSettings.KeyboardNavigationSettings.AllowActiveRowCycle = a;
}, get_odataClientSettings: function () {
return this._odataClientSettings;
}, set_odataClientSettings: function (a) {
this._odataClientSettings = a;
}, get_isUsingODataSource: function () {
return this._odataClientSettings != null;
}, get_selectedCellsIndexes: function () {
return this._selectedCellsIndexes;
}, get_selectedItemsInternal: function () {
return this._selectedItemsInternal;
}, set_selectedItemsInternal: function (a) {
if (this._selectedItemsInternal != a) {
this._selectedItemsInternal = a;
}
}, get_expandItems: function () {
return this._expandItems;
}, set_expandItems: function (a) {
if (this._expandItems != a) {
this._expandItems = a;
}
}, get_hidedColumns: function () {
return this._hidedColumns;
}, set_hidedColumns: function (a) {
if (this._hidedColumns != a) {
this._hidedColumns = a;
this.updateClientState();
}
}, get_showedColumns: function () {
return this._showedColumns;
}, set_showedColumns: function (a) {
if (this._showedColumns != a) {
this._showedColumns = a;
this.updateClientState();
}
}, get_groupColsState: function () {
return this._groupColsState;
}, set_groupColsState: function (a) {
if (this._groupColsState != a) {
this._groupColsState = a;
this.updateClientState();
}
}, get_hierarchyColsExpandedState: function () {
return this._hierarchyColsExpandedState;
}, set_hierarchyColsExpandedState: function (a) {
if (this._hierarchyColsExpandedState != a) {
this._hierarchyColsExpandedState = a;
this.updateClientState();
}
}, get_selectedCellsInternal: function () {
return this._selectedCellsInternal;
}, set_selectedCellsInternal: function (a) {
if (this._selectedCellsInternal != a) {
this._selectedCellsInternal = a;
}
}, get_unselectableItemsInternal: function () {
return this._unselectableItemsInternal;
}, set_unselectableItemsInternal: function (a) {
if (this._unselectableItemsInternal != a) {
this._unselectableItemsInternal = a;
}
}, get_allowCellSelection: function () {
return this.ClientSettings.Selecting.CellSelectionMode > Telerik.Web.UI.GridCellSelectionMode.None;
}, get_allowMutliCellSelection: function () {
return this.ClientSettings.Selecting.CellSelectionMode > Telerik.Web.UI.GridCellSelectionMode.SingleCell;
}, get_allowColumnSelection: function () {
return this.ClientSettings.Selecting.CellSelectionMode > Telerik.Web.UI.GridCellSelectionMode.MultiCell;
}, get_allowMultiColumnSelection: function () {
return this.ClientSettings.Selecting.CellSelectionMode > Telerik.Web.UI.GridCellSelectionMode.Column;
}, get_allowMultiRowSelection: function () {
return this.AllowMultiRowSelection;
}, set_allowMultiRowSelection: function (a) {
if (this.AllowMultiRowSelection != a) {
this.AllowMultiRowSelection = a;
}
}, get_masterTableView: function () {
return $find(this._masterClientID);
}, get_masterTableViewHeader: function () {
return $find(this._masterClientID + "_Header");
}, get_masterTableViewFooter: function () {
return $find(this._masterClientID + "_Footer");
}, get_selectedItems: function () {
var b = [];
for (var a = 0;
a < this._selectedItemsInternal.length;
a++) {
Array.add(b, $find(this._selectedItemsInternal[a].id));
}
return b;
}, get_editIndexes: function () {
return this._editIndexes;
}, get_editItems: function () {
var a = [];
var h = this.get_masterTableView();
function b(k, i) {
var j = document.getElementById(k.get_id() + "__" + i);
if (j) {
k.get_dataItems();
return $find(j.id);
}
return null;
}
for (var c = 0, g = this._editIndexes.length;
c < g;
c++) {
var d = this._editIndexes[c];
if (d.indexOf(":") > -1) {
for (var f = 0;
f < this._detailTables.length;
f++) {
var e = b(this._detailTables[f], d);
if (e) {
a[a.length] = e;
break;
}
}
} else {
var e = b(h, d);
if (e) {
a[a.length] = e;
}
}
}
return a;
}, get_batchEditingManager: function () {
return this._batchEditing;
}, clearSelectedItems: function () {
var g = this, f = g._selectedItemsInternal, d = g._selectedIndexes;
if (f.length > 0) {
var a = f.length - 1;
while (a >= 0) {
var e = f[a], b = $find(e.id);
if (b) {
b.set_selected(false);
} else {
var c = $get(e.id);
if (c) {
g._selection._selectRowInternal(c, {ctrlKey: false}, true, true, true);
} else {
Array.remove(f, e);
Array.remove(d, d[a]);
g.updateClientState();
}
}
a--;
}
}
}, clearSelectedCells: function () {
if (this._cellSelection != null) {
this._cellSelection._clear();
}
}, _initializeTableViews: function () {
var a = eval(this._gridTableViewsData);
for (var e = 0;
e < a.length;
e++) {
var d = a[e];
if (!d.ClientID) {
continue;
}
if ($find(d.ClientID) != null) {
continue;
}
if ($get(d.ClientID) == null) {
continue;
}
if (this._masterClientID != d.ClientID) {
this.raise_tableCreating(new Sys.EventArgs());
}
var f = $create(Telerik.Web.UI.GridTableView, {_owner: this, _data: d}, null, null, $get(d.ClientID));
if (this._masterClientID != d.ClientID) {
var b = new Sys.EventArgs();
b.get_tableView = function () {
return f;
};
Array.add(this._detailTables, f);
this.raise_tableCreated(b);
}
if (this._masterClientID == d.ClientID) {
this.raise_masterTableViewCreating(new Sys.EventArgs());
this.MasterTableView = f;
this.raise_masterTableViewCreated(new Sys.EventArgs());
if ($get(d.ClientID + "_Header")) {
if ($telerik.isIE && document.documentMode && document.documentMode == 7) {
if (this.MasterTableView.get_element().style.width == "100%") {
this.MasterTableView.get_element().style.width = "auto";
}
}
this.MasterTableViewHeader = $create(Telerik.Web.UI.GridTableView, {
_owner: this,
_data: d
}, null, null, $get(d.ClientID + "_Header"));
if ($telerik.isIE && document.documentMode && document.documentMode == 7 && this.MasterTableViewHeader != null) {
var c = this.MasterTableViewHeader.get_element().getElementsByTagName("COL").length;
if (c > 0) {
$telerik.getChildrenByTagName(this.MasterTableViewHeader.get_element(), "tbody")[0].getElementsByTagName("TD")[0].colSpan = c;
}
}
this.MasterTableView._columnsInternal = this.MasterTableViewHeader._columnsInternal;
}
if ($get(d.ClientID + "_Footer")) {
this.MasterTableViewFooter = $create(Telerik.Web.UI.GridTableView, {
_owner: this,
_data: d
}, null, null, $get(d.ClientID + "_Footer"));
}
}
}
}, get_detailTables: function () {
return this._detailTables;
}, get_enableAriaSupport: function () {
return this._enableAriaSupport;
}, _initializeAriaSupport: function () {
var F = this.get_element();
F.setAttribute("aria-readonly", "true");
if (this.ClientSettings.Selecting.AllowRowSelect && this.get_allowMultiRowSelection()) {
F.setAttribute("aria-multiselectable", "true");
}
var y = this.get_masterTableView();
var k = y.get_columns();
var o = y._data.EditMode;
var C = y.get_dataItems();
for (var s = 0;
s < C.length;
s++) {
var z = C[s];
var f = this.ClientSettings;
if (f && f.AllowRowsDragDrop && f.Selecting && f.Selecting.AllowRowSelect) {
var B = z.get_element();
B.setAttribute("aria-dropeffect", "move");
}
for (var w = 0;
w < k.length;
w++) {
var g = k[w];
var n = null;
var h = g.get_element();
if (h.style.display == "none") {
h.setAttribute("aria-hidden", "true");
}
if (f.AllowColumnsReorder) {
h.setAttribute("aria-dropeffect", "move");
}
var E = g.get_uniqueName();
if (g._data.ColumnType == "GridEditCommandColumn" && o == "PopUp") {
n = E;
}
var a = z.get_cell(E);
if (g._data.ColumnType == "GridClientSelectColumn") {
var d = a.getElementsByTagName("input");
if (d.length > 0) {
var c = d[0];
if (c.id && c.id.indexOf("SelectCheckBox") != -1 && c.checked) {
c.setAttribute("aria-checked", c.checked);
}
}
}
if (a.style.display == "none") {
a.setAttribute("aria-hidden", "true");
}
if (g.get_readOnly()) {
a.setAttribute("aria-readonly", "true");
}
if (n && o == "PopUp") {
if (a && a.firstChild && (a.firstChild.tagName.toLowerCase() == "img" || a.firstChild.tagName.toLowerCase() == "a" || a.firstChild.tagName.toLowerCase() == "input")) {
a.firstChild.setAttribute("aria-haspopup", "true");
}
}
}
}
if (this._detailTables.length) {
F.setAttribute("role", "treegrid");
} else {
F.setAttribute("role", "grid");
}
var t = function (i) {
i.setAttribute("role", "columnheader");
if (!i.parentNode.getAttribute("role")) {
i.parentNode.setAttribute("role", "row");
}
var G = i.getElementsByTagName("a")[0];
if (G) {
var j = i.getElementsByTagName("input")[0];
if (j) {
if (j.className.indexOf("rgSortAsc") > -1) {
i.setAttribute("aria-sort", "ascending");
} else {
if (j.className.indexOf("rgSortDesc") > -1) {
i.setAttribute("aria-sort", "descending");
}
}
} else {
i.setAttribute("aria-sort", "none");
}
}
};
if (F.querySelectorAll) {
var r = F.querySelectorAll("th.rgHeader");
for (var s = 0, x = r.length;
s < x;
s++) {
t(r[s]);
}
} else {
var r = F.getElementsByTagName("th");
for (var s = 0, x = r.length;
s < x;
s++) {
var q = r[s];
if (q.className.indexOf("rgHeader") > -1) {
t(q);
}
}
}
var b = F.getElementsByTagName("td");
for (var s = 0, x = b.length;
s < x;
s++) {
var a = b[s];
var z = a.parentNode;
var A = z.className;
if (a.className.indexOf("rgExpandCol") > -1 || a.className.indexOf("rgGroupCol") > -1) {
a.setAttribute("role", "presentation");
if (A.indexOf("rgGroupHeader") > -1 || z.id) {
var p = a.getElementsByTagName("input")[0];
if (p) {
if (p.className.indexOf("rgCollapse") > -1) {
z.setAttribute("aria-expanded", "true");
p.setAttribute("aria-expanded", "true");
} else {
if (p.className.indexOf("rgExpand") > -1) {
z.setAttribute("aria-expanded", "false");
p.setAttribute("aria-expanded", "false");
}
}
}
if (A.indexOf("rgGroupHeader") > -1 && !z.getAttribute("role")) {
z.setAttribute("role", "rowgroup");
}
}
} else {
if (A.indexOf("rgRow") > -1 || A.indexOf("rgAltRow") > -1 || A.indexOf("rgFooter") > -1) {
a.setAttribute("role", "gridcell");
if (!z.getAttribute("role")) {
z.setAttribute("role", "row");
if (A.indexOf("rgSelectedRow") > -1) {
z.setAttribute("aria-selected", "true");
z.tabIndex = 1;
}
}
} else {
if (a.className.indexOf("rgCommandCell") > -1 && !z.getAttribute("role")) {
a.setAttribute("role", "presentation");
z.setAttribute("role", "presentation");
} else {
if (z.className.indexOf("rgPager") > -1 && !z.getAttribute("role")) {
z.setAttribute("role", "presentation");
var m = z.getElementsByTagName("div");
for (var s = 0;
s < m.length;
s++) {
var l = m[s];
if (l.className && l.className.indexOf("rgWrap") > -1) {
var v = l.getElementsByTagName("input");
for (var w = 0;
w < v.length;
w++) {
var u = v[w];
var e = u.className;
if (u.type == "submit" && e && (e.indexOf("PagePrev") > -1 || e.indexOf("PageFirst") > -1 || e.indexOf("PageNext") > -1 || e.indexOf("PageLast") > -1 || e.indexOf("PagerButton") > -1)) {
u.setAttribute("role", "button");
}
}
}
}
} else {
if (z.className.indexOf("rgEditRow") > -1 && !z.getAttribute("role")) {
z.setAttribute("role", "row");
z.setAttribute("aria-readonly", "false");
} else {
if (!z.id) {
var D = z.parentNode.tagName.toLowerCase() === "table" ? z.parentNode : z.parentNode.parentNode;
if (D && D.className.indexOf("rgMasterTable") > -1 || D.className.indexOf("rgDetailTable") > -1) {
if (!z.getAttribute("role")) {
z.setAttribute("role", "presentation");
}
}
}
}
}
}
}
}
}
if (this._groupPanel) {
this._groupPanel.get_element().setAttribute("role", "presentation");
}
}, _applyCellSpacingIfRequired: function () {
if ($telerik.isIE && document.documentMode && document.documentMode < 8) {
var d = this.get_element().getElementsByTagName("table");
for (var a = 0, b = d.length;
a < b;
a++) {
var c = d[a];
if (c.className.indexOf("rgMasterTable") > -1 || c.className.indexOf("rgDetailTable") > -1 || c.className.indexOf("rgGroupPanel") > -1 || parseInt(c.style.borderSpacing) === 0) {
if (c.getAttribute("cellSpacing") == "") {
c.setAttribute("cellSpacing", "0");
c.cellSpacing = 0;
}
}
}
}
}, _initializeEvents: function (a) {
if (a) {
var e = this;
for (var b = 0, c = a.length;
b < c;
b++) {
var d = a[b];
this["add_" + d] = function (f) {
return function (g) {
this.get_events().addHandler(f, g);
};
}(d);
this["remove_" + d] = function (f) {
return function (g) {
this.get_events().removeHandler(f, g);
};
}(d);
this["raise_" + d] = function (f) {
return function (g) {
this.raiseEvent(f, g);
};
}(d);
}
}
}, _selectAllRows: function (l, d, a) {
var b = (a.srcElement) ? a.srcElement : a.target;
var k = $find(l);
var j = k.get_element();
var h = (b.checked) ? true : false;
for (var c = 0, f = j.rows.length;
c < f;
c++) {
var g = j.rows[c];
if (!g.id || g.style.display == "none") {
continue;
}
this._selection._selectRowInternal(g, a, true, false, false, h);
}
if (j.rows.length > 0) {
this.updateClientState();
}
}, _showFilterMenu: function (l, n, c) {
var k = $find(l);
var b = k.getColumnByUniqueName(n);
var g = this._getFilterMenu();
if (this._filterMenu) {
this._filterMenu.hide();
var j = this._filterMenu;
var a = new Sys.CancelEventArgs();
a.get_menu = function () {
return j;
};
a.get_tableView = function () {
return k;
};
a.get_column = function () {
return b;
};
a.get_domEvent = function () {
return c;
};
this.raise_filterMenuShowing(a);
if (a.get_cancel()) {
return;
}
this._buildFilterMenuItemList(this._filterMenu, b._data.FilterListOptions, b._data.DataTypeName, b._data.CurrentFilterFunction, b);
this._onFilterMenuClicking = Function.createDelegate(this, this._filterMenuClickingHandler);
this._filterMenu.add_itemClicking(this._onFilterMenuClicking);
var d = Telerik.Web.UI.Grid.GetCurrentElement(c);
if (d) {
$telerik.addCssClasses(d, ["rgFilterActive"]);
}
this._onFilterMenuHiddenDelegate = Function.createDelegate({
opener: d,
context: this
}, this._onFilterMenuHidden);
this._filterMenu.add_hidden(this._onFilterMenuHiddenDelegate);
if ($telerik.isTouchDevice) {
var i = $telerik.getTouchEventLocation(c).x;
var m = $telerik.getTouchEventLocation(c).y;
this._filterMenu.showAt(i, m);
$telerik.cancelRawEvent(c);
} else {
var f = $telerik.getLocation(d);
this._filterMenu.showAt(f.x + (d.offsetWidth / 2), f.y + (d.offsetHeight / 2));
$telerik.cancelRawEvent(c);
var h = this._filterMenu.get_focusedItem() || this._filterMenu.get_items().getItem(0);
if (c.clientX == 0 && c.clientY == 0) {
if (h._linkElement) {
h._linkElement.focus();
} else {
if (h._templateElement) {
h._templateElement.focus();
}
}
}
}
}
}, _onFilterMenuHidden: function (b, a) {
if (this.opener) {
$telerik.removeCssClasses(this.opener, ["rgFilterActive"]);
this.opener = null;
}
if (this.context && this.context._filterMenu) {
if (this.context._onFilterMenuClicking) {
this.context._filterMenu.remove_itemClicking(this.context._onFilterMenuClicking);
}
if (this.context._onFilterMenuHiddenDelegate) {
this.context._filterMenu.remove_hidden(this.context._onFilterMenuHiddenDelegate);
}
this.context._onFilterMenuHiddenDelegate = null;
}
}, _getFilterMenu: function () {
if (Telerik.Web.UI.RadContextMenu && !this._filterMenu) {
this._filterMenu = $find(this.ClientID + "_rfltMenu");
}
return this._filterMenu;
}, get_headerMenu: function () {
return this._getHeaderContextMenu();
}, _getHeaderContextMenu: function () {
if (Telerik.Web.UI.RadContextMenu && !this._headerContextMenu) {
this._headerContextMenu = $find(this.ClientID + "_rghcMenu");
}
return this._headerContextMenu;
}, _filterMenuClickingHandler: function (g, c) {
var i = c.get_item()._filterMenu_tableID;
if (!i) {
c.set_cancel(true);
return;
}
var h = $find(i);
if (!h) {
c.set_cancel(true);
return;
}
var d = c.get_item().get_value();
var b = c.get_item()._filterMenu_column_uniqueName;
var e = h._getFilterControlValue(b);
var a = h._raiseAction("Filter", {filterFunction: d, columnUniqueName: b, filterValue: e});
if (a.get_cancel()) {
c.get_item().set_focused(false);
c.set_cancel(true);
return;
}
d = a.get_filterFunction();
b = a.get_columnUniqueName();
e = a.get_filterValue();
if (d == "NoFilter") {
h._updateFilterControlValue(e, b, d);
} else {
if ((e == null || e === "") && d != "IsEmpty" && d != "NotIsEmpty" && d != "IsNull" && d != "NotIsNull") {
g.hide();
return;
}
}
if (!h.filter(b, e, d)) {
var f = this.get_masterTableView();
if (f) {
f.__shouldPerformFiltering = false;
}
c.set_cancel(true);
this._filterMenu.remove_itemClicking(this._onFilterMenuClicking);
}
g.hide();
}, _checkListItemsRequestedHandler: function () {
if (this._checkListFilterActiveColumn && this._checkListFilterActiveColumn) {
var e = $find(this._filterCheckListClientID);
e.set_visible(true);
var c = this._checkListFilterActiveColumn.get_owner()._data.UniqueID + "," + this._checkListFilterActiveColumn.get_uniqueName();
var b = -1;
for (var f = 0;
f < this._checkListFilterKeys.length;
f++) {
if (this._checkListFilterKeys[f] == c) {
b = f;
break;
}
}
if (b >= 0 && b < this._checkListFilterValues.length && this._checkListFilterValues[b] && this._checkListFilterValues[b].length > 0) {
var j = {};
for (var f = 0;
f < this._checkListFilterValues[b].length;
f++) {
j[this._checkListFilterValues[b][f]] = true;
}
var d = e.get_items().get_count();
for (var g = 0;
g < d;
g++) {
var h = e.get_items().getItem(g);
if (j[h.get_text()]) {
h.check();
}
}
}
d = e.get_items().get_count();
for (g = 0;
g < d;
g++) {
h = e.get_items().getItem(g);
if (h.get_text() === "") {
h.set_text("(null)");
}
}
}
}, _checkListFilterCancelButtonHandler: function () {
this._filterMenu.hide();
}, _resetCheckListFilterOfColumn: function (b) {
var d = b.get_owner()._data.UniqueID + "," + b.get_uniqueName();
var c = this._checkListFilterKeys.length;
for (var a = 0;
a < this._checkListFilterKeys.length;
a++) {
if (this._checkListFilterKeys[a] == d) {
c = a;
break;
}
}
this._checkListFilterKeys[c] = d;
this._checkListFilterValues[c] = [];
return c;
}, _checkListFilterApplyButtonHandler: function () {
var e = $find(this._filterCheckListClientID);
var b = this._checkListFilterActiveColumn;
var c = this._resetCheckListFilterOfColumn(b);
var k = $find(b.get_owner().get_id().replace("_Header", ""));
var f = "rgFiltered", d = $telerik.getElementByClassName(k._getFilterCellByColumnUniqueName(b.get_uniqueName()), "rgFilter");
var a = e.get_items()._array;
if (!e._allChecked) {
for (var j = 0;
j < a.length;
j++) {
if (a[j].get_checkBoxElement().checked) {
var h = a[j].get_text();
if (h === "(null)") {
h = "";
}
this._checkListFilterValues[c][this._checkListFilterValues[c].length] = h;
}
}
}
var g = k._filterExpressions.find(b.get_uniqueName());
if (this._checkListFilterValues[c].length > 0) {
if (!g) {
g = new Telerik.Web.UI.GridFilterExpression();
g.set_fieldName(b._data.DataField);
g.set_dataTypeName(b._data.DataTypeName);
g.set_columnUniqueName(b.get_uniqueName());
k._filterExpressions.add(g);
}
Sys.UI.DomElement.addCssClass(d, f);
g.set_filterFunction(Telerik.Web.UI.GridFilterFunction.EqualTo);
g._checkListFilterValues = this._checkListFilterValues[c];
} else {
if (g) {
g.set_filterFunction(Telerik.Web.UI.GridFilterFunction.NoFilter);
g._checkListFilterValues = this._checkListFilterValues[c];
k._filterExpressions.remove(g);
}
Sys.UI.DomElement.removeCssClass(d, f);
}
this._filterMenu.hide();
this.updateClientState();
k.fireCommand("Filter", b.get_uniqueName() + "|?|?" + (g ? Telerik.Web.UI.GridFilterFunction.EqualTo : Telerik.Web.UI.GridFilterFunction.NoFilter));
}, _buildFilterMenuItemList: function (p, l, h, f, b) {
var c = b._data.ColumnType;
var j = b._data.EnableRangeFiltering;
var o = null;
if (this._filterCheckListClientID) {
var k = $find(this._filterCheckListClientID);
this._checkListFilterActiveColumn = b;
k.get_items().clear();
var a = "";
if (b._owner._data.CheckListWebServicePath && b._data.FilterCheckListWebServiceMethod) {
k.set_visible(true);
k.get_webServiceSettings().set_path(b._owner._data.CheckListWebServicePath);
k.get_webServiceSettings().set_method(b._data.FilterCheckListWebServiceMethod);
k.requestItems();
} else {
if (b._data.FilterCheckListEnableLoadOnDemand) {
k.set_visible(true);
var g = {startIndex: 0, count: 0};
var d = b.get_uniqueName();
var e = {columnUniqueName: d};
k._doLoadOnDemandWithCallBack(e, g);
} else {
k.set_visible(false);
a = "None";
}
}
this._filterApplyButton.style.display = a;
this._filterCancelButton.style.display = a;
}
if (p.get_items().get_count() > 0 && p.get_items().getItem(0).get_items().get_count() > 0) {
p = p.get_items().getItem(0);
}
for (var m = 0;
m < p.get_items().get_count();
m++) {
var n = p.get_items().getItem(m);
o = n.get_value();
n._filterMenu_column_uniqueName = b.get_uniqueName();
n._filterMenu_tableID = b._owner._data.ClientID;
if (this._clientSideBinding && this._clientSideBinding._clientDataSource) {
if (o == "DoesNotContain" || o == "IsEmpty" || o == "NotIsEmpty" || o == "IsNull" || o == "NotIsNull" || o == "Between" || o == "NotBetween") {
n.set_visible(false);
continue;
}
}
if (h == "System.Boolean") {
if ((o == "GreaterThan") || (o == "LessThan") || (o == "GreaterThanOrEqualTo") || (o == "LessThanOrEqualTo") || (o == "Between") || (o == "NotBetween")) {
n.set_visible(false);
continue;
}
}
if (h != "System.String") {
if ((o == "StartsWith") || (o == "EndsWith") || (o == "Contains") || (o == "DoesNotContain") || (o == "IsEmpty") || (o == "NotIsEmpty")) {
n.set_visible(false);
continue;
}
}
if (l == 0) {
if (o == "Custom") {
n.set_visible(false);
continue;
}
}
if (c == "GridDateTimeColumn" && j && (o == "EqualTo" || o == "GreaterThan" || o == "GreaterThanOrEqualTo" || o == "LessThan" || o == "LessThanOrEqualTo" || o == "NotEqualTo")) {
n.set_visible(false);
continue;
}
if (((c == "GridDateTimeColumn" && !j) || c == "GridMaskedColumn" || c == "GridNumericColumn" || c == "GridRatingColumn") && ((o == "Between") || (o == "NotBetween"))) {
n.set_visible(false);
continue;
}
if (o == b._data.CurrentFilterFunctionName) {
n._focused = true;
p._focusedItem = n;
n._updateLinkClass();
} else {
n._focused = false;
n._updateLinkClass();
}
n.set_visible(true);
}
}, saveClientState: function () {
var c = {};
c.selectedIndexes = this._selectedIndexes;
c.selectedCellsIndexes = this._selectedCellsIndexes;
c.unselectableItemsIndexes = this._unselectableItemsIndexes;
c.reorderedColumns = this._reorderedColumns;
c.expandedItems = this._expandedItems;
c.expandedGroupItems = this._expandedGroupItems;
if (this._expandedFilterItems) {
c.expandedFilterItems = this._expandedFilterItems;
}
c.deletedItems = this._deletedItems;
if (this._resizedColumns != "") {
c.resizedColumns = this._resizedColumns;
}
if (this._resizedControl != "") {
c.resizedControl = this._resizedControl;
}
if (this._resizedItems != "") {
c.resizedItems = this._resizedItems;
}
if (this._hidedItems != "") {
c.hidedItems = this._hidedItems;
}
if (this._showedItems != "") {
c.showedItems = this._showedItems;
}
if (this._hidedColumns) {
c.hidedColumns = this._hidedColumns;
}
if (this._showedColumns) {
c.showedColumns = this._showedColumns;
}
if (this._groupColsState) {
c.groupColsState = this._groupColsState;
}
if (this._hierarchyColsExpandedState) {
c.hierarchyState = this._hierarchyColsExpandedState;
}
if (this._activeRow) {
c.activeRowIndex = this._activeRow.id;
}
if (this._gridDataDiv) {
var a = this.get_masterTableView(), d = a._virtualization;
scrollTop = d && d._haveCustomScrollbar && d._scrollbar ? d._scrollbar.scrollTop : this._gridDataDiv.scrollTop;
if ($get(this.ClientID + "_Frozen")) {
c.scrolledPosition = scrollTop + "," + $get(this.ClientID + "_Frozen").scrollLeft;
} else {
c.scrolledPosition = scrollTop + "," + this._gridDataDiv.scrollLeft;
}
if (d && a.get_allowPaging() && a.get_currentPageIndex() > 0) {
c.currentPageIndex = a.get_currentPageIndex();
}
if (d && d._itemAtTop) {
c.itemAtTop = d._itemAtTop;
c.startIndex = d._startIndex;
}
}
if (this._popUpLocations) {
c.popUpLocations = this._popUpLocations;
}
if (this._draggedItemsIndexes) {
c.draggedItemsIndexes = this._draggedItemsIndexes;
}
if (this._shouldFocusOnPage) {
c.shouldFocusOnPage = this._shouldFocusOnPage;
}
var b = this._selection;
if (b && b._lastSelectedItemIndex != null) {
c.lastSelectedItemIndex = b._lastSelectedItemIndex;
}
if (this._checkListFilterKeys && this._checkListFilterKeys.length > 0) {
c.checkListFilterKeys = this._checkListFilterKeys;
c.checkListFilterValues = this._checkListFilterValues;
}
return Sys.Serialization.JavaScriptSerializer.serialize(c);
}, _attachDomEvents: function () {
this._onKeyDownDelegate = Function.createDelegate(this, this._onKeyDownHandler);
this._onKeyPressDelegate = Function.createDelegate(this, this._onKeyPressHandler);
this._onMouseMoveDelegate = Function.createDelegate(this, this._onMouseMoveHandler);
$addHandler(this.get_element(), "keydown", this._onKeyDownDelegate);
$addHandler(this.get_element(), "keypress", this._onKeyPressDelegate);
$addHandler(this.get_element(), "mousemove", this._onMouseMoveDelegate);
}, _detachDomEvents: function () {
if (this._onKeyDownDelegate) {
$removeHandler(this.get_element(), "keydown", this._onKeyDownDelegate);
this._onKeyDownDelegate = null;
}
if (this._onKeyPressDelegate) {
$removeHandler(this.get_element(), "keypress", this._onKeyPressDelegate);
this._onKeyPressDelegate = null;
}
if (this._onMouseMoveDelegate) {
$removeHandler(this.get_element(), "mousemove", this._onMouseMoveDelegate);
this._onMouseMoveDelegate = null;
}
}, _onMouseMoveHandler: function (b) {
var a = Telerik.Web.UI.Grid.GetCurrentElement(b);
if (this.ClientSettings && this.ClientSettings.Resizing.AllowRowResize) {
if (this._gridItemResizer == null) {
this._gridItemResizer = new Telerik.Web.UI.GridItemResizer(this);
}
this._gridItemResizer._detectResizeCursorsOnItems(b, a);
this._gridItemResizer._moveItemResizer(b);
}
}, _onKeyDownHandler: function (c) {
var d = c.keyCode || c.charCode;
if (this._isShortCutKeyPressed(c)) {
this._raiseKeyPressInternal(c);
}
var b = d == this.ClientSettings.KeyboardNavigationSettings.DeleteActiveRow;
if (b) {
this._raiseKeyPressInternal(c);
}
var a = (d >= 37 && d <= 40);
var f = (d == 33 || d == 34);
if ((($telerik.isIE || $telerik.isChrome || $telerik.isSafari || $telerik.isOpera) && (a || f)) || (($telerik.isChrome || $telerik.isSafari || $telerik.isOpera) && d == this.ClientSettings.KeyboardNavigationSettings.ExitEditInsertModeKey)) {
this._raiseKeyPressInternal(c);
}
if (this.ClientSettings && this.ClientSettings.AllowKeyboardNavigation && this.get_batchEditingManager()) {
this.get_batchEditingManager()._handleKeyboardNavigation(c);
}
}, _onKeyPressHandler: function (a) {
this._raiseKeyPressInternal(a);
}, _raiseKeyPressInternal: function (b) {
var a = new Telerik.Web.UI.GridKeyPressEventArgs(b);
this.raise_keyPress(a);
if (a.get_cancel()) {
return;
}
this._handleGridKeyboardAction(b);
}, _validateEditInsertForm: function (a) {
if (this.ValidationSettings.EnableValidation) {
var b = this.ValidationSettings.CommandsToValidate;
if (b.toString().indexOf(a) > -1) {
var c = this._validationGroup;
if (typeof(Page_ClientValidate) == "function") {
var d = Page_ClientValidate(c);
if (d != true) {
return false;
}
}
}
}
return true;
}, _getTableViewByControlIntoIt: function (a) {
var h = a.id.split("_");
var f = 0;
for (var e = 0;
e < h.length;
e++) {
if (h[e].indexOf("Detail") > -1) {
f = e;
}
}
var c = "";
var d = new Array();
if (f > 0) {
for (var e = 0;
e < f + 1;
e++) {
d.push(h[e]);
}
c = d.join("_");
}
if (!c) {
var g = Telerik.Web.UI.Grid.GetFirstParentByTagName(a, "table");
while (g && g.id.indexOf(this.ClientID) == -1) {
g = Telerik.Web.UI.Grid.GetFirstParentByTagName(g.parentNode, "table");
}
if (g) {
c = g.id;
}
}
var b = $find(c);
if (!b) {
b = this.get_masterTableView();
}
return b;
}, _cancelDefaultAction: function (a) {
if (a.preventDefault) {
a.preventDefault();
}
a.returnValue = false;
if (a.stopPropagation) {
a.stopPropagation();
a.cancelBubble = true;
}
}, _handleGridKeyboardAction: function (f) {
var m = f.keyCode || f.charCode;
if (this.ClientSettings && this.ClientSettings.AllowKeyboardNavigation && this.ClientSettings.Selecting.CellSelectionMode == Telerik.Web.UI.GridCellSelectionMode.None) {
var a = this._allowSubmitOnEnter;
var b = this._canHandleKeyboardAction(f);
if (!b && !a) {
return;
} else {
if ((a) && (m == 13)) {
var q = Telerik.Web.UI.Grid.GetCurrentElement(f);
if (q.type && q.type.toLowerCase() == "textarea") {
return;
}
var k = false;
for (var l = 0;
l < this._submitControls.length;
l++) {
if ((q.tagName.toLowerCase() == this._submitControls[l].Name) && (q.type.toLowerCase() == this._submitControls[l].Type)) {
k = true;
}
}
if (q.type && !k && q.type.toLowerCase() == "checkbox") {
this._cancelDefaultAction(f);
return;
}
if (!k && (this._editIndexes.length > 0)) {
return;
}
var d = this._getTableViewByControlIntoIt(q);
if (k && d.get_isItemInserted()) {
if (this._validateEditInsertForm("PefrormInsert")) {
d.insertItem();
this._cancelDefaultAction(f);
return;
}
}
}
}
var o = (m == 38 || m == 40);
var p = this._shouldSelectOnSpace(f, m);
var g = this.ClientSettings.KeyboardNavigationSettings.EnableKeyboardShortcuts && (m == 13);
var j = (m == this.ClientSettings.KeyboardNavigationSettings.ExpandDetailTableKey || m == this.ClientSettings.KeyboardNavigationSettings.CollapseDetailTableKey);
var n = (m == 33 || m == 34) && b;
var h = this.ClientSettings.KeyboardNavigationSettings.EnableKeyboardShortcuts && (m == this.ClientSettings.KeyboardNavigationSettings.ExitEditInsertModeKey || m == this.ClientSettings.KeyboardNavigationSettings.UpdateInsertItemKey);
var c = this.ClientSettings.KeyboardNavigationSettings.EnableKeyboardShortcuts && (m == this.ClientSettings.KeyboardNavigationSettings.DeleteActiveRow);
if (o) {
this._handleActiveRowNavigation(f);
} else {
if (j) {
if (this.get_id() === f.target.id) {
this._handleActiveRowExpandCollapse(f);
}
} else {
if (p) {
this._handleActiveRowSelection(f);
} else {
if (h) {
this._handleExitEditModeOrUpdateItem(f, m);
if ((typeof(f.rawEvent.returnValue) == "undefined" || (typeof(f.rawEvent.returnValue) == "boolean" && f.rawEvent.returnValue)) && m == this.ClientSettings.KeyboardNavigationSettings.UpdateInsertItemKey) {
this._handleActiveRowEdit(f);
this._cancelDefaultAction(f);
}
} else {
if (c) {
this._handleDeleteActiveRow();
} else {
if (n) {
this._handlePaging(f);
} else {
if (f.ctrlKey) {
this._handleShortCutKey(f);
}
}
}
}
}
}
}
}
}, _shouldSelectOnSpace: function (a, b) {
var d = a.target.tagName.toUpperCase();
var c = this.ClientSettings.Selecting;
if (b == 32 && c && c.AllowRowSelect && d != "INPUT" && d != "TEXTAREA") {
return true;
}
return false;
}, _canHandleKeyboardAction: function (a) {
var c = a.keyCode || a.charCode;
if ((c == 32 || c == 13 || c == 33 || c == 34 || c == 127) && this.ClientSettings.KeyboardNavigationSettings.EnableKeyboardShortcuts) {
var d = Telerik.Web.UI.Grid.GetCurrentElement(a);
var b = (d.tagName.toLowerCase() == "input" && d.type.toLowerCase() == "checkbox" && (d.id && d.id.indexOf("SelectCheckBox") != -1));
if (c == 127 && d.tagName.toLowerCase() == "input" && d.type == "text") {
return false;
}
if (c == 33 || c == 34) {
if (d.tagName.toLowerCase() == "input" || d.tagName.toLowerCase() == "textarea") {
return false;
}
} else {
if ((d.tagName.toLowerCase() == "input" && !b) || d.tagName.toLowerCase() == "select" || d.tagName.toLowerCase() == "option" || d.tagName.toLowerCase() == "button" || d.tagName.toLowerCase() == "a" || d.tagName.toLowerCase() == "textarea" || d.tagName.toLowerCase() == "img") {
return false;
}
}
}
return true;
}, _handleShortCutKey: function (a) {
var b = a.keyCode || a.charCode;
switch (b) {
case this.ClientSettings.KeyboardNavigationSettings.InitInsertKey:
if (this._activeRow) {
this._getRow(this._activeRow.id).get_owner().showInsertItem();
a.preventDefault();
}
break;
case this.ClientSettings.KeyboardNavigationSettings.RebindKey:
if (this._activeRow) {
this._getRow(this._activeRow.id).get_owner().rebind();
a.preventDefault();
}
break;
default:
break;
}
}, _isShortCutKeyPressed: function (a) {
var b = a.keyCode || a.charCode;
if (a.ctrlKey) {
switch (b) {
case this.ClientSettings.KeyboardNavigationSettings.InitInsertKey:
return true;
break;
case this.ClientSettings.KeyboardNavigationSettings.RebindKey:
return true;
break;
default:
return false;
break;
}
}
}, _handleDeleteActiveRow: function () {
if (this._activeRow) {
var a = $find(this._activeRow.id.split("__")[0]);
if (a) {
a.deleteItem(this._activeRow);
}
}
}, _getRow: function (b) {
var a = $find(b);
if (!a) {
var d = b.split("__")[0];
var c = $find(d);
this._ensureDataItemsCreated(c);
a = $find(b);
}
return a;
}, _handlePaging: function (a) {
var c = null;
var d = null;
var b = a.keyCode || a.charCode;
var f = null;
if (this._activeRow) {
f = this._getRow(this._activeRow.id).get_owner();
c = f.get_currentPageIndex();
d = f.get_pageCount();
}
if (b == 33) {
c++;
if (c < d) {
this._shouldFocusOnPage = true;
this.updateClientState();
if (this._activeRow) {
f.page("Next");
}
}
} else {
c--;
if (c > -1) {
this._shouldFocusOnPage = true;
this.updateClientState();
if (this._activeRow) {
f.page("Prev");
}
}
}
a.rawEvent.returnValue = false;
a.rawEvent.cancelBubble = true;
if (a.stopPropagation) {
a.preventDefault();
a.stopPropagation();
}
}, _handleExitEditModeOrUpdateItem: function (f, h) {
var d = Telerik.Web.UI.Grid.GetCurrentElement(f);
var m = Telerik.Web.UI.Grid.GetFirstParentByTagName(d, "tr");
if (h == this.ClientSettings.KeyboardNavigationSettings.ExitEditInsertModeKey && this._activeRow && this._getRow(this._activeRow.id)._owner.get_isItemInserted()) {
this._getRow(this._activeRow.id)._owner.cancelInsert();
f.rawEvent.returnValue = false;
f.rawEvent.cancelBubble = true;
if (f.stopPropagation) {
f.preventDefault();
f.stopPropagation();
}
return false;
}
if (h == this.ClientSettings.KeyboardNavigationSettings.ExitEditInsertModeKey) {
if (this._activeRow) {
var c = this._activeRow.id;
var a = $find(c);
if (!a) {
var o = $find(c.split("__")[0]);
this._owner._ensureDataItemsCreated(o);
a = $find(c);
}
if (a.get_isInEditMode()) {
var b = a.get_element();
var j = this.isGridDataRow(b);
j.cancelUpdate(b);
f.rawEvent.returnValue = false;
f.rawEvent.cancelBubble = true;
if (f.stopPropagation) {
f.preventDefault();
f.stopPropagation();
}
}
}
return false;
}
if (m == null || typeof(m) == "undefined") {
return false;
}
var n = this.isGridDataRow(m);
if (n != null && typeof(n) != "undefined") {
if (this.isInEditModeByHierarchicalIndex(m.id.split("__")[1])) {
if (h == this.ClientSettings.KeyboardNavigationSettings.ExitEditInsertModeKey) {
n.cancelUpdate(m);
} else {
if (h == this.ClientSettings.KeyboardNavigationSettings.UpdateInsertItemKey) {
if (this._validateEditInsertForm("Update")) {
n.updateItem(m);
}
}
}
f.rawEvent.returnValue = false;
f.rawEvent.cancelBubble = true;
if (f.stopPropagation) {
f.preventDefault();
f.stopPropagation();
}
return false;
}
} else {
var k = $telerik.$(d).parents("tr");
var l;
for (var g = 0;
g < k.length;
g++) {
l = k[g].previousSibling;
if (l != null && typeof(l) != "undefined" && l.tagName == "TR") {
n = this.isGridDataRow(l);
if (n != null && typeof(n) != "undefined") {
if (h == this.ClientSettings.KeyboardNavigationSettings.ExitEditInsertModeKey) {
n.cancelUpdate(l);
} else {
if (h == this.ClientSettings.KeyboardNavigationSettings.UpdateInsertItemKey) {
if (this._validateEditInsertForm("Update")) {
n.updateItem(l);
}
}
}
f.rawEvent.returnValue = false;
f.rawEvent.cancelBubble = true;
if (f.stopPropagation) {
f.preventDefault();
f.stopPropagation();
}
break;
}
}
}
return false;
}
}, isGridDataRow: function (d) {
if (d.id == "") {
return;
}
var a = this.get_masterTableView()._getRowByIndexOrItemIndexHierarchical(d);
var c = a.id.split("__")[0];
var b = $find(c);
if (b != null && typeof(b) != "undefined") {
return b;
} else {
return;
}
}, isInEditModeByHierarchicalIndex: function (a) {
if (this._editIndexes != null && typeof(this._editIndexes) != "undefined") {
for (var b = 0;
b < this._editIndexes.length;
b++) {
if (this._editIndexes[b] == a) {
return true;
}
}
return false;
} else {
return false;
}
}, _shouldSkipNavigation: function (a) {
var b = (a.tagName.toLowerCase() == "input" && a.type.toLowerCase() == "checkbox" && (a.id && a.id.indexOf("SelectCheckBox") != -1));
var c = a && a.className && a.className.indexOf("RadDropDownList") != -1;
if (a != null && a.tagName && !b && (a.tagName.toLowerCase() == "input" || a.tagName.toLowerCase() == "textarea" || a.tagName.toLowerCase() == "select" || c)) {
return true;
}
return false;
}, _handleActiveRowNavigation: function (m) {
var q = m.keyCode || m.charCode;
var c = Telerik.Web.UI.Grid.GetCurrentElement(m);
if (this._shouldSkipNavigation(c)) {
return;
}
var A = this._getPositionedDataItems();
if (A.length <= 0) {
return;
}
var z = this._keyboardNavigationProperties;
var F = 38;
var k = 40;
var h = this.get_allowActiveRowCycle();
var a = this._activeRow;
var b = this.ClientSettings;
if (a && b.Selecting && !b.Selecting.AllowRowSelect) {
z.currentSelectedIndex = this._searchRowIndex(a.id);
}
if (b.Selecting && b.Selecting.AllowRowSelect) {
this._selection._selectionInProgress = true;
var D = this._selection;
var E = false;
var j = true;
var C = [];
for (var o = 0;
len = A.length, o < len;
o++) {
if (A[o].get_selected()) {
C[C.length] = A[o];
}
}
if (z.firstSelection) {
if (a) {
z.currentSelectedIndex = this._searchRowIndex(a.id);
this._clearSelectedItemsExcludingInterval(z.currentSelectedIndex, z.currentSelectedIndex);
z.lastSelectedRowIndex = z.currentSelectedIndex;
this._selection._lastSelectedItemIndex = z.currentSelectedIndex;
} else {
if (C.length > 0) {
z.currentSelectedIndex = this._searchRowIndex(C[0].get_id());
z.lastSelectedRowIndex = z.currentSelectedIndex;
this._selection._lastSelectedItemIndex = z.currentSelectedIndex;
}
}
z.setInitialState();
}
if (C.length > 1 && z.currentSelectedIndex !== undefined) {
if (z.lastClickSelectedItem) {
var s = this._searchRowIndex(z.lastClickSelectedItem.id);
if (s) {
z.currentSelectedIndex = s;
}
if (s && z.currentSelectedIndex === s && m.shiftKey) {
this._clearSelectedItemsExcludingInterval(s, s);
if (!A[z.currentSelectedIndex].get_selected()) {
D._selectRowInternal(A[z.currentSelectedIndex].get_element(), m, true, true, false);
}
E = true;
z.setInitialState();
}
}
} else {
if (C.length > 0 && z.lastClickSelectedItem) {
z.currentSelectedIndex = this._searchRowIndex(z.lastClickSelectedItem.id);
z.setInitialState();
} else {
if (!a) {
if (q == F) {
z.currentSelectedIndex = 1;
}
}
}
}
if (z.currentSelectedIndex == "undefined" || isNaN(z.currentSelectedIndex) || z.currentSelectedIndex == null) {
if (q == F) {
z.currentSelectedIndex = 1;
} else {
if (q == k) {
z.currentSelectedIndex = 0;
}
}
}
z.lastClickSelectedItem = null;
if ((z.holdingCtrl && m.shiftKey && !m.ctrlKey && !E)) {
z.setInitialState();
if (a && $find(a.id).get_selected() || C.length > 1 && !z.holdingCtrl) {
this._clearSelectedItemsExcludingInterval(z.initialRowIndex, z.initialRowIndex);
if (!A[z.initialRowIndex].get_selected()) {
D._selectRowInternal(A[z.initialRowIndex].get_element(), m, true, true, false);
}
} else {
var r = z.lastSelectedRowIndex;
z.initialRowIndex = r;
if ((z.currentSelectedIndex < r || h) && (q == F || !h && q == k)) {
if (r > z.currentSelectedIndex) {
this._clearSelectedItemsExcludingInterval(z.currentSelectedIndex, r);
} else {
this._clearSelectedItemsInInterval(r, z.currentSelectedIndex);
}
this._selectItemsInInterval(r, z.currentSelectedIndex, -1);
} else {
if (q == k || !h) {
if (z.currentSelectedIndex > r) {
this._clearSelectedItemsExcludingInterval(r, z.currentSelectedIndex);
} else {
this._clearSelectedItemsInInterval(z.currentSelectedIndex, r);
}
this._selectItemsInInterval(r, z.currentSelectedIndex, 1);
}
}
}
}
var v = z.currentSelectedIndex;
var y = A[z.currentSelectedIndex];
var w = z.directionIndex;
var x = z.currentSelectedIndex;
var f = q;
if (f == F) {
f = k;
} else {
f = F;
}
while (y && !y.get_selectable()) {
x = this._getNextIndex(f, false, x);
y = A[x];
}
var u = (z.directionIndex > 0 && q == k) || (z.directionIndex < 0 && q == F);
if (z.currentSelectedIndex === z.initialRowIndex && u && A.length - z.unselectableItemsCount === C.length) {
j = false;
}
}
z.currentSelectedIndex = this._getNextIndex(q, true);
if (b.Selecting && b.Selecting.AllowRowSelect) {
if ((!m.shiftKey || C.length === 0)) {
if (A[z.currentSelectedIndex].get_selectable()) {
z.setInitialState();
}
}
var G = z.directionIndex > 0 && q == F;
var l = z.directionIndex < 0 && q == k;
var t = z.currentSelectedIndex;
while (!A[t].get_selectable()) {
t = this._getNextIndex(q, false, t);
}
if (t === z.initialRowIndex && (G || l || (w !== 0 && z.directionIndex === 0))) {
if (A.length - z.unselectableItemsCount === C.length) {
j = false;
} else {
if (y.get_selected() && A[z.currentSelectedIndex].get_selectable() && !m.ctrlKey) {
var n = {ctrlKey: false};
D._selectRowInternal(y.get_element(), n, true, true, false);
}
var p = z.currentSelectedIndex;
z.currentSelectedIndex = t;
z.setInitialState();
z.currentSelectedIndex = p;
}
}
if (y && y.get_selected() && A[z.currentSelectedIndex].get_selected() && j) {
var d = z.currentSelectedIndex;
while (A[d] && !A[d].get_selectable()) {
d = this._getNextIndex(q, false, d);
}
if (!m.ctrlKey && m.shiftKey && A[d] && A[d].get_selected() && A[d].get_selectable()) {
if (y.get_selected()) {
var n = {ctrlKey: false};
D._selectRowInternal(y.get_element(), n, true, true, false);
}
}
} else {
if (y && !y.get_selected() && m.ctrlKey && m.shiftKey) {
var n = {ctrlKey: m.ctrlKey};
D._selectRowInternal(y.get_element(), n, true, true, false);
} else {
if (m.shiftKey && a && z.firstSelection) {
var g = z.currentSelectedIndex;
z.currentSelectedIndex = x;
z.setInitialState();
z.currentSelectedIndex = g;
if (!y.get_selected()) {
var n = {ctrlKey: false};
D._selectRowInternal(a, n, true, true, false);
}
}
}
}
if (m.ctrlKey) {
z.holdingCtrl = true;
} else {
z.holdingCtrl = false;
}
this._selection._selectionInProgress = false;
if (!m.shiftKey && !m.ctrlKey) {
this._selection._lastSelectedItemIndex = z.currentSelectedIndex;
}
}
this._setActiveRow(A[z.currentSelectedIndex].get_element(), m);
var B = false;
if (b.Selecting && b.Selecting.AllowRowSelect) {
if (!m.ctrlKey || m.ctrlKey && m.shiftKey) {
B = true;
D._selectRowInternal(A[z.currentSelectedIndex].get_element(), m, false, true, true, false);
}
if (!B) {
this.updateClientState();
}
if (a && $find(a.id) && $find(a.id).get_selected() && !m.shiftKey && m.ctrlKey && B) {
z.lastSelectedRowIndex = z.currentSelectedIndex;
}
}
z.firstSelection = false;
m.preventDefault();
}, _getNextIndex: function (g, b, f) {
var j = this._getPositionedDataItems(), i = this._keyboardNavigationProperties, d = this.get_allowActiveRowCycle(), l = 38, e = 40, c = i.currentSelectedIndex, h = this.get_masterTableView(), m = h._virtualization, k = m && m._haveCustomScrollbar ? m._getScrollInfo() : null, a = 0;
if (f) {
c = f;
}
if (g == l) {
c--;
if (c < 0) {
if (k) {
m.select(Math.max(m.get_startIndex() - j.length + Math.floor(k.itemAtBottom - k.itemAtTop), 0));
c = Math.floor(k.itemAtTop) - m.get_startIndex() - 1;
} else {
if (d) {
c = j.length - 1;
} else {
c = 0;
}
}
}
if (k && m.get_startIndex() + c < h.get_currentPageIndex() * h.get_pageSize()) {
c++;
} else {
if (k && m.get_startIndex() + c <= Math.floor(k.itemAtTop)) {
m.scrollToIndex(m.get_startIndex() + c);
}
}
if (b) {
i.directionIndex++;
}
} else {
if (g == e) {
c++;
if (c > j.length - 1) {
if (k) {
c = Math.min(Math.floor(k.itemAtBottom - k.itemAtTop), m.get_virtualItemCount());
a = j.length - Math.floor(k.itemAtBottom - k.itemAtTop);
} else {
if (d) {
c = 0;
} else {
c = j.length - 1;
}
}
}
if (k && m.get_startIndex() + c >= (h.get_currentPageIndex() + 1) * h.get_pageSize()) {
c--;
} else {
if (k && (m.get_startIndex() + c >= Math.floor(k.itemAtBottom) || a > 0)) {
m.scrollToIndex(m.get_startIndex() + c + a, true);
}
}
if (b) {
i.directionIndex--;
}
}
}
return c;
}, _clearSelectedItemsExcludingInterval: function (e, c) {
var a = 0;
var b = [];
for (var d = 0;
d < this._selectedItemsInternal.length;
d++) {
a = this._searchRowIndex(this._selectedItemsInternal[d].id);
if (a < e || a > c) {
b.push(a);
}
}
for (var d = 0;
d < b.length;
d++) {
this._positionedDataItems[b[d]].set_selected(false);
}
}, _clearSelectedItemsInInterval: function (e, c) {
var a = 0;
var b = [];
for (var d = 0;
d < this._selectedItemsInternal.length;
d++) {
a = this._searchRowIndex(this._selectedItemsInternal[d].id);
if (a > e && a < c) {
b.push(a);
}
}
for (var d = 0;
d < b.length;
d++) {
this._positionedDataItems[b[d]].set_selected(false);
}
}, _selectItemsInInterval: function (f, c, b) {
var e = this._getPositionedDataItems();
var a = f;
c += b;
do {
if (a < 0) {
a = e.length - 1;
} else {
if (a > e.length - 1) {
a = 0;
}
}
if (e[a] && !e[a].get_selected()) {
var d = {ctrlKey: false};
this._selection._selectRowInternal(e[a].get_element(), d, true, true, false);
}
a += b;
} while (a !== c);
}, _getPositionedDataItems: function (b) {
var a = this._positionedDataItems;
if (a && a.length > 0 && !b) {
return a;
}
this._keyboardNavigationProperties.unselectableItemsCount = 0;
a = this._getAllChildItemsRecursive(this.get_masterTableView());
this._positionedDataItemsIndexes = {};
for (var c = 0;
len = a.length, c < len;
c++) {
this._positionedDataItemsIndexes[a[c].get_id()] = c;
}
this._keyboardNavigationProperties.firstSelection = true;
this._positionedDataItems = a;
return a;
}, _getAllChildItemsRecursive: function (m) {
if (!m || (m && (m.get_element().parentNode.parentNode.style.display === "none"))) {
return [];
}
var a = [];
var f = m.get_dataItems();
for (var d = 0, h = f.length;
d < h;
d++) {
var e = f[d];
if (e.get_element().style.display === "none") {
continue;
}
if (!e.get_selectable() && !e.get_selected()) {
this._keyboardNavigationProperties.unselectableItemsCount++;
}
a[a.length] = e;
var l = e.get_nestedViews();
if (l.length) {
for (var g = 0, k = l.length;
g < k;
g++) {
var c = l[g];
var b = this._getAllChildItemsRecursive(c);
if (b.length) {
Array.addRange(a, b);
}
}
}
}
return a;
}, _searchRowIndex: function (a) {
this._getPositionedDataItems();
return this._positionedDataItemsIndexes[a];
}, _setActiveRow: function (e, b) {
if (e && this.ClientSettings && this.ClientSettings.AllowKeyboardNavigation) {
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(this._activeRow || e, b);
this.raise_activeRowChanging(a);
if (a.get_cancel()) {
return;
}
if (this._activeRow) {
var d = $find(this._activeRow.id.split("__")[0]);
Telerik.Web.UI.Grid.ClearItemStyle(this._activeRow, d._data._renderActiveItemStyle, d._data._renderActiveItemStyleClass);
}
this._activeRow = e;
var c = $find(e.id.split("__")[0]);
Telerik.Web.UI.Grid.SetItemStyle(e, c._data._renderActiveItemStyle, c._data._renderActiveItemStyleClass);
Telerik.Web.UI.Grid.ScrollIntoView(e);
this.updateClientState();
this.raise_activeRowChanged(new Telerik.Web.UI.GridDataItemEventArgs(this._activeRow, b));
}
}, clearActiveRow: function () {
if (this._activeRow) {
var a = $find(this._activeRow.id.split("__")[0]);
Telerik.Web.UI.Grid.ClearItemStyle(this._activeRow, a._data._renderActiveItemStyle, a._data._renderActiveItemStyleClass);
this._activeRow = null;
this.updateClientState();
}
}, set_activeRow: function (a) {
this._setActiveRow(a, null);
}, _ensureDataItemsCreated: function (a) {
if (a._dataItems.length == 0) {
a.get_dataItems();
}
}, _isClientSideExpandCollapse: function (g) {
var b = g.cells;
for (var d = 0, f = b.length;
d < f;
d++) {
var a = b[d], c = a.className;
if (c && c.indexOf("rgExpandCol") > -1) {
var e = a.getElementsByTagName("input")[0];
if (e && e.onclick && e.onclick.toString().indexOf("_toggleExpand") > -1) {
return true;
}
}
}
return false;
}, _handleActiveRowExpandCollapse: function (d) {
var j = d.keyCode || d.charCode;
if (!this._activeRow) {
return;
}
var o = $find(this._activeRow.id.split("__")[0]);
this._ensureDataItemsCreated(o);
var k = o._hierarchyLoadMode;
var i = k == "ServerOnDemand" || k == "ServerBind";
var g = k == "Conditional";
var f = g && this._isClientSideExpandCollapse(this._activeRow);
if (j == this.ClientSettings.KeyboardNavigationSettings.CollapseDetailTableKey) {
var l = o._getNextNestedDataRow(this._activeRow);
if (i && l || !f) {
this._shouldFocusOnPage = true;
var c = this._activeRow.id + "##";
o.fireCommand("ExpandCollapse", c);
}
if (l && l.parentNode.style.display != "none" || l && $find(this._activeRow.id).get_isInEditMode() && l.parentNode.style.display != "none") {
o._performCollapseItem(this._activeRow);
this._getPositionedDataItems(true);
}
} else {
if (j == this.ClientSettings.KeyboardNavigationSettings.ExpandDetailTableKey) {
var n = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(this._activeRow, "tr");
if ($find(this._activeRow.id).get_isInEditMode()) {
n = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(n, "tr");
}
if (!o._isDataItemElement(n) && o._data.hasDetailItemTemplate) {
n = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(n, "tr");
}
if (n && n.style.display == "none" && n.className.indexOf("rgNoRecords") === -1) {
o.expandItem(this._activeRow);
this._getPositionedDataItems(true);
this.get_element().focus();
} else {
if (o._hasDetailTables && (i || !f)) {
var a = $find(this._activeRow.id);
var m = a.get_nestedViews()[0];
var b = this._activeRow.id;
if (a) {
var o = $find(b.split("__")[0]);
this._ensureDataItemsCreated(o);
}
var h = $find(b).get_isInEditMode();
if ((m && j == this.ClientSettings.KeyboardNavigationSettings.CollapseDetailTableKey) || (!m && j == this.ClientSettings.KeyboardNavigationSettings.ExpandDetailTableKey)) {
this._shouldFocusOnPage = true;
var c = this._activeRow.id + "##";
o.fireCommand("ExpandCollapse", c);
}
}
}
}
}
}, _handleActiveRowSelection: function (b) {
if (this._activeRow) {
this._selection._selectRowInternal(this._activeRow, {ctrlKey: (this.get_allowMultiRowSelection() && b.ctrlKey)}, false, true, true);
if (this.ClientSettings.AllowKeyboardNavigation) {
var c = this._keyboardNavigationProperties;
var a = this._getPositionedDataItems()[c.currentSelectedIndex];
if (a && a.get_selected()) {
c.lastSelectedRowIndex = c.currentSelectedIndex;
}
c.lastClickSelectedItem = this._getPositionedDataItems()[c.currentSelectedIndex].get_element();
this._setActiveRow(this._activeRow, b);
}
b.preventDefault();
}
}, _handleActiveRowEdit: function (a) {
if (this._activeRow) {
a.preventDefault();
var b = $find(this._activeRow.id.split("__")[0]);
if (b) {
b.editItem(this._activeRow);
}
}
}, _getGridRow: function (a) {
var c = Telerik.Web.UI.Grid.GetFirstParentByTagName(Telerik.Web.UI.Grid.GetCurrentElement(a), "tr"), b = c;
if (c && c.id != "" && c.id.split("__").length == 2) {
do {
if (Telerik.Web.UI.RadGrid.isInstanceOfType($find(b.id))) {
break;
}
b = b.parentNode;
} while (b);
if (b && $find(b.id) === this) {
return c;
}
}
return false;
}, _click: function (a) {
if (!this._canRiseRowEvent(a)) {
return;
}
if (!this.get_enableAriaSupport() && (!!this.ClientSettings.AllowKeyboardNavigation && this.ClientSettings.Selecting.CellSelectionMode == Telerik.Web.UI.GridCellSelectionMode.None)) {
if ($telerik.isIE) {
if (this.get_element().setActive) {
try {
this.get_element().setActive();
} catch (b) {
}
}
} else {
if (this.get_element().focus) {
this.get_element().focus();
}
}
}
var c = this._getGridRow(a);
if (c) {
this.raise_rowClick(new Telerik.Web.UI.GridDataItemEventArgs(c, a));
}
}, _dblclick: function (a) {
if ($telerik.isTouchDevice) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment