/*
* jqgrid 4.6.0 - jquery grid
* copyright (c) 2008, tony tomov, tony@trirand.com
* dual licensed under the mit or gpl licenses
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl-2.0.html
* date:2014-02-20
* modules: grid.base.js; jquery.fmatter.js; grid.custom.js; grid.common.js; grid.formedit.js; grid.filter.js; grid.inlinedit.js; grid.celledit.js; jqmodal.js; jqdnr.js; grid.subgrid.js; grid.grouping.js; grid.treegrid.js; grid.pivot.js; grid.import.js; jsonxml.js; grid.tbltogrid.js; grid.jqueryui.js;
*/
(function (b) {
b.jgrid = b.jgrid || {}; b.extend(b.jgrid, {
version: "4.6.0", htmldecode: function (b) { return b && (" " === b || " " === b || 1 === b.length && 160 === b.charcodeat(0)) ? "" : b ? string(b).replace(/>/g, ">").replace(/</g, "<").replace(/"/g, '"').replace(/&/g, "&") : b }, htmlencode: function (b) { return b ? string(b).replace(/&/g, "&").replace(/\"/g, """).replace(//g, ">") : b }, format: function (e) {
var f = b.makearray(arguments).slice(1); null == e && (e = ""); return e.replace(/\{(\d+)\}/g,
function (b, d) { return f[d] })
}, msie: "microsoft internet explorer" === navigator.appname, msiever: function () { var b = -1; null != /msie ([0-9]{1,}[.0-9]{0,})/.exec(navigator.useragent) && (b = parsefloat(regexp.$1)); return b }, getcellindex: function (e) { e = b(e); if (e.is("tr")) return -1; e = (e.is("td") || e.is("th") ? e : e.closest("td,th"))[0]; return b.jgrid.msie ? b.inarray(e, e.parentnode.cells) : e.cellindex }, striphtml: function (b) {
b = string(b); var f = /<("[^"]*"|'[^']*'|[^'">])*>/gi; return b ? (b = b.replace(f, "")) && " " !== b && " " !==
b ? b.replace(/\"/g, "'") : "" : b
}, strippref: function (e, f) { var c = b.type(e); if ("string" === c || "number" === c) e = string(e), f = "" !== e ? string(f).replace(string(e), "") : f; return f }, parse: function (e) { "while(1);" === e.substr(0, 9) && (e = e.substr(9)); "/*" === e.substr(0, 2) && (e = e.substr(2, e.length - 4)); e || (e = "{}"); return !0 === b.jgrid.usejson && "object" === typeof json && "function" === typeof json.parse ? json.parse(e) : eval("(" + e + ")") }, parsedate: function (e, f, c, d) {
var a = /^\/date\((([-+])?[0-9]+)(([-+])([0-9]{2})([0-9]{2}))?\)\/$/, l = "string" ===
typeof f ? f.match(a) : null, a = function (a, b) { a = string(a); for (b = parseint(b, 10) || 2; a.length < b;) a = "0" + a; return a }, g = { m: 1, d: 1, y: 1970, h: 0, i: 0, s: 0, u: 0 }, h = 0, k, n, h = function (a, b) { 0 === a ? 12 === b && (b = 0) : 12 !== b && (b += 12); return b }; void 0 === d && (d = b.jgrid.formatter.date); void 0 === d.parsere && (d.parsere = /[#%\\\/:_;.,\t\s-]/); d.masks.hasownproperty(e) && (e = d.masks[e]); if (f && null != f) if (isnan(f - 0) || "u" !== string(e).tolowercase()) if (f.constructor === date) h = f; else if (null !== l) {
if (h = new date(parseint(l[1], 10)), l[3]) {
var m = 60 * number(l[5]) +
number(l[6]), m = m * ("-" === l[4] ? 1 : -1), m = m - h.gettimezoneoffset(); h.settime(number(number(h) + 6e4 * m))
}
} else {
m = 0; "iso8601long" === d.srcformat && "z" === f.charat(f.length - 1) && (m -= (new date).gettimezoneoffset()); f = string(f).replace(/\t/g, "#").replace(/\t/, "%").split(d.parsere); e = e.replace(/\t/g, "#").replace(/\t/, "%").split(d.parsere); k = 0; for (n = e.length; k < n; k++) "m" === e[k] && (l = b.inarray(f[k], d.monthnames), -1 !== l && 12 > l && (f[k] = l + 1, g.m = f[k])), "f" === e[k] && (l = b.inarray(f[k], d.monthnames, 12), -1 !== l && 11 < l && (f[k] = l + 1 - 12,
g.m = f[k])), "a" === e[k] && (l = b.inarray(f[k], d.ampm), -1 !== l && 2 > l && f[k] === d.ampm[l] && (f[k] = l, g.h = h(f[k], g.h))), "a" === e[k] && (l = b.inarray(f[k], d.ampm), -1 !== l && 1 < l && f[k] === d.ampm[l] && (f[k] = l - 2, g.h = h(f[k], g.h))), "g" === e[k] && (g.h = parseint(f[k], 10)), void 0 !== f[k] && (g[e[k].tolowercase()] = parseint(f[k], 10)); g.f && (g.m = g.f); if (0 === g.m && 0 === g.y && 0 === g.d) return " "; g.m = parseint(g.m, 10) - 1; h = g.y; 70 <= h && 99 >= h ? g.y = 1900 + g.y : 0 <= h && 69 >= h && (g.y = 2e3 + g.y); h = new date(g.y, g.m, g.d, g.h, g.i, g.s, g.u); 0 < m && h.settime(number(number(h) +
6e4 * m))
} else h = new date(1e3 * parsefloat(f)); else h = new date(g.y, g.m, g.d, g.h, g.i, g.s, g.u); if (void 0 === c) return h; d.masks.hasownproperty(c) ? c = d.masks[c] : c || (c = "y-m-d"); e = h.gethours(); f = h.getminutes(); g = h.getdate(); m = h.getmonth() + 1; l = h.gettimezoneoffset(); k = h.getseconds(); n = h.getmilliseconds(); var r = h.getday(), p = h.getfullyear(), q = (r + 6) % 7 + 1, x = (new date(p, m - 1, g) - new date(p, 0, 1)) / 864e5, g = {
d: a(g), d: d.daynames[r], j: g, l: d.daynames[r + 7], n: q, s: d.s(g), w: r, z: x, w: 5 > q ? math.floor((x + q - 1) / 7) + 1 : math.floor((x + q - 1) / 7) ||
(4 > ((new date(p - 1, 0, 1)).getday() + 6) % 7 ? 53 : 52), f: d.monthnames[m - 1 + 12], m: a(m), m: d.monthnames[m - 1], n: m, t: "?", l: "?", o: "?", y: p, y: string(p).substring(2), a: 12 > e ? d.ampm[0] : d.ampm[1], a: 12 > e ? d.ampm[2] : d.ampm[3], b: "?", g: e % 12 || 12, g: e, h: a(e % 12 || 12), h: a(e), i: a(f), s: a(k), u: n, e: "?", i: "?", o: (0 < l ? "-" : "+") + a(100 * math.floor(math.abs(l) / 60) + math.abs(l) % 60, 4), p: "?", t: (string(h).match(/\b(?:[pmcea][sdp]t|(?:pacific|mountain|central|eastern|atlantic) (?:standard|daylight|prevailing) time|(?:gmt|utc)(?:[-+]\d{4})?)\b/g) ||
[""]).pop().replace(/[^-+\da-z]/g, ""), z: "?", c: "?", r: "?", u: math.floor(h / 1e3)
}; return c.replace(/\\.|[ddjlnswzwfmmntloyyaabgghhisueioptzcru]/g, function (a) { return g.hasownproperty(a) ? g[a] : a.substring(1) })
}, jqid: function (b) { return string(b).replace(/[!"#$%&'()*+,.\/:; <=>?@\[\\\]\^`{|}~]/g, "\\$&") }, guid: 1, uidpref: "jqg", randid: function (e) { return (e || b.jgrid.uidpref) + b.jgrid.guid++ }, getaccessor: function (b, f) {
var c, d, a = [], l; if ("function" === typeof f) return f(b); c = b[f]; if (void 0 === c) try {
if ("string" === typeof f &&
(a = f.split(".")), l = a.length) for (c = b; c && l--;) d = a.shift(), c = c[d]
} catch (g) { } return c
}, getxmldata: function (e, f, c) { var d = "string" === typeof f ? f.match(/^(.*)\[(\w+)\]$/) : null; if ("function" === typeof f) return f(e); if (d && d[2]) return d[1] ? b(d[1], e).attr(d[2]) : b(e).attr(d[2]); e = b(f, e); return c ? e : 0 < e.length ? b(e).text() : void 0 }, cellwidth: function () {
var e = b("
"),
f = e.appendto("body").find("td").width(); e.remove(); return 0.1 < math.abs(f - 5)
}, cell_width: !0, ajaxoptions: {}, from: function (e) {
return new function (e, c) {
"string" === typeof e && (e = b.data(e)); var d = this, a = e, l = !0, g = !1, h = c, k = /[\$,%]/g, n = null, m = null, r = 0, p = !1, q = "", x = [], g = !0; if ("object" === typeof e && e.push) 0 < e.length && (g = "object" !== typeof e[0] ? !1 : !0); else throw "data provides is not an array"; this._hasdata = function () { return null === a ? !1 : 0 === a.length ? !1 : !0 }; this._getstr = function (a) {
var b = []; g && b.push("jquery.trim(");
b.push("string(" + a + ")"); g && b.push(")"); l || b.push(".tolowercase()"); return b.join("")
}; this._strcomp = function (a) { return "string" === typeof a ? ".tostring()" : "" }; this._group = function (a, b) { return { field: a.tostring(), unique: b, items: [] } }; this._tostr = function (a) { g && (a = b.trim(a)); a = a.tostring().replace(/\\/g, "\\\\").replace(/\"/g, '\\"'); return l ? a : a.tolowercase() }; this._funcloop = function (d) { var l = []; b.each(a, function (a, b) { l.push(d(b)) }); return l }; this._append = function (a) {
var b; h = null === h ? "" : h + ("" === q ? " && " :
q); for (b = 0; b < r; b++) h += "("; p && (h += "!"); h += "(" + a + ")"; p = !1; q = ""; r = 0
}; this._setcommand = function (a, b) { n = a; m = b }; this._resetnegate = function () { p = !1 }; this._repeatcommand = function (a, b) { return null === n ? d : null !== a && null !== b ? n(a, b) : null !== m && g ? n(m, a) : n(a) }; this._equals = function (a, b) { return 0 === d._compare(a, b, 1) }; this._compare = function (a, b, d) {
var e = object.prototype.tostring; void 0 === d && (d = 1); void 0 === a && (a = null); void 0 === b && (b = null); if (null === a && null === b) return 0; if (null === a && null !== b) return 1; if (null !== a && null ===
b) return -1; if ("[object date]" === e.call(a) && "[object date]" === e.call(b)) return a < b ? -d : a > b ? d : 0; l || "number" === typeof a || "number" === typeof b || (a = string(a), b = string(b)); return a < b ? -d : a > b ? d : 0
}; this._performsort = function () { 0 !== x.length && (a = d._dosort(a, 0)) }; this._dosort = function (a, b) {
var l = x[b].by, e = x[b].dir, g = x[b].type, c = x[b].datefmt, f = x[b].sfunc; if (b === x.length - 1) return d._getorder(a, l, e, g, c, f); b++; l = d._getgroup(a, l, e, g, c); e = []; for (g = 0; g < l.length; g++) for (f = d._dosort(l[g].items, b), c = 0; c < f.length; c++) e.push(f[c]);
return e
}; this._getorder = function (a, e, g, c, f, h) {
var m = [], n = [], r = "a" === g ? 1 : -1, p, x; void 0 === c && (c = "text"); x = "float" === c || "number" === c || "currency" === c || "numeric" === c ? function (a) { a = parsefloat(string(a).replace(k, "")); return isnan(a) ? 0 : a } : "int" === c || "integer" === c ? function (a) { return a ? parsefloat(string(a).replace(k, "")) : 0 } : "date" === c || "datetime" === c ? function (a) { return b.jgrid.parsedate(f, a).gettime() } : b.isfunction(c) ? c : function (a) { a = a ? b.trim(string(a)) : ""; return l ? a : a.tolowercase() }; b.each(a, function (a,
d) { p = "" !== e ? b.jgrid.getaccessor(d, e) : d; void 0 === p && (p = ""); p = x(p, d); n.push({ vsort: p, index: a }) }); b.isfunction(h) ? n.sort(function (a, b) { a = a.vsort; b = b.vsort; return h.call(this, a, b, r) }) : n.sort(function (a, b) { a = a.vsort; b = b.vsort; return d._compare(a, b, r) }); c = 0; for (var q = a.length; c < q;) g = n[c].index, m.push(a[g]), c++; return m
}; this._getgroup = function (a, c, e, l, g) {
var f = [], h = null, k = null, m; b.each(d._getorder(a, c, e, l, g), function (a, e) {
m = b.jgrid.getaccessor(e, c); null == m && (m = ""); d._equals(k, m) || (k = m, null !== h && f.push(h),
h = d._group(c, m)); h.items.push(e)
}); null !== h && f.push(h); return f
}; this.ignorecase = function () { l = !1; return d }; this.usecase = function () { l = !0; return d }; this.trim = function () { g = !0; return d }; this.notrim = function () { g = !1; return d }; this.execute = function () { var c = h, e = []; if (null === c) return d; b.each(a, function () { eval(c) && e.push(this) }); a = e; return d }; this.data = function () { return a }; this.select = function (c) {
d._performsort(); if (!d._hasdata()) return []; d.execute(); if (b.isfunction(c)) {
var e = []; b.each(a, function (a, b) { e.push(c(b)) });
return e
} return a
}; this.hasmatch = function () { if (!d._hasdata()) return !1; d.execute(); return 0 < a.length }; this.andnot = function (a, b, c) { p = !p; return d.and(a, b, c) }; this.ornot = function (a, b, c) { p = !p; return d.or(a, b, c) }; this.not = function (a, b, c) { return d.andnot(a, b, c) }; this.and = function (a, b, c) { q = " && "; return void 0 === a ? d : d._repeatcommand(a, b, c) }; this.or = function (a, b, c) { q = " || "; return void 0 === a ? d : d._repeatcommand(a, b, c) }; this.orbegin = function () { r++; return d }; this.orend = function () { null !== h && (h += ")"); return d };
this.isnot = function (a) { p = !p; return d.is(a) }; this.is = function (a) { d._append("this." + a); d._resetnegate(); return d }; this._comparevalues = function (a, c, e, l, g) {
var f; f = g ? "jquery.jgrid.getaccessor(this,'" + c + "')" : "this"; void 0 === e && (e = null); var h = e, m = void 0 === g.stype ? "text" : g.stype; if (null !== e) switch (m) {
case "int": case "integer": h = isnan(number(h)) || "" === h ? "0" : h; f = "parseint(" + f + ",10)"; h = "parseint(" + h + ",10)"; break; case "float": case "number": case "numeric": h = string(h).replace(k, ""); h = isnan(number(h)) || "" === h ?
"0" : h; f = "parsefloat(" + f + ")"; h = "parsefloat(" + h + ")"; break; case "date": case "datetime": h = string(b.jgrid.parsedate(g.newfmt || "y-m-d", h).gettime()); f = 'jquery.jgrid.parsedate("' + g.srcfmt + '",' + f + ").gettime()"; break; default: f = d._getstr(f), h = d._getstr('"' + d._tostr(h) + '"')
} d._append(f + " " + l + " " + h); d._setcommand(a, c); d._resetnegate(); return d
}; this.equals = function (a, b, c) { return d._comparevalues(d.equals, a, b, "==", c) }; this.notequals = function (a, b, c) { return d._comparevalues(d.equals, a, b, "!==", c) }; this.isnull = function (a,
b, c) { return d._comparevalues(d.equals, a, null, "===", c) }; this.greater = function (a, b, c) { return d._comparevalues(d.greater, a, b, ">", c) }; this.less = function (a, b, c) { return d._comparevalues(d.less, a, b, "<", c) }; this.greaterorequals = function (a, b, c) { return d._comparevalues(d.greaterorequals, a, b, ">=", c) }; this.lessorequals = function (a, b, c) { return d._comparevalues(d.lessorequals, a, b, "<=", c) }; this.startswith = function (a, c) {
var e = null == c ? a : c, e = g ? b.trim(e.tostring()).length : e.tostring().length; g ? d._append(d._getstr("jquery.jgrid.getaccessor(this,'" +
a + "')") + ".substr(0," + e + ") == " + d._getstr('"' + d._tostr(c) + '"')) : (null != c && (e = g ? b.trim(c.tostring()).length : c.tostring().length), d._append(d._getstr("this") + ".substr(0," + e + ") == " + d._getstr('"' + d._tostr(a) + '"'))); d._setcommand(d.startswith, a); d._resetnegate(); return d
}; this.endswith = function (a, c) {
var e = null == c ? a : c, e = g ? b.trim(e.tostring()).length : e.tostring().length; g ? d._append(d._getstr("jquery.jgrid.getaccessor(this,'" + a + "')") + ".substr(" + d._getstr("jquery.jgrid.getaccessor(this,'" + a + "')") + ".length-" +
e + "," + e + ') == "' + d._tostr(c) + '"') : d._append(d._getstr("this") + ".substr(" + d._getstr("this") + '.length-"' + d._tostr(a) + '".length,"' + d._tostr(a) + '".length) == "' + d._tostr(a) + '"'); d._setcommand(d.endswith, a); d._resetnegate(); return d
}; this.contains = function (a, b) { g ? d._append(d._getstr("jquery.jgrid.getaccessor(this,'" + a + "')") + '.indexof("' + d._tostr(b) + '",0) > -1') : d._append(d._getstr("this") + '.indexof("' + d._tostr(a) + '",0) > -1'); d._setcommand(d.contains, a); d._resetnegate(); return d }; this.groupby = function (b,
c, e, l) { return d._hasdata() ? d._getgroup(a, b, c, e, l) : null }; this.orderby = function (a, c, e, l, g) { c = null == c ? "a" : b.trim(c.tostring().tolowercase()); null == e && (e = "text"); null == l && (l = "y-m-d"); null == g && (g = !1); if ("desc" === c || "descending" === c) c = "d"; if ("asc" === c || "ascending" === c) c = "a"; x.push({ by: a, dir: c, type: e, datefmt: l, sfunc: g }); return d }; return d
}(e, null)
}, getmethod: function (e) { return this.getaccessor(b.fn.jqgrid, e) }, extend: function (e) { b.extend(b.fn.jqgrid, e); this.no_legacy_api || b.fn.extend(e) }
}); b.fn.jqgrid = function (e) {
if ("string" ===
typeof e) { var f = b.jgrid.getmethod(e); if (!f) throw "jqgrid - no such method: " + e; var c = b.makearray(arguments).slice(1); return f.apply(this, c) } return this.each(function () {
if (!this.grid) {
var d = b.extend(!0, {
url: "", height: 150, page: 1, rownum: 20, rowtotal: null, records: 0, pager: "", pgbuttons: !0, pginput: !0, colmodel: [], rowlist: [], colnames: [], sortorder: "asc", sortname: "", datatype: "xml", mtype: "get", altrows: !1, selarrrow: [], savedrow: [], shrinktofit: !0, xmlreader: {}, jsonreader: {}, subgrid: !1, subgridmodel: [], reccount: 0, lastpage: 0,
lastsort: 0, selrow: null, beforeselectrow: null, onselectrow: null, onsortcol: null, ondblclickrow: null, onrightclickrow: null, onpaging: null, onselectall: null, oninitgrid: null, loadcomplete: null, gridcomplete: null, loaderror: null, loadbeforesend: null, afterinsertrow: null, beforerequest: null, beforeprocessing: null, onheaderclick: null, viewrecords: !1, loadonce: !1, multiselect: !1, multikey: !1, editurl: null, search: !1, caption: "", hidegrid: !0, hiddengrid: !1, postdata: {}, userdata: {}, treegrid: !1, treegridmodel: "nested", treereader: {},
treeanode: -1, expandcolumn: null, tree_root_level: 0, prmnames: { page: "page", rows: "rows", sort: "sidx", order: "sord", search: "_search", nd: "nd", id: "id", oper: "oper", editoper: "edit", addoper: "add", deloper: "del", subgridid: "id", npage: null, totalrows: "totalrows" }, forcefit: !1, gridstate: "visible", celledit: !1, cellsubmit: "remote", nv: 0, loadui: "enable", toolbar: [!1, ""], scroll: !1, multiboxonly: !1, deselectaftersort: !0, scrollrows: !1, autowidth: !1, scrolloffset: 18, celllayout: 5, subgridwidth: 20, multiselectwidth: 20, gridview: !1, rownumwidth: 25,
rownumbers: !1, pagerpos: "center", recordpos: "right", footerrow: !1, userdataonfooter: !1, hoverrows: !0, altclass: "ui-priority-secondary", viewsortcols: [!1, "vertical", !0], resizeclass: "", autoencode: !1, remapcolumns: [], ajaxgridoptions: {}, direction: "ltr", toppager: !1, headertitles: !1, scrolltimeout: 40, data: [], _index: {}, grouping: !1, groupingview: {
groupfield: [], grouporder: [], grouptext: [], groupcolumnshow: [], groupsummary: [], showsummaryonhide: !1, sortitems: [], sortnames: [], summary: [], summaryval: [], plusicon: "ui-icon-circlesmall-plus",
minusicon: "ui-icon-circlesmall-minus", displayfield: [], groupsummarypos: [], formatdisplayfield: [], _locgr: !1
}, ignorecase: !1, cmtemplate: {}, idprefix: "", multisort: !1
}, b.jgrid.defaults, e || {}), a = this, c = {
headers: [], cols: [], footers: [], dragstart: function (c, e, g) {
var f = b(this.bdiv).offset().left; this.resizing = { idx: c, startx: e.clientx, sol: e.clientx - f }; this.hdiv.style.cursor = "col-resize"; this.curgbox = b("#rs_m" + b.jgrid.jqid(d.id), "#gbox_" + b.jgrid.jqid(d.id)); this.curgbox.css({
display: "block", left: e.clientx - f, top: g[1],
height: g[2]
}); b(a).triggerhandler("jqgridresizestart", [e, c]); b.isfunction(d.resizestart) && d.resizestart.call(a, e, c); document.onselectstart = function () { return !1 }
}, dragmove: function (a) {
if (this.resizing) {
var b = a.clientx - this.resizing.startx; a = this.headers[this.resizing.idx]; var c = "ltr" === d.direction ? a.width + b : a.width - b, e; 33 < c && (this.curgbox.css({ left: this.resizing.sol + b }), !0 === d.forcefit ? (e = this.headers[this.resizing.idx + d.nv], b = "ltr" === d.direction ? e.width - b : e.width + b, 33 < b && (a.newwidth = c, e.newwidth = b)) :
(this.newwidth = "ltr" === d.direction ? d.tblwidth + b : d.tblwidth - b, a.newwidth = c))
}
}, dragend: function () {
this.hdiv.style.cursor = "default"; if (this.resizing) {
var c = this.resizing.idx, e = this.headers[c].newwidth || this.headers[c].width, e = parseint(e, 10); this.resizing = !1; b("#rs_m" + b.jgrid.jqid(d.id)).css("display", "none"); d.colmodel[c].width = e; this.headers[c].width = e; this.headers[c].el.style.width = e + "px"; this.cols[c].style.width = e + "px"; 0 < this.footers.length && (this.footers[c].style.width = e + "px"); !0 === d.forcefit ? (e =
this.headers[c + d.nv].newwidth || this.headers[c + d.nv].width, this.headers[c + d.nv].width = e, this.headers[c + d.nv].el.style.width = e + "px", this.cols[c + d.nv].style.width = e + "px", 0 < this.footers.length && (this.footers[c + d.nv].style.width = e + "px"), d.colmodel[c + d.nv].width = e) : (d.tblwidth = this.newwidth || d.tblwidth, b("table:first", this.bdiv).css("width", d.tblwidth + "px"), b("table:first", this.hdiv).css("width", d.tblwidth + "px"), this.hdiv.scrollleft = this.bdiv.scrollleft, d.footerrow && (b("table:first", this.sdiv).css("width",
d.tblwidth + "px"), this.sdiv.scrollleft = this.bdiv.scrollleft)); b(a).triggerhandler("jqgridresizestop", [e, c]); b.isfunction(d.resizestop) && d.resizestop.call(a, e, c)
} this.curgbox = null; document.onselectstart = function () { return !0 }
}, populatevisible: function () {
c.timer && cleartimeout(c.timer); c.timer = null; var a = b(c.bdiv).height(); if (a) {
var e = b("table:first", c.bdiv), g, f; if (e[0].rows.length) try { f = (g = e[0].rows[1]) ? b(g).outerheight() || c.prevrowheight : c.prevrowheight } catch (pa) { f = c.prevrowheight } if (f) {
c.prevrowheight =
f; var h = d.rownum; g = c.scrolltop = c.bdiv.scrolltop; var k = math.round(e.position().top) - g, m = k + e.height(); f *= h; var e, n, c; m < a && 0 >= k && (void 0 === d.lastpage || parseint((m + g + f - 1) / f, 10) <= d.lastpage) && (n = parseint((a - m + f - 1) / f, 10), 0 <= m || 2 > n || !0 === d.scroll ? (e = math.round((m + g) / f) + 1, k = -1) : k = 1); 0 < k && (e = parseint(g / f, 10) + 1, n = parseint((g + a) / f, 10) + 2 - e, c = !0); !n || d.lastpage && (e > d.lastpage || 1 === d.lastpage || e === d.page && e === d.lastpage) || (c.hdiv.loading ? c.timer = settimeout(c.populatevisible, d.scrolltimeout) : (d.page = e, c && (c.selectionpreserver(e[0]),
c.emptyrows.call(e[0], !1, !1)), c.populate(n)))
}
}
}, scrollgrid: function (a) { if (d.scroll) { var b = c.bdiv.scrolltop; void 0 === c.scrolltop && (c.scrolltop = 0); b !== c.scrolltop && (c.scrolltop = b, c.timer && cleartimeout(c.timer), c.timer = settimeout(c.populatevisible, d.scrolltimeout)) } c.hdiv.scrollleft = c.bdiv.scrollleft; d.footerrow && (c.sdiv.scrollleft = c.bdiv.scrollleft); a && a.stoppropagation() }, selectionpreserver: function (a) {
var c = a.p, d = c.selrow, e = c.selarrrow ? b.makearray(c.selarrrow) : null, f = a.grid.bdiv.scrollleft, g = function () {
var h;
c.selrow = null; c.selarrrow = []; if (c.multiselect && e && 0 < e.length) for (h = 0; h < e.length; h++) e[h] !== d && b(a).jqgrid("setselection", e[h], !1, null); d && b(a).jqgrid("setselection", d, !1, null); a.grid.bdiv.scrollleft = f; b(a).unbind(".selectionpreserver", g)
}; b(a).bind("jqgridgridcomplete.selectionpreserver", g)
}
}; if ("table" !== this.tagname.touppercase()) alert("element is not a table"); else if (void 0 !== document.documentmode && 5 >= document.documentmode) alert("grid can not be used in this ('quirks') mode!"); else {
b(this).empty().attr("tabindex",
"0"); this.p = d; this.p.useprop = !!b.fn.prop; var g, f; if (0 === this.p.colnames.length) for (g = 0; g < this.p.colmodel.length; g++) this.p.colnames[g] = this.p.colmodel[g].label || this.p.colmodel[g].name; if (this.p.colnames.length !== this.p.colmodel.length) alert(b.jgrid.errors.model); else {
var k = b(""), n = b.jgrid.msie; a.p.direction = b.trim(a.p.direction.tolowercase()); -1 === b.inarray(a.p.direction, ["ltr", "rtl"]) && (a.p.direction = "ltr"); f = a.p.direction; b(k).insertbefore(this); b(this).removeclass("scroll").appendto(k);
var m = b(""); b(m).attr({ id: "gbox_" + this.id, dir: f }).insertbefore(k); b(k).attr("id", "gview_" + this.id).appendto(m); b("").insertbefore(k); b("
" + this.p.loadtext + "
").insertbefore(k); b(this).attr({
cellspacing: "0", cellpadding: "0", border: "0", role: "grid", "aria-multiselectable": !!this.p.multiselect,
"aria-labelledby": "gbox_" + this.id
}); var r = function (a, b) { a = parseint(a, 10); return isnan(a) ? b || 0 : a }, p = function (d, e, f, g, pa, h) {
var k = a.p.colmodel[d], m = k.align, e = 'style="', n = k.classes, c = k.name, a = []; m && (e += "text-align:" + m + ";"); !0 === k.hidden && (e += "display:none;"); if (0 === e) e += "width: " + c.headers[d].width + "px;"; else if (k.cellattr && b.isfunction(k.cellattr) && (d = k.cellattr.call(a, pa, f, g, k, h)) && "string" === typeof d) if (d = d.replace(/style/i, "style").replace(/title/i, "title"), -1 < d.indexof("title") && (k.title = !1), -1 <
d.indexof("class") && (n = void 0), a = d.replace("-style", "-sti").split(/style/), 2 === a.length) { a[1] = b.trim(a[1].replace("-sti", "-style").replace("=", "")); if (0 === a[1].indexof("'") || 0 === a[1].indexof('"')) a[1] = a[1].substring(1); e += a[1].replace(/'/gi, '"') } else e += '"'; a.length || (a[0] = "", e += '"'); e += (void 0 !== n ? ' class="' + n + '"' : "") + (k.title && f ? ' title="' + b.jgrid.striphtml(f) + '"' : ""); e += ' aria-describedby="' + a.p.id + "_" + c + '"'; return e + a[0]
}, q = function (c) {
return null == c || "" === c ? " " : a.p.autoencode ? b.jgrid.htmlencode(c) :
string(c)
}, x = function (c, d, e, f, g) { var h = a.p.colmodel[e]; void 0 !== h.formatter ? (c = "" !== string(a.p.idprefix) ? b.jgrid.strippref(a.p.idprefix, c) : c, c = { rowid: c, colmodel: h, gid: a.p.id, pos: e }, d = b.isfunction(h.formatter) ? h.formatter.call(a, d, c, f, g) : b.fmatter ? b.fn.fmatter.call(a, h.formatter, d, c, f, g) : q(d)) : d = q(d); return d }, g = function (a, b, c, d, e, f) { b = x(a, b, c, e, "add"); return '
" + b + "
" }, u = function (b, c, d, e) {
e = '"; return '
" + e + "
"
}, m = function (a, b, c, d) { c = (parseint(c, 10) - 1) * parseint(d, 10) + 1 + b; return '
" + c + "
" }, ea = function (b) {
var c, d = [], e = 0, f; for (f = 0; f < a.p.colmodel.length; f++) c = a.p.colmodel[f], "cb" !== c.name && "subgrid" !== c.name && "rn" !== c.name && (d[e] = "local" === b ? c.name : "xml" === b || "xmlstring" === b ? c.xmlmap || c.name : c.jsonmap || c.name, !1 !==
a.p.keyindex && !0 === c.key && (a.p.keyname = d[e]), e++); return d
}, w = function (c) { var d = a.p.remapcolumns; d && d.length || (d = b.map(a.p.colmodel, function (a, b) { return b })); c && (d = b.map(d, function (a) { return a < c ? null : a - c })); return d }, x = function (a, c) {
var d; this.p.deepempty ? b(this.rows).slice(1).remove() : (d = 0 < this.rows.length ? this.rows[0] : null, b(this.firstchild).empty().append(d)); a && this.p.scroll && (b(this.grid.bdiv.firstchild).css({ height: "auto" }), b(this.grid.bdiv.firstchild.firstchild).css({ height: 0, display: "none" }),
0 !== this.grid.bdiv.scrolltop && (this.grid.bdiv.scrolltop = 0)); !0 === c && this.p.treegrid && (this.p.data = [], this.p._index = {})
}, o = function () { var c = a.p.data.length, d, e, f; d = !0 === a.p.rownumbers ? 1 : 0; e = !0 === a.p.multiselect ? 1 : 0; f = !0 === a.p.subgrid ? 1 : 0; d = !1 === a.p.keyindex || !0 === a.p.loadonce ? a.p.localreader.id : a.p.colmodel[a.p.keyindex + e + f + d].name; for (e = 0; e < c; e++) f = b.jgrid.getaccessor(a.p.data[e], d), void 0 === f && (f = string(e + 1)), a.p._index[f] = e }, $ = function (c, d, e, f, g, h) {
var l = "-1", k = "", m; d = d ? "display:none;" : ""; e = "ui-widget-content jqgrow ui-row-" +
a.p.direction + (e ? " " + e : "") + (h ? " ui-state-highlight" : ""); h = b(a).triggerhandler("jqgridrowattr", [f, g, c]); "object" !== typeof h && (h = b.isfunction(a.p.rowattr) ? a.p.rowattr.call(a, f, g, c) : {}); if (!b.isemptyobject(h)) {
h.hasownproperty("id") && (c = h.id, delete h.id); h.hasownproperty("tabindex") && (l = h.tabindex, delete h.tabindex); h.hasownproperty("style") && (d += h.style, delete h.style); h.hasownproperty("class") && (e += " " + h["class"], delete h["class"]); try { delete h.role } catch (n) { } for (m in h) h.hasownproperty(m) && (k += " " +
m + "=" + h[m])
} return '
"
}, k = function (c, d, e, f, g) {
var h = new date, l = "local" !== a.p.datatype && a.p.loadonce || "xmlstring" === a.p.datatype, k = a.p.xmlreader, m = "local" === a.p.datatype ? "local" : "xml"; l && (a.p.data = [], a.p._index = {}, a.p.localreader.id = "_id_"); a.p.reccount = 0; if (b.isxmldoc(c)) {
-1 !== a.p.treeanode || a.p.scroll ? e = 1 < e ? e : 1 : (x.call(a, !1, !0), e = 1); var n = b(a), c, a, r = 0, p, u = !0 === a.p.multiselect ? 1 : 0, z = 0, x, q = !0 === a.p.rownumbers ?
1 : 0, t, z = [], aa, v = {}, w, h, s = [], l = !0 === a.p.altrows ? a.p.altclass : "", ia; !0 === a.p.subgrid && (z = 1, x = b.jgrid.getmethod("addsubgridcell")); k.repeatitems || (z = ea(m)); t = !1 === a.p.keyindex ? b.isfunction(k.id) ? k.id.call(a, c) : k.id : a.p.keyindex; 0 < z.length && !isnan(t) && (t = a.p.keyname); m = -1 === string(t).indexof("[") ? z.length ? function (a, c) { return b(t, a).text() || c } : function (a, c) { return b(k.cell, a).eq(t).text() || c } : function (a, b) { return a.getattribute(t.replace(/[\[\]]/g, "")) || b }; a.p.userdata = {}; a.p.page = r(b.jgrid.getxmldata(c,
k.page), a.p.page); a.p.lastpage = r(b.jgrid.getxmldata(c, k.total), 1); a.p.records = r(b.jgrid.getxmldata(c, k.records)); b.isfunction(k.userdata) ? a.p.userdata = k.userdata.call(a, c) || {} : b.jgrid.getxmldata(c, k.userdata, !0).each(function () { a.p.userdata[this.getattribute("name")] = b(this).text() }); c = b.jgrid.getxmldata(c, k.root, !0); (c = b.jgrid.getxmldata(c, k.row, !0)) || (c = []); var s = c.length, i = 0, y = [], d = parseint(a.p.rownum, 10), b = a.p.scroll ? b.jgrid.randid() : 1; 0 < s && 0 >= a.p.page && (a.p.page = 1); if (c && s) {
g && (d *= g + 1); g = b.isfunction(a.p.afterinsertrow);
var f = !1, j; a.p.grouping && (f = !0 === a.p.groupingview.groupcollapse, j = b.jgrid.getmethod("groupingprepare")); for (; i < s;) {
w = c[i]; h = m(w, b + i); h = a.p.idprefix + h; c = 0 === e ? 0 : e + 1; ia = 1 === (c + i) % 2 ? l : ""; var k = s.length; s.push(""); q && s.push(m(0, i, a.p.page, a.p.rownum)); u && s.push(u(h, q, i, !1)); z && s.push(x.call(n, u + q, i + e)); if (k.repeatitems) {
aa || (aa = w(u + z + q)); var n = b.jgrid.getxmldata(w, k.cell, !0); b.each(aa, function (b) {
var c = n[this]; if (!c) return !1; p = c.textcontent || c.text; v[a.p.colmodel[b + u + z + q].name] = p; s.push(g(h, p, b + u + z + q,
i + e, w, v))
})
} else for (c = 0; c < z.length; c++) p = b.jgrid.getxmldata(w, z[c]), v[a.p.colmodel[c + u + z + q].name] = p, s.push(g(h, p, c + u + z + q, i + e, w, v)); s[k] = $(h, f, ia, v, w, !1); s.push("
"); a.p.grouping && (y.push(s), a.p.groupingview._locgr || j.call(n, v, i), s = []); if (l || !0 === a.p.treegrid) v._id_ = b.jgrid.strippref(a.p.idprefix, h), a.p.data.push(v), a.p._index[v._id_] = a.p.data.length - 1; !1 === a.p.gridview && (b("tbody:first", d).append(s.join("")), n.triggerhandler("jqgridafterinsertrow", [h, v, w]), g && a.p.afterinsertrow.call(a, h, v, w),
s = []); v = {}; r++; i++; if (r === d) break
}
} !0 === a.p.gridview && (a = -1 < a.p.treeanode ? a.p.treeanode : 0, a.p.grouping ? (l || n.jqgrid("groupingrender", y, a.p.colmodel.length, a.p.page, d), y = null) : !0 === a.p.treegrid && 0 < a ? b(a.rows[a]).after(s.join("")) : b("tbody:first", d).append(s.join(""))); if (!0 === a.p.subgrid) try { n.jqgrid("addsubgrid", u + q) } catch (q) { } a.p.totaltime = new date - h; 0 < r && 0 === a.p.records && (a.p.records = s); s = null; if (!0 === a.p.treegrid) try { n.jqgrid("settreenode", a + 1, r + a + 1) } catch (o) { } a.p.treegrid || a.p.scroll || (a.grid.bdiv.scrolltop =
0); a.p.reccount = r; a.p.treeanode = -1; a.p.userdataonfooter && n.jqgrid("footerdata", "set", a.p.userdata, !0); l && (a.p.records = s, a.p.lastpage = math.ceil(s / d)); f || a.updatepager(!1, !0); if (l) {
for (; r < s;) {
w = c[r]; h = m(w, r + b); h = a.p.idprefix + h; if (k.repeatitems) { aa || (aa = w(u + z + q)); var p = b.jgrid.getxmldata(w, k.cell, !0); b.each(aa, function (b) { var c = p[this]; if (!c) return !1; p = c.textcontent || c.text; v[a.p.colmodel[b + u + z + q].name] = p }) } else for (c = 0; c < z.length; c++) p = b.jgrid.getxmldata(w, z[c]), v[a.p.colmodel[c + u + z + q].name] = p; v._id_ =
b.jgrid.strippref(a.p.idprefix, h); a.p.grouping && j.call(n, v, r); a.p.data.push(v); a.p._index[v._id_] = a.p.data.length - 1; v = {}; r++
} a.p.grouping && (a.p.groupingview._locgr = !0, n.jqgrid("groupingrender", y, a.p.colmodel.length, a.p.page, d), y = null)
}
}
}, y = function (c, d, e, f, g) {
var h = new date; if (c) {
-1 !== a.p.treeanode || a.p.scroll ? e = 1 < e ? e : 1 : (x.call(a, !1, !0), e = 1); var k, l = "local" !== a.p.datatype && a.p.loadonce || "jsonstring" === a.p.datatype; l && (a.p.data = [], a.p._index = {}, a.p.localreader.id = "_id_"); a.p.reccount = 0; "local" === a.p.datatype ?
(d = a.p.localreader, k = "local") : (d = a.p.jsonreader, k = "json"); var m = b(a), n = 0, c, a, p, q = [], u = a.p.multiselect ? 1 : 0, z = !0 === a.p.subgrid ? 1 : 0, x, t = !0 === a.p.rownumbers ? 1 : 0, d = w(u + z + t); k = ea(k); var y, b, v, w = {}, h, s, l = [], ia = !0 === a.p.altrows ? a.p.altclass : "", s; a.p.page = r(b.jgrid.getaccessor(c, d.page), a.p.page); a.p.lastpage = r(b.jgrid.getaccessor(c, d.total), 1); a.p.records = r(b.jgrid.getaccessor(c, d.records)); a.p.userdata = b.jgrid.getaccessor(c, d.userdata) || {}; z && (x = b.jgrid.getmethod("addsubgridcell")); v = !1 === a.p.keyindex ? b.isfunction(d.id) ?
d.id.call(a, c) : d.id : a.p.keyindex; d.repeatitems || (q = k, 0 < q.length && !isnan(v) && (v = a.p.keyname)); b = b.jgrid.getaccessor(c, d.root); null == b && b.isarray(c) && (b = c); b || (b = []); c = b.length; a = 0; 0 < c && 0 >= a.p.page && (a.p.page = 1); var i = parseint(a.p.rownum, 10), f = a.p.scroll ? b.jgrid.randid() : 1, j = !1, k; g && (i *= g + 1); "local" !== a.p.datatype || a.p.deselectaftersort || (j = !0); var n = b.isfunction(a.p.afterinsertrow), p = [], q = !1, o; a.p.grouping && (q = !0 === a.p.groupingview.groupcollapse, o = b.jgrid.getmethod("groupingprepare")); for (; a < c;) {
g =
b[a]; s = b.jgrid.getaccessor(g, v); void 0 === s && ("number" === typeof v && null != a.p.colmodel[v + u + z + t] && (s = b.jgrid.getaccessor(g, a.p.colmodel[v + u + z + t].name)), void 0 === s && (s = f + a, 0 === q.length && d.cell && (c = b.jgrid.getaccessor(g, d.cell) || g, s = null != c && void 0 !== c[v] ? c[v] : s))); s = a.p.idprefix + s; c = 1 === e ? 0 : e; s = 1 === (c + a) % 2 ? ia : ""; j && (k = a.p.multiselect ? -1 !== b.inarray(s, a.p.selarrrow) : s === a.p.selrow); var t = l.length; l.push(""); t && l.push(m(0, a, a.p.page, a.p.rownum)); u && l.push(u(s, t, a, k)); z && l.push(x.call(m, u + t, a + e)); y = k; d.repeatitems &&
(d.cell && (g = b.jgrid.getaccessor(g, d.cell) || g), b.isarray(g) && (y = d)); for (p = 0; p < y.length; p++) c = b.jgrid.getaccessor(g, y[p]), w[a.p.colmodel[p + u + z + t].name] = c, l.push(g(s, c, p + u + z + t, a + e, g, w)); l[t] = $(s, q, s, w, g, k); l.push(""); a.p.grouping && (p.push(l), a.p.groupingview._locgr || o.call(m, w, a), l = []); if (l || !0 === a.p.treegrid) w._id_ = b.jgrid.strippref(a.p.idprefix, s), a.p.data.push(w), a.p._index[w._id_] = a.p.data.length - 1; !1 === a.p.gridview && (b("#" + b.jgrid.jqid(a.p.id) + " tbody:first").append(l.join("")), m.triggerhandler("jqgridafterinsertrow",
[s, w, g]), n && a.p.afterinsertrow.call(a, s, w, g), l = []); w = {}; n++; a++; if (n === i) break
} !0 === a.p.gridview && (h = -1 < a.p.treeanode ? a.p.treeanode : 0, a.p.grouping ? l || (m.jqgrid("groupingrender", p, a.p.colmodel.length, a.p.page, i), p = null) : !0 === a.p.treegrid && 0 < h ? b(a.rows[h]).after(l.join("")) : b("#" + b.jgrid.jqid(a.p.id) + " tbody:first").append(l.join(""))); if (!0 === a.p.subgrid) try { m.jqgrid("addsubgrid", u + t) } catch (v) { } a.p.totaltime = new date - h; 0 < n && 0 === a.p.records && (a.p.records = c); if (!0 === a.p.treegrid) try {
m.jqgrid("settreenode",
h + 1, n + h + 1)
} catch (y) { } a.p.treegrid || a.p.scroll || (a.grid.bdiv.scrolltop = 0); a.p.reccount = n; a.p.treeanode = -1; a.p.userdataonfooter && m.jqgrid("footerdata", "set", a.p.userdata, !0); l && (a.p.records = c, a.p.lastpage = math.ceil(c / i)); f || a.updatepager(!1, !0); if (l) {
for (; n < c && b[n];) {
g = b[n]; s = b.jgrid.getaccessor(g, v); void 0 === s && ("number" === typeof v && null != a.p.colmodel[v + u + z + t] && (s = b.jgrid.getaccessor(g, a.p.colmodel[v + u + z + t].name)), void 0 === s && (s = f + n, 0 === q.length && d.cell && (e = b.jgrid.getaccessor(g, d.cell) || g, s = null !=
e && void 0 !== e[v] ? e[v] : s))); if (g) { s = a.p.idprefix + s; y = k; d.repeatitems && (d.cell && (g = b.jgrid.getaccessor(g, d.cell) || g), b.isarray(g) && (y = d)); for (p = 0; p < y.length; p++) w[a.p.colmodel[p + u + z + t].name] = b.jgrid.getaccessor(g, y[p]); w._id_ = b.jgrid.strippref(a.p.idprefix, s); a.p.grouping && o.call(m, w, n); a.p.data.push(w); a.p._index[w._id_] = a.p.data.length - 1; w = {} } n++
} a.p.grouping && (a.p.groupingview._locgr = !0, m.jqgrid("groupingrender", p, a.p.colmodel.length, a.p.page, i))
}
}
}, oa = function () {
function c(a) {
var b = 0, d, e, g, h, k;
if (null != a.groups) { (e = a.groups.length && "or" === a.groupop.tostring().touppercase()) && u.orbegin(); for (d = 0; d < a.groups.length; d++) { 0 < b && e && u.or(); try { c(a.groups[d]) } catch (l) { alert(l) } b++ } e && u.orend() } if (null != a.rules) try { (g = a.rules.length && "or" === a.groupop.tostring().touppercase()) && u.orbegin(); for (d = 0; d < a.rules.length; d++) k = a.rules[d], h = a.groupop.tostring().touppercase(), q[k.op] && k.field && (0 < b && h && "or" === h && (u = u.or()), u = q[k.op](u, h)(k.field, k.data, f[k.field])), b++; g && u.orend() } catch (m) { alert(m) }
} var d =
a.p.multisort ? [] : "", e = [], g = !1, f = {}, h = [], k = [], l, m, n; if (b.isarray(a.p.data)) {
var p = a.p.grouping ? a.p.groupingview : !1, a, r; b.each(a.p.colmodel, function () {
m = this.sorttype || "text"; "date" === m || "datetime" === m ? (this.formatter && "string" === typeof this.formatter && "date" === this.formatter ? (l = this.formatoptions && this.formatoptions.srcformat ? this.formatoptions.srcformat : b.jgrid.formatter.date.srcformat, n = this.formatoptions && this.formatoptions.newformat ? this.formatoptions.newformat : b.jgrid.formatter.date.newformat) :
l = n = this.datefmt || "y-m-d", f[this.name] = { stype: m, srcfmt: l, newfmt: n, sfunc: this.sortfunc || null }) : f[this.name] = { stype: m, srcfmt: "", newfmt: "", sfunc: this.sortfunc || null }; if (a.p.grouping) for (r = 0, a = p.groupfield.length; r < a; r++) if (this.name === p.groupfield[r]) { var c = this.name; this.index && (c = this.index); h[r] = f[c]; k[r] = c } a.p.multisort ? this.lso && (d.push(this.name), c = this.lso.split("-"), e.push(c[c.length - 1])) : g || this.index !== a.p.sortname && this.name !== a.p.sortname || (d = this.name, g = !0)
}); if (a.p.treegrid) b(a).jqgrid("sorttree",
d, a.p.sortorder, f[d].stype || "text", f[d].srcfmt || ""); else {
var q = {
eq: function (a) { return a.equals }, ne: function (a) { return a.notequals }, lt: function (a) { return a.less }, le: function (a) { return a.lessorequals }, gt: function (a) { return a.greater }, ge: function (a) { return a.greaterorequals }, cn: function (a) { return a.contains }, nc: function (a, b) { return "or" === b ? a.ornot().contains : a.andnot().contains }, bw: function (a) { return a.startswith }, bn: function (a, b) { return "or" === b ? a.ornot().startswith : a.andnot().startswith }, en: function (a,
b) { return "or" === b ? a.ornot().endswith : a.andnot().endswith }, ew: function (a) { return a.endswith }, ni: function (a, b) { return "or" === b ? a.ornot().equals : a.andnot().equals }, "in": function (a) { return a.equals }, nu: function (a) { return a.isnull }, nn: function (a, b) { return "or" === b ? a.ornot().isnull : a.andnot().isnull }
}, u = b.jgrid.from(a.p.data); a.p.ignorecase && (u = u.ignorecase()); if (!0 === a.p.search) {
var z = a.p.postdata.filters; if (z) "string" === typeof z && (z = b.jgrid.parse(z)), c(z); else try {
u = q[a.p.postdata.searchoper](u)(a.p.postdata.searchfield,
a.p.postdata.searchstring, f[a.p.postdata.searchfield])
} catch (t) { }
} if (a.p.grouping) for (r = 0; r < a; r++) u.orderby(k[r], p.grouporder[r], h[r].stype, h[r].srcfmt); a.p.multisort ? b.each(d, function (a) { u.orderby(this, e[a], f[this].stype, f[this].srcfmt, f[this].sfunc) }) : d && a.p.sortorder && g && ("desc" === a.p.sortorder.touppercase() ? u.orderby(a.p.sortname, "d", f[d].stype, f[d].srcfmt, f[d].sfunc) : u.orderby(a.p.sortname, "a", f[d].stype, f[d].srcfmt, f[d].sfunc)); var z = u.select(), x = parseint(a.p.rownum, 10), y = z.length, b = parseint(a.p.page,
10), d = math.ceil(y / x), v = {}; if ((a.p.search || a.p.resetsearch) && a.p.grouping && a.p.groupingview._locgr) { a.p.groupingview.groups = []; var w, g = b.jgrid.getmethod("groupingprepare"), s, f; if (a.p.footerrow && a.p.userdataonfooter) { for (s in a.p.userdata) a.p.userdata.hasownproperty(s) && (a.p.userdata[s] = 0); f = !0 } for (w = 0; w < y; w++) { if (f) for (s in a.p.userdata) a.p.userdata[s] += parsefloat(z[w][s] || 0); g.call(b(a), z[w], w, x) } } z = z.slice((b - 1) * x, b * x); f = u = null; v[a.p.localreader.total] = d; v[a.p.localreader.page] = b; v[a.p.localreader.records] =
y; v[a.p.localreader.root] = z; v[a.p.localreader.userdata] = a.p.userdata; z = null; return v
}
}
}, p = function () { a.grid.hdiv.loading = !0; if (!a.p.hiddengrid) switch (a.p.loadui) { case "enable": b("#load_" + b.jgrid.jqid(a.p.id)).show(); break; case "block": b("#lui_" + b.jgrid.jqid(a.p.id)).show(), b("#load_" + b.jgrid.jqid(a.p.id)).show() } }, t = function () { a.grid.hdiv.loading = !1; switch (a.p.loadui) { case "enable": b("#load_" + b.jgrid.jqid(a.p.id)).hide(); break; case "block": b("#lui_" + b.jgrid.jqid(a.p.id)).hide(), b("#load_" + b.jgrid.jqid(a.p.id)).hide() } },
q = function (c) {
if (!a.grid.hdiv.loading) {
var d = a.p.scroll && !1 === c, e = {}, g, f = a.p.prmnames; 0 >= a.p.page && (a.p.page = math.min(1, a.p.lastpage)); null !== f.search && (e[f.search] = a.p.search); null !== f.nd && (e[f.nd] = (new date).gettime()); null !== f.rows && (e[f.rows] = a.p.rownum); null !== f.page && (e[f.page] = a.p.page); null !== f.sort && (e[f.sort] = a.p.sortname); null !== f.order && (e[f.order] = a.p.sortorder); null !== a.p.rowtotal && null !== f.totalrows && (e[f.totalrows] = a.p.rowtotal); var h = b.isfunction(a.p.loadcomplete), k = h ? a.p.loadcomplete :
null, l = 0; c = c || 1; 1 < c ? null !== f.npage ? (e[f.npage] = c, l = c - 1, c = 1) : k = function (b) { a.p.page++; a.grid.hdiv.loading = !1; h && a.p.loadcomplete.call(a, b); q(c - 1) } : null !== f.npage && delete a.p.postdata[f.npage]; if (a.p.grouping) { b(a).jqgrid("groupingsetup"); var m = a.p.groupingview, n, p = ""; for (n = 0; n < m.groupfield.length; n++) { var r = m.groupfield[n]; b.each(a.p.colmodel, function (a, b) { b.name === r && b.index && (r = b.index) }); p += r + " " + m.grouporder[n] + ", " } e[f.sort] = p + e[f.sort] } b.extend(a.p.postdata, e); var q = a.p.scroll ? a.rows.length -
1 : 1, e = b(a).triggerhandler("jqgridbeforerequest"); if (!1 !== e && "stop" !== e) if (b.isfunction(a.p.datatype)) a.p.datatype.call(a, a.p.postdata, "load_" + a.p.id, q, c, l); else {
if (b.isfunction(a.p.beforerequest) && (e = a.p.beforerequest.call(a), void 0 === e && (e = !0), !1 === e)) return; g = a.p.datatype.tolowercase(); switch (g) {
case "json": case "jsonp": case "xml": case "script": b.ajax(b.extend({
url: a.p.url, type: a.p.mtype, datatype: g, data: b.isfunction(a.p.serializegriddata) ? a.p.serializegriddata.call(a, a.p.postdata) : a.p.postdata,
success: function (e, f, h) { if (b.isfunction(a.p.beforeprocessing) && !1 === a.p.beforeprocessing.call(a, e, f, h)) t(); else { "xml" === g ? k(e, a.grid.bdiv, q, 1 < c, l) : y(e, a.grid.bdiv, q, 1 < c, l); b(a).triggerhandler("jqgridloadcomplete", [e]); k && k.call(a, e); b(a).triggerhandler("jqgridafterloadcomplete", [e]); d && a.grid.populatevisible(); if (a.p.loadonce || a.p.treegrid) a.p.datatype = "local"; 1 === c && t() } }, error: function (d, e, f) { b.isfunction(a.p.loaderror) && a.p.loaderror.call(a, d, e, f); 1 === c && t() }, beforesend: function (c, d) {
var e = !0;
b.isfunction(a.p.loadbeforesend) && (e = a.p.loadbeforesend.call(a, c, d)); void 0 === e && (e = !0); if (!1 === e) return !1; p()
}
}, b.jgrid.ajaxoptions, a.p.ajaxgridoptions)); break; case "xmlstring": p(); e = "string" !== typeof a.p.datastr ? a.p.datastr : b.parsexml(a.p.datastr); k(e, a.grid.bdiv); b(a).triggerhandler("jqgridloadcomplete", [e]); h && a.p.loadcomplete.call(a, e); b(a).triggerhandler("jqgridafterloadcomplete", [e]); a.p.datatype = "local"; a.p.datastr = null; t(); break; case "jsonstring": p(); e = "string" === typeof a.p.datastr ? b.jgrid.parse(a.p.datastr) :
a.p.datastr; y(e, a.grid.bdiv); b(a).triggerhandler("jqgridloadcomplete", [e]); h && a.p.loadcomplete.call(a, e); b(a).triggerhandler("jqgridafterloadcomplete", [e]); a.p.datatype = "local"; a.p.datastr = null; t(); break; case "local": case "clientside": p(), a.p.datatype = "local", e = oa(), y(e, a.grid.bdiv, q, 1 < c, l), b(a).triggerhandler("jqgridloadcomplete", [e]), k && k.call(a, e), b(a).triggerhandler("jqgridafterloadcomplete", [e]), d && a.grid.populatevisible(), t()
}
}
}
}, ha = function (c) {
b("#cb_" + b.jgrid.jqid(a.p.id), a.grid.hdiv)[a.p.useprop ?
"prop" : "attr"]("checked", c); if (a.p.frozencolumns && a.p.id + "_frozen") b("#cb_" + b.jgrid.jqid(a.p.id), a.grid.fhdiv)[a.p.useprop ? "prop" : "attr"]("checked", c)
}, qa = function (c, e) {
var d = "", g = "
", k = "", l, m, n, p, q = function (c) { var e; b.isfunction(a.p.onpaging) && (e = a.p.onpaging.call(a, c)); if ("stop" === e) return !1; a.p.selrow = null; a.p.multiselect && (a.p.selarrrow = [], ha(!1)); a.p.savedrow = []; return !0 }; c = c.substr(1);
e += "_" + c; l = "pg_" + c; m = c + "_left"; n = c + "_center"; p = c + "_right"; b("#" + b.jgrid.jqid(c)).append("
").attr("dir", "ltr"); if (0 < a.p.rowlist.length) {
k = "
"; ba = null; b(this).append(d); b("thead tr:first th", this).hover(function () { b(this).addclass("ui-state-hover") }, function () { b(this).removeclass("ui-state-hover") }); if (this.p.multiselect) {
var la = [], ca; b("#cb_" + b.jgrid.jqid(a.p.id), this).bind("click", function () {
a.p.selarrrow =
[]; var c = !0 === a.p.frozencolumns ? a.p.id + "_frozen" : ""; this.checked ? (b(a.rows).each(function (d) {
0 < d && !b(this).hasclass("ui-subgrid") && !b(this).hasclass("jqgroup") && !b(this).hasclass("ui-state-disabled") && (b("#jqg_" + b.jgrid.jqid(a.p.id) + "_" + b.jgrid.jqid(this.id))[a.p.useprop ? "prop" : "attr"]("checked", !0), b(this).addclass("ui-state-highlight").attr("aria-selected", "true"), a.p.selarrrow.push(this.id), a.p.selrow = this.id, c && (b("#jqg_" + b.jgrid.jqid(a.p.id) + "_" + b.jgrid.jqid(this.id), a.grid.fbdiv)[a.p.useprop ?
"prop" : "attr"]("checked", !0), b("#" + b.jgrid.jqid(this.id), a.grid.fbdiv).addclass("ui-state-highlight")))
}), ca = !0, la = []) : (b(a.rows).each(function (d) {
0 < d && !b(this).hasclass("ui-subgrid") && !b(this).hasclass("ui-state-disabled") && (b("#jqg_" + b.jgrid.jqid(a.p.id) + "_" + b.jgrid.jqid(this.id))[a.p.useprop ? "prop" : "attr"]("checked", !1), b(this).removeclass("ui-state-highlight").attr("aria-selected", "false"), la.push(this.id), c && (b("#jqg_" + b.jgrid.jqid(a.p.id) + "_" + b.jgrid.jqid(this.id), a.grid.fbdiv)[a.p.useprop ?
"prop" : "attr"]("checked", !1), b("#" + b.jgrid.jqid(this.id), a.grid.fbdiv).removeclass("ui-state-highlight")))
}), a.p.selrow = null, ca = !1); b(a).triggerhandler("jqgridselectall", [ca ? a.p.selarrrow : la, ca]); b.isfunction(a.p.onselectall) && a.p.onselectall.call(a, ca ? a.p.selarrrow : la, ca)
})
} !0 === a.p.autowidth && (d = b(m).innerwidth(), a.p.width = 0 < d ? d : "nw"); (function () {
var d = 0, e = b.jgrid.cell_width ? 0 : r(a.p.celllayout, 0), g = 0, f, h = r(a.p.scrolloffset, 0), k, m = !1, n, p = 0, q; b.each(a.p.colmodel, function () {
void 0 === this.hidden && (this.hidden =
!1); if (a.p.grouping && a.p.autowidth) { var c = b.inarray(this.name, a.p.groupingview.groupfield); 0 <= c && a.p.groupingview.groupcolumnshow.length > c && (this.hidden = !a.p.groupingview.groupcolumnshow[c]) } this.widthorg = k = r(this.width, 0); !1 === this.hidden && (d += k + e, this.fixed ? p += k + e : g++)
}); isnan(a.p.width) && (a.p.width = d + (!1 !== a.p.shrinktofit || isnan(a.p.height) ? 0 : h)); c.width = a.p.width; a.p.tblwidth = d; !1 === a.p.shrinktofit && !0 === a.p.forcefit && (a.p.forcefit = !1); !0 === a.p.shrinktofit && 0 < g && (n = c.width - e * g - p, isnan(a.p.height) ||
(n -= h, m = !0), d = 0, b.each(a.p.colmodel, function (b) { !1 !== this.hidden || this.fixed || (this.width = k = math.round(n * this.width / (a.p.tblwidth - e * g - p)), d += k, f = b) }), q = 0, m ? c.width - p - (d + e * g) !== h && (q = c.width - p - (d + e * g) - h) : m || 1 === math.abs(c.width - p - (d + e * g)) || (q = c.width - p - (d + e * g)), a.p.colmodel[f].width += q, a.p.tblwidth = d + q + e * g + p, a.p.tblwidth > a.p.width && (a.p.colmodel[f].width -= a.p.tblwidth - parseint(a.p.width, 10), a.p.tblwidth = a.p.width))
})(); b(m).css("width", c.width + "px").append("
"); b(k).css("width", c.width + "px"); var d = b("thead:first", a).get(0), v = ""; a.p.footerrow && (v += "
"); var k = b("tr:first", d), da = "
"; a.p.disableclick = !1; b("th", k).each(function (d) {
ja = a.p.colmodel[d].width; void 0 === a.p.colmodel[d].resizable && (a.p.colmodel[d].resizable =
!0); a.p.colmodel[d].resizable ? (fa = document.createelement("span"), b(fa).html(" ").addclass("ui-jqgrid-resize ui-jqgrid-resize-" + f).css("cursor", "col-resize"), b(this).addclass(a.p.resizeclass)) : fa = ""; b(this).css("width", ja + "px").prepend(fa); fa = null; var e = ""; a.p.colmodel[d].hidden && (b(this).css("display", "none"), e = "display:none;"); da += "
"; c.headers[d] = { width: ja, el: this }; ka = a.p.colmodel[d].sortable; "boolean" !== typeof ka && (ka = a.p.colmodel[d].sortable =
!0); e = a.p.colmodel[d].name; "cb" !== e && "subgrid" !== e && "rn" !== e && a.p.viewsortcols[2] && b(">div", this).addclass("ui-jqgrid-sortable"); ka && (a.p.multisort ? a.p.viewsortcols[0] ? (b("div span.s-ico", this).show(), a.p.colmodel[d].lso && b("div span.ui-icon-" + a.p.colmodel[d].lso, this).removeclass("ui-state-disabled")) : a.p.colmodel[d].lso && (b("div span.s-ico", this).show(), b("div span.ui-icon-" + a.p.colmodel[d].lso, this).removeclass("ui-state-disabled")) : a.p.viewsortcols[0] ? (b("div span.s-ico", this).show(), d === a.p.lastsort &&
b("div span.ui-icon-" + a.p.sortorder, this).removeclass("ui-state-disabled")) : d === a.p.lastsort && (b("div span.s-ico", this).show(), b("div span.ui-icon-" + a.p.sortorder, this).removeclass("ui-state-disabled"))); a.p.footerrow && (v += "
")
}).mousedown(function (d) {
if (1 === b(d.target).closest("th>span.ui-jqgrid-resize").length) {
var e = sa(this); if (!0 === a.p.forcefit) {
var g = a.p, f = e, h; for (h = e + 1; h < a.p.colmodel.length; h++) if (!0 !== a.p.colmodel[h].hidden) { f = h; break } g.nv =
f - e
} c.dragstart(e, d, xa(e)); return !1
}
}).click(function (c) { if (a.p.disableclick) return a.p.disableclick = !1; var d = "th>div.ui-jqgrid-sortable", e, g; a.p.viewsortcols[2] || (d = "th>div>span>span.ui-grid-ico-sort"); c = b(c.target).closest(d); if (1 === c.length) { var f; if (a.p.frozencolumns) { var h = b(this)[0].id.substring(a.p.id.length + 1); b(a.p.colmodel).each(function (a) { if (this.name === h) return f = a, !1 }) } else f = sa(this); a.p.viewsortcols[2] || (e = !0, g = c.attr("sort")); null != f && ra(b("div", this)[0].id, f, e, g, this); return !1 } });
if (a.p.sortable && b.fn.sortable) try { b(a).jqgrid("sortablecolumns", k) } catch (ba) { } a.p.footerrow && (v += "
"); da += ""; k = document.createelement("tbody"); this.appendchild(k); b(this).addclass("ui-jqgrid-btable").append(da); var da = null, k = b("
").append(d), j = a.p.caption && !0 === a.p.hiddengrid ? !0 : !1; g = b(""); d = null; c.hdiv = document.createelement("div"); b(c.hdiv).css({ width: c.width + "px" }).addclass("ui-state-default ui-jqgrid-hdiv").append(g); b(g).append(k); k = null; j && b(c.hdiv).hide(); a.p.pager && ("string" === typeof a.p.pager ? "#" !== a.p.pager.substr(0, 1) && (a.p.pager = "#" + a.p.pager) : a.p.pager = "#" + b(a.p.pager).attr("id"), b(a.p.pager).css({ width: c.width + "px" }).addclass("ui-state-default ui-jqgrid-pager ui-corner-bottom").appendto(m), j && b(a.p.pager).hide(), qa(a.p.pager, "")); !1 ===
a.p.celledit && !0 === a.p.hoverrows && b(a).bind("mouseover", function (a) { t = b(a.target).closest("tr.jqgrow"); "ui-subgrid" !== b(t).attr("class") && b(t).addclass("ui-state-hover") }).bind("mouseout", function (a) { t = b(a.target).closest("tr.jqgrow"); b(t).removeclass("ui-state-hover") }); var b, n, ma; b(a).before(c.hdiv).click(function (c) {
y = c.target; t = b(y, a.rows).closest("tr.jqgrow"); if (0 === b(t).length || -1 < t[0].classname.indexof("ui-state-disabled") || (b(y, a).closest("table.ui-jqgrid-btable").attr("id") || "").replace("_frozen",
"") !== a.id) return this; var d = b(y).hasclass("cbox"), e = b(a).triggerhandler("jqgridbeforeselectrow", [t[0].id, c]); (e = !1 === e || "stop" === e ? !1 : !0) && b.isfunction(a.p.beforeselectrow) && (e = a.p.beforeselectrow.call(a, t[0].id, c)); if ("a" !== y.tagname && ("input" !== y.tagname && "textarea" !== y.tagname && "option" !== y.tagname && "select" !== y.tagname || d) && !0 === e) if (b = t[0].id, n = b.jgrid.getcellindex(y), ma = b(y).closest("td,th").html(), b(a).triggerhandler("jqgridcellselect", [b, n, ma, c]), b.isfunction(a.p.oncellselect) && a.p.oncellselect.call(a,
b, n, ma, c), !0 === a.p.celledit) if (a.p.multiselect && d) b(a).jqgrid("setselection", b, !0, c); else { b = t[0].rowindex; try { b(a).jqgrid("editcell", b, n, !0) } catch (g) { } } else if (a.p.multikey) c[a.p.multikey] ? b(a).jqgrid("setselection", b, !0, c) : a.p.multiselect && d && (d = b("#jqg_" + b.jgrid.jqid(a.p.id) + "_" + b).is(":checked"), b("#jqg_" + b.jgrid.jqid(a.p.id) + "_" + b)[a.p.useprop ? "prop" : "attr"]("checked", d)); else {
if (a.p.multiselect && a.p.multiboxonly && !d) {
var f = a.p.frozencolumns ? a.p.id + "_frozen" : ""; b(a.p.selarrrow).each(function (c,
d) { var e = b(a).jqgrid("getgridrowbyid", d); b(e).removeclass("ui-state-highlight"); b("#jqg_" + b.jgrid.jqid(a.p.id) + "_" + b.jgrid.jqid(d))[a.p.useprop ? "prop" : "attr"]("checked", !1); f && (b("#" + b.jgrid.jqid(d), "#" + b.jgrid.jqid(f)).removeclass("ui-state-highlight"), b("#jqg_" + b.jgrid.jqid(a.p.id) + "_" + b.jgrid.jqid(d), "#" + b.jgrid.jqid(f))[a.p.useprop ? "prop" : "attr"]("checked", !1)) }); a.p.selarrrow = []
} b(a).jqgrid("setselection", b, !0, c)
}
}).bind("reloadgrid", function (c, d) {
!0 === a.p.treegrid && (a.p.datatype = a.p.treedatatype);
d && d.current && a.grid.selectionpreserver(a); "local" === a.p.datatype ? (b(a).jqgrid("resetselection"), a.p.data.length && o()) : a.p.treegrid || (a.p.selrow = null, a.p.multiselect && (a.p.selarrrow = [], ha(!1)), a.p.savedrow = []); a.p.scroll && x.call(a, !0, !1); if (d && d.page) { var e = d.page; e > a.p.lastpage && (e = a.p.lastpage); 1 > e && (e = 1); a.p.page = e; a.grid.bdiv.scrolltop = a.grid.prevrowheight ? (e - 1) * a.grid.prevrowheight * a.p.rownum : 0 } a.grid.prevrowheight && a.p.scroll ? (delete a.p.lastpage, a.grid.populatevisible()) : a.grid.populate();
!0 === a.p._inlinenav && b(a).jqgrid("showaddeditbuttons"); return !1
}).dblclick(function (c) { y = c.target; t = b(y, a.rows).closest("tr.jqgrow"); 0 !== b(t).length && (b = t[0].rowindex, n = b.jgrid.getcellindex(y), b(a).triggerhandler("jqgriddblclickrow", [b(t).attr("id"), b, n, c]), b.isfunction(a.p.ondblclickrow) && a.p.ondblclickrow.call(a, b(t).attr("id"), b, n, c)) }).bind("contextmenu", function (c) {
y = c.target; t = b(y, a.rows).closest("tr.jqgrow"); 0 !== b(t).length && (a.p.multiselect || b(a).jqgrid("setselection", t[0].id, !0, c), b = t[0].rowindex,
n = b.jgrid.getcellindex(y), b(a).triggerhandler("jqgridrightclickrow", [b(t).attr("id"), b, n, c]), b.isfunction(a.p.onrightclickrow) && a.p.onrightclickrow.call(a, b(t).attr("id"), b, n, c))
}); c.bdiv = document.createelement("div"); n && "auto" === string(a.p.height).tolowercase() && (a.p.height = "100%"); b(c.bdiv).append(b('').append("").append(this)).addclass("ui-jqgrid-bdiv").css({
height: a.p.height + (isnan(a.p.height) ? "" : "px"),
width: c.width + "px"
}).scroll(c.scrollgrid); b("table:first", c.bdiv).css({ width: a.p.tblwidth + "px" }); b.support.tbody || 2 === b("tbody", this).length && b("tbody:gt(0)", this).remove(); a.p.multikey && (b.jgrid.msie ? b(c.bdiv).bind("selectstart", function () { return !1 }) : b(c.bdiv).bind("mousedown", function () { return !1 })); j && b(c.bdiv).hide(); c.cdiv = document.createelement("div"); var na = !0 === a.p.hidegrid ? b("").hover(function () { na.addclass("ui-state-hover") },
function () { na.removeclass("ui-state-hover") }).append("").css("rtl" === f ? "left" : "right", "0px") : ""; b(c.cdiv).append(na).append("" + a.p.caption + "").addclass("ui-jqgrid-titlebar ui-jqgrid-caption" + ("rtl" === f ? "-rtl" : "") + " ui-widget-header ui-corner-top ui-helper-clearfix"); b(c.cdiv).insertbefore(c.hdiv); a.p.toolbar[0] && (c.udiv = document.createelement("div"), "top" === a.p.toolbar[1] ? b(c.udiv).insertbefore(c.hdiv) : "bottom" ===
a.p.toolbar[1] && b(c.udiv).insertafter(c.hdiv), "both" === a.p.toolbar[1] ? (c.ubdiv = document.createelement("div"), b(c.udiv).addclass("ui-userdata ui-state-default").attr("id", "t_" + this.id).insertbefore(c.hdiv), b(c.ubdiv).addclass("ui-userdata ui-state-default").attr("id", "tb_" + this.id).insertafter(c.hdiv), j && b(c.ubdiv).hide()) : b(c.udiv).width(c.width).addclass("ui-userdata ui-state-default").attr("id", "t_" + this.id), j && b(c.udiv).hide()); a.p.toppager && (a.p.toppager = b.jgrid.jqid(a.p.id) + "_toppager", c.topdiv =
b("")[0], a.p.toppager = "#" + a.p.toppager, b(c.topdiv).addclass("ui-state-default ui-jqgrid-toppager").width(c.width).insertbefore(c.hdiv), qa(a.p.toppager, "_t")); a.p.footerrow && (c.sdiv = b("")[0], g = b(""), b(c.sdiv).append(g).width(c.width).insertafter(c.hdiv), b(g).append(v), c.footers = b(".ui-jqgrid-ftable", c.sdiv)[0].rows[0].cells, a.p.rownumbers && (c.footers[0].classname = "ui-state-default jqgrid-rownum"),
j && b(c.sdiv).hide()); g = null; if (a.p.caption) {
var ya = a.p.datatype; !0 === a.p.hidegrid && (b(".ui-jqgrid-titlebar-close", c.cdiv).click(function (d) {
var e = b.isfunction(a.p.onheaderclick), g = ".ui-jqgrid-bdiv, .ui-jqgrid-hdiv, .ui-jqgrid-pager, .ui-jqgrid-sdiv", f, h = this; !0 === a.p.toolbar[0] && ("both" === a.p.toolbar[1] && (g += ", #" + b(c.ubdiv).attr("id")), g += ", #" + b(c.udiv).attr("id")); f = b(g, "#gview_" + b.jgrid.jqid(a.p.id)).length; "visible" === a.p.gridstate ? b(g, "#gbox_" + b.jgrid.jqid(a.p.id)).slideup("fast", function () {
f--;
0 === f && (b("span", h).removeclass("ui-icon-circle-triangle-n").addclass("ui-icon-circle-triangle-s"), a.p.gridstate = "hidden", b("#gbox_" + b.jgrid.jqid(a.p.id)).hasclass("ui-resizable") && b(".ui-resizable-handle", "#gbox_" + b.jgrid.jqid(a.p.id)).hide(), b(a).triggerhandler("jqgridheaderclick", [a.p.gridstate, d]), e && (j || a.p.onheaderclick.call(a, a.p.gridstate, d)))
}) : "hidden" === a.p.gridstate && b(g, "#gbox_" + b.jgrid.jqid(a.p.id)).slidedown("fast", function () {
f--; 0 === f && (b("span", h).removeclass("ui-icon-circle-triangle-s").addclass("ui-icon-circle-triangle-n"),
j && (a.p.datatype = ya, q(), j = !1), a.p.gridstate = "visible", b("#gbox_" + b.jgrid.jqid(a.p.id)).hasclass("ui-resizable") && b(".ui-resizable-handle", "#gbox_" + b.jgrid.jqid(a.p.id)).show(), b(a).triggerhandler("jqgridheaderclick", [a.p.gridstate, d]), e && (j || a.p.onheaderclick.call(a, a.p.gridstate, d)))
}); return !1
}), j && (a.p.datatype = "local", b(".ui-jqgrid-titlebar-close", c.cdiv).trigger("click")))
} else b(c.cdiv).hide(); b(c.hdiv).after(c.bdiv).mousemove(function (a) { if (c.resizing) return c.dragmove(a), !1 }); b(".ui-jqgrid-labels",
c.hdiv).bind("selectstart", function () { return !1 }); b(document).bind("mouseup.jqgrid" + a.p.id, function () { return c.resizing ? (c.dragend(), !1) : !0 }); a.formatcol = p; a.sortdata = ra; a.updatepager = function (c, d) {
var e, g, f, h, k, l, m, n = "", p = a.p.pager ? "_" + b.jgrid.jqid(a.p.pager.substr(1)) : "", q = a.p.toppager ? "_" + a.p.toppager.substr(1) : ""; f = parseint(a.p.page, 10) - 1; 0 > f && (f = 0); f *= parseint(a.p.rownum, 10); k = f + a.p.reccount; if (a.p.scroll) {
e = b("tbody:first > tr:gt(0)", a.grid.bdiv); f = k - e.length; a.p.reccount = e.length; if (e = e.outerheight() ||
a.grid.prevrowheight) g = f * e, m = parseint(a.p.records, 10) * e, b(">div:first", a.grid.bdiv).css({ height: m }).children("div:first").css({ height: g, display: g ? "" : "none" }), 0 == a.grid.bdiv.scrolltop && 1 < a.p.page && (a.grid.bdiv.scrolltop = a.p.rownum * (a.p.page - 1) * e); a.grid.bdiv.scrollleft = a.grid.hdiv.scrollleft
} n = a.p.pager || ""; if (n += a.p.toppager ? n ? "," + a.p.toppager : a.p.toppager : "") m = b.jgrid.formatter.integer || {}, e = r(a.p.page), g = r(a.p.lastpage), b(".selbox", n)[this.p.useprop ? "prop" : "attr"]("disabled", !1), !0 === a.p.pginput &&
(b(".ui-pg-input", n).val(a.p.page), h = a.p.toppager ? "#sp_1" + p + ",#sp_1" + q : "#sp_1" + p, b(h).html(b.fmatter ? b.fmatter.util.numberformat(a.p.lastpage, m) : a.p.lastpage)), a.p.viewrecords && (0 === a.p.reccount ? b(".ui-paging-info", n).html(a.p.emptyrecords) : (h = f + 1, l = a.p.records, b.fmatter && (h = b.fmatter.util.numberformat(h, m), k = b.fmatter.util.numberformat(k, m), l = b.fmatter.util.numberformat(l, m)), b(".ui-paging-info", n).html(b.jgrid.format(a.p.recordtext, h, k, l)))), !0 === a.p.pgbuttons && (0 >= e && (e = g = 0), 1 === e || 0 === e ? (b("#first" +
p + ", #prev" + p).addclass("ui-state-disabled").removeclass("ui-state-hover"), a.p.toppager && b("#first_t" + q + ", #prev_t" + q).addclass("ui-state-disabled").removeclass("ui-state-hover")) : (b("#first" + p + ", #prev" + p).removeclass("ui-state-disabled"), a.p.toppager && b("#first_t" + q + ", #prev_t" + q).removeclass("ui-state-disabled")), e === g || 0 === e ? (b("#next" + p + ", #last" + p).addclass("ui-state-disabled").removeclass("ui-state-hover"), a.p.toppager && b("#next_t" + q + ", #last_t" + q).addclass("ui-state-disabled").removeclass("ui-state-hover")) :
(b("#next" + p + ", #last" + p).removeclass("ui-state-disabled"), a.p.toppager && b("#next_t" + q + ", #last_t" + q).removeclass("ui-state-disabled"))); !0 === c && !0 === a.p.rownumbers && b(">td.jqgrid-rownum", a.rows).each(function (a) { b(this).html(f + 1 + a) }); d && a.p.jqgdnd && b(a).jqgrid("griddnd", "updatednd"); b(a).triggerhandler("jqgridgridcomplete"); b.isfunction(a.p.gridcomplete) && a.p.gridcomplete.call(a); b(a).triggerhandler("jqgridaftergridcomplete")
}; a.refreshindex = o; a.setheadcheckbox = ha; a.constructtr = $; a.formatter = function (a,
b, c, d, e) { return x(a, b, c, d, e) }; b.extend(c, { populate: q, emptyrows: x, beginreq: p, endreq: t }); this.grid = c; a.addxmldata = function (b) { k(b, a.grid.bdiv) }; a.addjsondata = function (b) { y(b, a.grid.bdiv) }; this.grid.cols = this.rows[0].cells; b(a).triggerhandler("jqgridinitgrid"); b.isfunction(a.p.oninitgrid) && a.p.oninitgrid.call(a); q(); a.p.hiddengrid = !1
}
}
}
})
}; b.jgrid.extend({
getgridparam: function (b) { var f = this[0]; if (f && f.grid) return b ? void 0 !== f.p[b] ? f.p[b] : null : f.p }, setgridparam: function (e) {
return this.each(function () {
this.grid &&
"object" === typeof e && b.extend(!0, this.p, e)
})
}, getgridrowbyid: function (e) { var f; this.each(function () { try { for (var c = this.rows.length; c--;) if (e.tostring() === this.rows[c].id) { f = this.rows[c]; break } } catch (d) { f = b(this.grid.bdiv).find("#" + b.jgrid.jqid(e)) } }); return f }, getdataids: function () { var e = [], f = 0, c, d = 0; this.each(function () { if ((c = this.rows.length) && 0 < c) for (; f < c;) b(this.rows[f]).hasclass("jqgrow") && (e[d] = this.rows[f].id, d++), f++ }); return e }, setselection: function (e, f, c) {
return this.each(function () {
var d,
a, l, g, h, k; void 0 !== e && (f = !1 === f ? !1 : !0, !(a = b(this).jqgrid("getgridrowbyid", e)) || !a.classname || -1 < a.classname.indexof("ui-state-disabled") || (!0 === this.p.scrollrows && (l = b(this).jqgrid("getgridrowbyid", e).rowindex, 0 <= l && (d = b(this.grid.bdiv)[0].clientheight, g = b(this.grid.bdiv)[0].scrolltop, h = b(this.rows[l]).position().top, l = this.rows[l].clientheight, h + l >= d + g ? b(this.grid.bdiv)[0].scrolltop = h - (d + g) + l + g : h < d + g && h < g && (b(this.grid.bdiv)[0].scrolltop = h))), !0 === this.p.frozencolumns && (k = this.p.id + "_frozen"), this.p.multiselect ?
(this.setheadcheckbox(!1), this.p.selrow = a.id, g = b.inarray(this.p.selrow, this.p.selarrrow), -1 === g ? ("ui-subgrid" !== a.classname && b(a).addclass("ui-state-highlight").attr("aria-selected", "true"), d = !0, this.p.selarrrow.push(this.p.selrow)) : ("ui-subgrid" !== a.classname && b(a).removeclass("ui-state-highlight").attr("aria-selected", "false"), d = !1, this.p.selarrrow.splice(g, 1), h = this.p.selarrrow[0], this.p.selrow = void 0 === h ? null : h), b("#jqg_" + b.jgrid.jqid(this.p.id) + "_" + b.jgrid.jqid(a.id))[this.p.useprop ? "prop" : "attr"]("checked",
d), k && (-1 === g ? b("#" + b.jgrid.jqid(e), "#" + b.jgrid.jqid(k)).addclass("ui-state-highlight") : b("#" + b.jgrid.jqid(e), "#" + b.jgrid.jqid(k)).removeclass("ui-state-highlight"), b("#jqg_" + b.jgrid.jqid(this.p.id) + "_" + b.jgrid.jqid(e), "#" + b.jgrid.jqid(k))[this.p.useprop ? "prop" : "attr"]("checked", d)), f && (b(this).triggerhandler("jqgridselectrow", [a.id, d, c]), this.p.onselectrow && this.p.onselectrow.call(this, a.id, d, c))) : "ui-subgrid" !== a.classname && (this.p.selrow !== a.id ? (b(b(this).jqgrid("getgridrowbyid", this.p.selrow)).removeclass("ui-state-highlight").attr({
"aria-selected": "false",
tabindex: "-1"
}), b(a).addclass("ui-state-highlight").attr({ "aria-selected": "true", tabindex: "0" }), k && (b("#" + b.jgrid.jqid(this.p.selrow), "#" + b.jgrid.jqid(k)).removeclass("ui-state-highlight"), b("#" + b.jgrid.jqid(e), "#" + b.jgrid.jqid(k)).addclass("ui-state-highlight")), d = !0) : d = !1, this.p.selrow = a.id, f && (b(this).triggerhandler("jqgridselectrow", [a.id, d, c]), this.p.onselectrow && this.p.onselectrow.call(this, a.id, d, c)))))
})
}, resetselection: function (e) {
return this.each(function () {
var f = this, c, d; !0 === f.p.frozencolumns &&
(d = f.p.id + "_frozen"); if (void 0 !== e) {
c = e === f.p.selrow ? f.p.selrow : e; b("#" + b.jgrid.jqid(f.p.id) + " tbody:first tr#" + b.jgrid.jqid(c)).removeclass("ui-state-highlight").attr("aria-selected", "false"); d && b("#" + b.jgrid.jqid(c), "#" + b.jgrid.jqid(d)).removeclass("ui-state-highlight"); if (f.p.multiselect) {
b("#jqg_" + b.jgrid.jqid(f.p.id) + "_" + b.jgrid.jqid(c), "#" + b.jgrid.jqid(f.p.id))[f.p.useprop ? "prop" : "attr"]("checked", !1); if (d) b("#jqg_" + b.jgrid.jqid(f.p.id) + "_" + b.jgrid.jqid(c), "#" + b.jgrid.jqid(d))[f.p.useprop ? "prop" :
"attr"]("checked", !1); f.setheadcheckbox(!1)
} c = null
} else f.p.multiselect ? (b(f.p.selarrrow).each(function (a, c) { b(b(f).jqgrid("getgridrowbyid", c)).removeclass("ui-state-highlight").attr("aria-selected", "false"); b("#jqg_" + b.jgrid.jqid(f.p.id) + "_" + b.jgrid.jqid(c))[f.p.useprop ? "prop" : "attr"]("checked", !1); d && (b("#" + b.jgrid.jqid(c), "#" + b.jgrid.jqid(d)).removeclass("ui-state-highlight"), b("#jqg_" + b.jgrid.jqid(f.p.id) + "_" + b.jgrid.jqid(c), "#" + b.jgrid.jqid(d))[f.p.useprop ? "prop" : "attr"]("checked", !1)) }), f.setheadcheckbox(!1),
f.p.selarrrow = [], f.p.selrow = null) : f.p.selrow && (b("#" + b.jgrid.jqid(f.p.id) + " tbody:first tr#" + b.jgrid.jqid(f.p.selrow)).removeclass("ui-state-highlight").attr("aria-selected", "false"), d && b("#" + b.jgrid.jqid(f.p.selrow), "#" + b.jgrid.jqid(d)).removeclass("ui-state-highlight"), f.p.selrow = null); !0 === f.p.celledit && 0 <= parseint(f.p.icol, 10) && 0 <= parseint(f.p.irow, 10) && (b("td:eq(" + f.p.icol + ")", f.rows[f.p.irow]).removeclass("edit-cell ui-state-highlight"), b(f.rows[f.p.irow]).removeclass("selected-row ui-state-hover"));
f.p.savedrow = []
})
}, getrowdata: function (e) {
var f = {}, c, d = !1, a, l = 0; this.each(function () {
var g = this, h, k; if (void 0 === e) d = !0, c = [], a = g.rows.length; else { k = b(g).jqgrid("getgridrowbyid", e); if (!k) return f; a = 2 } for (; l < a;) d && (k = g.rows[l]), b(k).hasclass("jqgrow") && (b('td[role="gridcell"]', k).each(function (a) {
h = g.p.colmodel[a].name; if ("cb" !== h && "subgrid" !== h && "rn" !== h) if (!0 === g.p.treegrid && h === g.p.expandcolumn) f[h] = b.jgrid.htmldecode(b("span:first", this).html()); else try {
f[h] = b.unformat.call(g, this, { rowid: k.id, colmodel: g.p.colmodel[a] },
a)
} catch (c) { f[h] = b.jgrid.htmldecode(b(this).html()) }
}), d && (c.push(f), f = {})), l++
}); return c || f
}, delrowdata: function (e) {
var f = !1, c, d; this.each(function () {
c = b(this).jqgrid("getgridrowbyid", e); if (!c) return !1; b(c).remove(); this.p.records--; this.p.reccount--; this.updatepager(!0, !1); f = !0; this.p.multiselect && (d = b.inarray(e, this.p.selarrrow), -1 !== d && this.p.selarrrow.splice(d, 1)); this.p.selrow = this.p.multiselect && 0 < this.p.selarrrow.length ? this.p.selarrrow[this.p.selarrrow.length - 1] : null; if ("local" === this.p.datatype) {
var a =
b.jgrid.strippref(this.p.idprefix, e), a = this.p._index[a]; void 0 !== a && (this.p.data.splice(a, 1), this.refreshindex())
} if (!0 === this.p.altrows && f) { var l = this.p.altclass; b(this.rows).each(function (a) { 1 === a % 2 ? b(this).addclass(l) : b(this).removeclass(l) }) }
}); return f
}, setrowdata: function (e, f, c) {
var d, a = !0, l; this.each(function () {
if (!this.grid) return !1; var g = this, h, k, n = typeof c, m = {}; k = b(this).jqgrid("getgridrowbyid", e); if (!k) return !1; if (f) try {
if (b(this.p.colmodel).each(function (a) {
d = this.name; var c = b.jgrid.getaccessor(f,
d); void 0 !== c && (m[d] = this.formatter && "string" === typeof this.formatter && "date" === this.formatter ? b.unformat.date.call(g, c, this) : c, h = g.formatter(e, c, a, f, "edit"), l = this.title ? { title: b.jgrid.striphtml(h) } : {}, !0 === g.p.treegrid && d === g.p.expandcolumn ? b("td[role='gridcell']:eq(" + a + ") > span:first", k).html(h).attr(l) : b("td[role='gridcell']:eq(" + a + ")", k).html(h).attr(l))
}), "local" === g.p.datatype) {
var r = b.jgrid.strippref(g.p.idprefix, e), p = g.p._index[r], q; if (g.p.treegrid) for (q in g.p.treereader) g.p.treereader.hasownproperty(q) &&
delete m[g.p.treereader[q]]; void 0 !== p && (g.p.data[p] = b.extend(!0, g.p.data[p], m)); m = null
}
} catch (x) { a = !1 } a && ("string" === n ? b(k).addclass(c) : null !== c && "object" === n && b(k).css(c), b(g).triggerhandler("jqgridaftergridcomplete"))
}); return a
}, addrowdata: function (e, f, c, d) {
c || (c = "last"); var a = !1, l, g, h, k, n, m, r, p, q = "", x, g, u, m, ea, w; f && (b.isarray(f) ? (x = !0, c = "last", g = e) : (f = [f], x = !1), this.each(function () {
var x = f.length; n = !0 === this.p.rownumbers ? 1 : 0; h = !0 === this.p.multiselect ? 1 : 0; k = !0 === this.p.subgrid ? 1 : 0; x || (void 0 !==
e ? e = string(e) : (e = b.jgrid.randid(), !1 !== this.p.keyindex && (g = this.p.colmodel[this.p.keyindex + h + k + n].name, void 0 !== f[0][g] && (e = f[0][g])))); u = this.p.altclass; for (var o = 0, $ = "", k = {}, y = b.isfunction(this.p.afterinsertrow) ? !0 : !1; o < x;) {
m = f[o]; g = []; if (x) { try { e = m[g], void 0 === e && (e = b.jgrid.randid()) } catch (oa) { e = b.jgrid.randid() } $ = !0 === this.p.altrows ? 0 === (this.rows.length - 1) % 2 ? u : "" : "" } w = e; e = this.p.idprefix + e; n && (q = this.formatcol(0, 1, "", null, e, !0), g[g.length] = '
0
"); h && (p = '', q = this.formatcol(n, 1, "", null, e, !0), g[g.length] = '
" + p + "
"); k && (g[g.length] = b(this).jqgrid("addsubgridcell", h + n, 1)); for (r = h + k + n; r < this.p.colmodel.length; r++) ea = this.p.colmodel[r], l = ea.name, k[l] = m[l], p = this.formatter(e, b.jgrid.getaccessor(m, l), r, m), q = this.formatcol(r, 1, p, m, e, k), g[g.length] = '
" + p + "
"; g.unshift(this.constructtr(e, !1, $, k, m, !1));
g[g.length] = ""; if (0 === this.rows.length) b("table:first", this.grid.bdiv).append(g.join("")); else switch (c) {
case "last": b(this.rows[this.rows.length - 1]).after(g.join("")); m = this.rows.length - 1; break; case "first": b(this.rows[0]).after(g.join("")); m = 1; break; case "after": if (m = b(this).jqgrid("getgridrowbyid", d)) b(this.rows[m.rowindex + 1]).hasclass("ui-subgrid") ? b(this.rows[m.rowindex + 1]).after(g) : b(m).after(g.join("")), m = m.rowindex + 1; break; case "before": if (m = b(this).jqgrid("getgridrowbyid", d)) b(m).before(g.join("")),
m = m.rowindex - 1
} !0 === this.p.subgrid && b(this).jqgrid("addsubgrid", h + n, m); this.p.records++; this.p.reccount++; b(this).triggerhandler("jqgridafterinsertrow", [e, m, m]); y && this.p.afterinsertrow.call(this, e, m, m); o++; "local" === this.p.datatype && (k[this.p.localreader.id] = w, this.p._index[w] = this.p.data.length, this.p.data.push(k), k = {})
} !0 !== this.p.altrows || x || ("last" === c ? 1 === (this.rows.length - 1) % 2 && b(this.rows[this.rows.length - 1]).addclass(u) : b(this.rows).each(function (a) { 1 === a % 2 ? b(this).addclass(u) : b(this).removeclass(u) }));
this.updatepager(!0, !0); a = !0
})); return a
}, footerdata: function (e, f, c) {
function d(a) { for (var b in a) if (a.hasownproperty(b)) return !1; return !0 } var a, l = !1, g = {}, h; void 0 == e && (e = "get"); "boolean" !== typeof c && (c = !0); e = e.tolowercase(); this.each(function () {
var k = this, n; if (!k.grid || !k.p.footerrow || "set" === e && d(f)) return !1; l = !0; b(this.p.colmodel).each(function (d) {
a = this.name; "set" === e ? void 0 !== f[a] && (n = c ? k.formatter("", f[a], d, f, "edit") : f[a], h = this.title ? { title: b.jgrid.striphtml(n) } : {}, b("tr.footrow td:eq(" + d +
")", k.grid.sdiv).html(n).attr(h), l = !0) : "get" === e && (g[a] = b("tr.footrow td:eq(" + d + ")", k.grid.sdiv).html())
})
}); return "get" === e ? g : l
}, showhidecol: function (e, f) {
//alert(e);
this.each(function () {
//alert('ppp');
var c = this; //alert('1');
var d = !1; //alert(b.jgrid.cell_width); //alert(c.p.celllayout);
var a = b.jgrid.cell_width ? 0 : 0;//c.p.celllayout;
var l;
//alert('4');
if (c.grid) {
//alert('qqq');
"string" === typeof e && (e = [e]); f = "none" !== f ? "" : "none";
var g = "" === f ? !0 : !1;
var hd=(f==""?true:false);
//alert(this.hidden);
//alert(g);
//alert(-1 !== b.inarray(this.name, e));
var h = c.p.groupheader && ("object" === typeof c.p.groupheader || b.isfunction(c.p.groupheader)); h && b(c).jqgrid("destroygroupheader", !1);
b(this.p.colmodel).each(function (h) {
//alert(this.name);
////alert(b.inarray(this.name, e));
////alert(-1 !== b.inarray(this.name, e));
//alert(e);
var st = e.tostring();
var nam = this.name;
//alert(st.indexof(nam) > 0);
//alert(this.hidden);
if (st.indexof(nam) >= 0 && this.hidden === g)
{ if (!0 === c.p.frozencolumns && !0 === this.frozen) return !0; b("tr[role=rowheader]", c.grid.hdiv).each(function () { b(this.cells[h]).css("display", f) }); b(c.rows).each(function () { b(this).hasclass("jqgroup") || b(this.cells[h]).css("display", f) }); c.p.footerrow && b("tr.footrow td:eq(" + h + ")", c.grid.sdiv).css("display", f); l = parseint(this.width, 10); c.p.tblwidth = "none" === f ? c.p.tblwidth - (l + a) : c.p.tblwidth + (l + a); this.hidden = !g; d = !0; b(c).triggerhandler("jqgridshowhidecol", [g, this.name, h]) }
}); !0 === d &&
(!0 !== c.p.shrinktofit || isnan(c.p.height) || (c.p.tblwidth += parseint(c.p.scrolloffset, 10)), b(c).jqgrid("setgridwidth", !0 === c.p.shrinktofit ? c.p.tblwidth : c.p.width)); h && b(c).jqgrid("setgroupheaders", c.p.groupheader)
};
});
}, hidecol: function (e) { b(this).jqgrid("showhidecol", e, "none"); /*this.each(function () { b(this).jqgrid("showhidecol", e, "none"); alert('ooo'); });alert('iii');*/ }, showcol: function (e) { b(this).jqgrid("showhidecol", e, "");/*this.each(function () { b(this).jqgrid("showhidecol", e, "") })*/ }, remapcolumns: function (e, f, c) {
function d(a) {
var c; c = a.length ? b.makearray(a) : b.extend({}, a); b.each(e, function (b) {
a[b] =
c[this]
})
} function a(a, c) { b(">tr" + (c || ""), a).each(function () { var a = this, c = b.makearray(a.cells); b.each(e, function () { var b = c[this]; b && a.appendchild(b) }) }) } var l = this.get(0); d(l.p.colmodel); d(l.p.colnames); d(l.grid.headers); a(b("thead:first", l.grid.hdiv), c && ":not(.ui-jqgrid-labels)"); f && a(b("#" + b.jgrid.jqid(l.p.id) + " tbody:first"), ".jqgfirstrow, tr.jqgrow, tr.jqfoot"); l.p.footerrow && a(b("tbody:first", l.grid.sdiv)); l.p.remapcolumns && (l.p.remapcolumns.length ? d(l.p.remapcolumns) : l.p.remapcolumns = b.makearray(e));
l.p.lastsort = b.inarray(l.p.lastsort, e); l.p.treegrid && (l.p.expcolind = b.inarray(l.p.expcolind, e)); b(l).triggerhandler("jqgridremapcolumns", [e, f, c])
}, setgridwidth: function (e, f) {
return this.each(function () {
if (this.grid) {
var c = this, d, a = 0, l = b.jgrid.cell_width ? 0 : c.p.celllayout, g, h = 0, k = !1, n = c.p.scrolloffset, m, r = 0, p; "boolean" !== typeof f && (f = c.p.shrinktofit); if (!isnan(e)) {
e = parseint(e, 10); c.grid.width = c.p.width = e; b("#gbox_" + b.jgrid.jqid(c.p.id)).css("width", e + "px"); b("#gview_" + b.jgrid.jqid(c.p.id)).css("width",
e + "px"); b(c.grid.bdiv).css("width", e + "px"); b(c.grid.hdiv).css("width", e + "px"); c.p.pager && b(c.p.pager).css("width", e + "px"); c.p.toppager && b(c.p.toppager).css("width", e + "px"); !0 === c.p.toolbar[0] && (b(c.grid.udiv).css("width", e + "px"), "both" === c.p.toolbar[1] && b(c.grid.ubdiv).css("width", e + "px")); c.p.footerrow && b(c.grid.sdiv).css("width", e + "px"); !1 === f && !0 === c.p.forcefit && (c.p.forcefit = !1); if (!0 === f) {
b.each(c.p.colmodel, function () { !1 === this.hidden && (d = this.widthorg, a += d + l, this.fixed ? r += d + l : h++) }); if (0 ===
h) return; c.p.tblwidth = a; m = e - l * h - r; !isnan(c.p.height) && (b(c.grid.bdiv)[0].clientheight < b(c.grid.bdiv)[0].scrollheight || 1 === c.rows.length) && (k = !0, m -= n); var a = 0, q = 0 < c.grid.cols.length; b.each(c.p.colmodel, function (b) { !1 !== this.hidden || this.fixed || (d = this.widthorg, d = math.round(m * d / (c.p.tblwidth - l * h - r)), 0 > d || (this.width = d, a += d, c.grid.headers[b].width = d, c.grid.headers[b].el.style.width = d + "px", c.p.footerrow && (c.grid.footers[b].style.width = d + "px"), q && (c.grid.cols[b].style.width = d + "px"), g = b)) }); if (!g) return;
p = 0; k ? e - r - (a + l * h) !== n && (p = e - r - (a + l * h) - n) : 1 !== math.abs(e - r - (a + l * h)) && (p = e - r - (a + l * h)); c.p.colmodel[g].width += p; c.p.tblwidth = a + p + l * h + r; c.p.tblwidth > e ? (k = c.p.tblwidth - parseint(e, 10), c.p.tblwidth = e, d = c.p.colmodel[g].width -= k) : d = c.p.colmodel[g].width; c.grid.headers[g].width = d; c.grid.headers[g].el.style.width = d + "px"; q && (c.grid.cols[g].style.width = d + "px"); c.p.footerrow && (c.grid.footers[g].style.width = d + "px")
} c.p.tblwidth && (b("table:first", c.grid.bdiv).css("width", c.p.tblwidth + "px"), b("table:first", c.grid.hdiv).css("width",
c.p.tblwidth + "px"), c.grid.hdiv.scrollleft = c.grid.bdiv.scrollleft, c.p.footerrow && b("table:first", c.grid.sdiv).css("width", c.p.tblwidth + "px"))
}
}
})
}, setgridheight: function (e) { return this.each(function () { if (this.grid) { var f = b(this.grid.bdiv); f.css({ height: e + (isnan(e) ? "" : "px") }); !0 === this.p.frozencolumns && b("#" + b.jgrid.jqid(this.p.id) + "_frozen").parent().height(f.height() - 16); this.p.height = e; this.p.scroll && this.grid.populatevisible() } }) }, setcaption: function (e) {
return this.each(function () {
this.p.caption =
e; b("span.ui-jqgrid-title, span.ui-jqgrid-title-rtl", this.grid.cdiv).html(e); b(this.grid.cdiv).show()
})
}, setlabel: function (e, f, c, d) { return this.each(function () { var a = -1; if (this.grid && void 0 !== e && (b(this.p.colmodel).each(function (b) { if (this.name === e) return a = b, !1 }), 0 <= a)) { var l = b("tr.ui-jqgrid-labels th:eq(" + a + ")", this.grid.hdiv); if (f) { var g = b(".s-ico", l); b("[id^=jqgh_]", l).empty().html(f).append(g); this.p.colnames[a] = f } c && ("string" === typeof c ? b(l).addclass(c) : b(l).css(c)); "object" === typeof d && b(l).attr(d) } }) },
setcell: function (e, f, c, d, a, l) {
return this.each(function () {
var g = -1, h, k; if (this.grid && (isnan(f) ? b(this.p.colmodel).each(function (a) { if (this.name === f) return g = a, !1 }) : g = parseint(f, 10), 0 <= g && (h = b(this).jqgrid("getgridrowbyid", e)))) {
var n = b("td:eq(" + g + ")", h); if ("" !== c || !0 === l) h = this.formatter(e, c, g, h, "edit"), k = this.p.colmodel[g].title ? { title: b.jgrid.striphtml(h) } : {}, this.p.treegrid && 0 < b(".tree-wrap", b(n)).length ? b("span", b(n)).html(h).attr(k) : b(n).html(h).attr(k), "local" === this.p.datatype && (h = this.p.colmodel[g],
c = h.formatter && "string" === typeof h.formatter && "date" === h.formatter ? b.unformat.date.call(this, c, h) : c, k = this.p._index[b.jgrid.strippref(this.p.idprefix, e)], void 0 !== k && (this.p.data[k][h.name] = c)); "string" === typeof d ? b(n).addclass(d) : d && b(n).css(d); "object" === typeof a && b(n).attr(a)
}
})
}, getcell: function (e, f) {
var c = !1; this.each(function () {
var d = -1; if (this.grid && (isnan(f) ? b(this.p.colmodel).each(function (a) { if (this.name === f) return d = a, !1 }) : d = parseint(f, 10), 0 <= d)) {
var a = b(this).jqgrid("getgridrowbyid", e);
if (a) try { c = b.unformat.call(this, b("td:eq(" + d + ")", a), { rowid: a.id, colmodel: this.p.colmodel[d] }, d) } catch (l) { c = b.jgrid.htmldecode(b("td:eq(" + d + ")", a).html()) }
}
}); return c
}, getcol: function (e, f, c) {
var d = [], a, l = 0, g, h, k; f = "boolean" !== typeof f ? !1 : f; void 0 === c && (c = !1); this.each(function () {
var n = -1; if (this.grid && (isnan(e) ? b(this.p.colmodel).each(function (a) { if (this.name === e) return n = a, !1 }) : n = parseint(e, 10), 0 <= n)) {
var m = this.rows.length, r = 0, p = 0; if (m && 0 < m) {
for (; r < m;) {
if (b(this.rows[r]).hasclass("jqgrow")) {
try {
a =
b.unformat.call(this, b(this.rows[r].cells[n]), { rowid: this.rows[r].id, colmodel: this.p.colmodel[n] }, n)
} catch (q) { a = b.jgrid.htmldecode(this.rows[r].cells[n].innerhtml) } c ? (k = parsefloat(a), isnan(k) || (l += k, void 0 === h && (h = g = k), g = math.min(g, k), h = math.max(h, k), p++)) : f ? d.push({ id: this.rows[r].id, value: a }) : d.push(a)
} r++
} if (c) switch (c.tolowercase()) { case "sum": d = l; break; case "avg": d = l / p; break; case "count": d = m - 1; break; case "min": d = g; break; case "max": d = h }
}
}
}); return d
}, cleargriddata: function (e) {
return this.each(function () {
if (this.grid) {
"boolean" !==
typeof e && (e = !1); if (this.p.deepempty) b("#" + b.jgrid.jqid(this.p.id) + " tbody:first tr:gt(0)").remove(); else { var f = b("#" + b.jgrid.jqid(this.p.id) + " tbody:first tr:first")[0]; b("#" + b.jgrid.jqid(this.p.id) + " tbody:first").empty().append(f) } this.p.footerrow && e && b(".ui-jqgrid-ftable td", this.grid.sdiv).html(" "); this.p.selrow = null; this.p.selarrrow = []; this.p.savedrow = []; this.p.records = 0; this.p.page = 1; this.p.lastpage = 0; this.p.reccount = 0; this.p.data = []; this.p._index = {}; this.updatepager(!0, !1)
}
})
}, getind: function (e,
f) { var c = !1, d; this.each(function () { (d = b(this).jqgrid("getgridrowbyid", e)) && (c = !0 === f ? d : d.rowindex) }); return c }, bindkeys: function (e) {
var f = b.extend({ onenter: null, onspace: null, onleftkey: null, onrightkey: null, scrollingrows: !0 }, e || {}); return this.each(function () {
var c = this; b("body").is("[role]") || b("body").attr("role", "application"); c.p.scrollrows = f.scrollingrows; b(c).keydown(function (d) {
var a = b(c).find("tr[tabindex=0]")[0], e, g, h, k = c.p.treereader.expanded_field; if (a) if (h = c.p._index[b.jgrid.strippref(c.p.idprefix,
a.id)], 37 === d.keycode || 38 === d.keycode || 39 === d.keycode || 40 === d.keycode) {
if (38 === d.keycode) { g = a.previoussibling; e = ""; if (g) if (b(g).is(":hidden")) for (; g;) { if (g = g.previoussibling, !b(g).is(":hidden") && b(g).hasclass("jqgrow")) { e = g.id; break } } else e = g.id; b(c).jqgrid("setselection", e, !0, d); d.preventdefault() } if (40 === d.keycode) {
g = a.nextsibling; e = ""; if (g) if (b(g).is(":hidden")) for (; g;) { if (g = g.nextsibling, !b(g).is(":hidden") && b(g).hasclass("jqgrow")) { e = g.id; break } } else e = g.id; b(c).jqgrid("setselection", e, !0, d);
d.preventdefault()
} 37 === d.keycode && (c.p.treegrid && c.p.data[h][k] && b(a).find("div.treeclick").trigger("click"), b(c).triggerhandler("jqgridkeyleft", [c.p.selrow]), b.isfunction(f.onleftkey) && f.onleftkey.call(c, c.p.selrow)); 39 === d.keycode && (c.p.treegrid && !c.p.data[h][k] && b(a).find("div.treeclick").trigger("click"), b(c).triggerhandler("jqgridkeyright", [c.p.selrow]), b.isfunction(f.onrightkey) && f.onrightkey.call(c, c.p.selrow))
} else 13 === d.keycode ? (b(c).triggerhandler("jqgridkeyenter", [c.p.selrow]), b.isfunction(f.onenter) &&
f.onenter.call(c, c.p.selrow)) : 32 === d.keycode && (b(c).triggerhandler("jqgridkeyspace", [c.p.selrow]), b.isfunction(f.onspace) && f.onspace.call(c, c.p.selrow))
})
})
}, unbindkeys: function () { return this.each(function () { b(this).unbind("keydown") }) }, getlocalrow: function (e) { var f = !1, c; this.each(function () { void 0 !== e && (c = this.p._index[b.jgrid.strippref(this.p.idprefix, e)], 0 <= c && (f = this.p.data[c])) }); return f }
})
})(jquery);
(function (a) {
a.fmatter = {}; a.extend(a.fmatter, {
isboolean: function (a) { return "boolean" === typeof a }, isobject: function (c) { return c && ("object" === typeof c || a.isfunction(c)) || !1 }, isstring: function (a) { return "string" === typeof a }, isnumber: function (a) { return "number" === typeof a && isfinite(a) }, isvalue: function (a) { return this.isobject(a) || this.isstring(a) || this.isnumber(a) || this.isboolean(a) }, isempty: function (c) {
if (!this.isstring(c) && this.isvalue(c)) return !1; if (!this.isvalue(c)) return !0; c = a.trim(c).replace(/\ \;/ig,
"").replace(/\ \;/ig, ""); return "" === c
}
}); a.fn.fmatter = function (c, b, d, e, f) { var g = b; d = a.extend({}, a.jgrid.formatter, d); try { g = a.fn.fmatter[c].call(this, b, d, e, f) } catch (h) { } return g }; a.fmatter.util = {
numberformat: function (c, b) {
a.fmatter.isnumber(c) || (c *= 1); if (a.fmatter.isnumber(c)) {
var d = 0 > c, e = string(c), f = b.decimalseparator || ".", g; if (a.fmatter.isnumber(b.decimalplaces)) {
var h = b.decimalplaces, e = math.pow(10, h), e = string(math.round(c * e) / e); g = e.lastindexof("."); if (0 < h) for (0 > g ? (e += f, g = e.length - 1) : "." !== f &&
(e = e.replace(".", f)) ; e.length - 1 - g < h;) e += "0"
} if (b.thousandsseparator) { h = b.thousandsseparator; g = e.lastindexof(f); g = -1 < g ? g : e.length; var f = e.substring(g), l = -1, k; for (k = g; 0 < k; k--) l++, 0 === l % 3 && k !== g && (!d || 1 < k) && (f = h + f), f = e.charat(k - 1) + f; e = f } e = b.prefix ? b.prefix + e : e; return e = b.suffix ? e + b.suffix : e
} return c
}
}; a.fn.fmatter.defaultformat = function (c, b) { return a.fmatter.isvalue(c) && "" !== c ? c : b.defaultvalue || " " }; a.fn.fmatter.email = function (c, b) {
return a.fmatter.isempty(c) ? a.fn.fmatter.defaultformat(c, b) : '' + c + ""
}; a.fn.fmatter.checkbox = function (c, b) { var d = a.extend({}, b.checkbox), e; void 0 !== b.colmodel && void 0 !== b.colmodel.formatoptions && (d = a.extend({}, d, b.colmodel.formatoptions)); e = !0 === d.disabled ? 'disabled="disabled"' : ""; if (a.fmatter.isempty(c) || void 0 === c) c = a.fn.fmatter.defaultformat(c, d); c = string(c); c = (c + "").tolowercase(); return ' c.search(/(false|f|0|no|n|off|undefined)/i) ? " checked='checked' " : "") + ' value="' + c + '" offval="no" ' + e + "/>" }; a.fn.fmatter.link = function (c,
b) { var d = { target: b.target }, e = ""; void 0 !== b.colmodel && void 0 !== b.colmodel.formatoptions && (d = a.extend({}, d, b.colmodel.formatoptions)); d.target && (e = "target=" + d.target); return a.fmatter.isempty(c) ? a.fn.fmatter.defaultformat(c, b) : "' + c + "" }; a.fn.fmatter.showlink = function (c, b) {
var d = { baselinkurl: b.baselinkurl, showaction: b.showaction, addparam: b.addparam || "", target: b.target, idname: b.idname }, e = ""; void 0 !== b.colmodel && void 0 !== b.colmodel.formatoptions && (d = a.extend({}, d, b.colmodel.formatoptions));
d.target && (e = "target=" + d.target); d = d.baselinkurl + d.showaction + "?" + d.idname + "=" + b.rowid + d.addparam; return a.fmatter.isstring(c) || a.fmatter.isnumber(c) ? "' + c + "" : a.fn.fmatter.defaultformat(c, b)
}; a.fn.fmatter.integer = function (c, b) { var d = a.extend({}, b.integer); void 0 !== b.colmodel && void 0 !== b.colmodel.formatoptions && (d = a.extend({}, d, b.colmodel.formatoptions)); return a.fmatter.isempty(c) ? d.defaultvalue : a.fmatter.util.numberformat(c, d) }; a.fn.fmatter.number = function (c, b) {
var d = a.extend({},
b.number); void 0 !== b.colmodel && void 0 !== b.colmodel.formatoptions && (d = a.extend({}, d, b.colmodel.formatoptions)); return a.fmatter.isempty(c) ? d.defaultvalue : a.fmatter.util.numberformat(c, d)
}; a.fn.fmatter.currency = function (c, b) { var d = a.extend({}, b.currency); void 0 !== b.colmodel && void 0 !== b.colmodel.formatoptions && (d = a.extend({}, d, b.colmodel.formatoptions)); return a.fmatter.isempty(c) ? d.defaultvalue : a.fmatter.util.numberformat(c, d) }; a.fn.fmatter.date = function (c, b, d, e) {
d = a.extend({}, b.date); void 0 !== b.colmodel &&
void 0 !== b.colmodel.formatoptions && (d = a.extend({}, d, b.colmodel.formatoptions)); return d.reformatafteredit || "edit" !== e ? a.fmatter.isempty(c) ? a.fn.fmatter.defaultformat(c, b) : a.jgrid.parsedate(d.srcformat, c, d.newformat, d) : a.fn.fmatter.defaultformat(c, b)
}; a.fn.fmatter.select = function (c, b) {
c = string(c); var d = !1, e = [], f, g; void 0 !== b.colmodel.formatoptions ? (d = b.colmodel.formatoptions.value, f = void 0 === b.colmodel.formatoptions.separator ? ":" : b.colmodel.formatoptions.separator, g = void 0 === b.colmodel.formatoptions.delimiter ?
";" : b.colmodel.formatoptions.delimiter) : void 0 !== b.colmodel.editoptions && (d = b.colmodel.editoptions.value, f = void 0 === b.colmodel.editoptions.separator ? ":" : b.colmodel.editoptions.separator, g = void 0 === b.colmodel.editoptions.delimiter ? ";" : b.colmodel.editoptions.delimiter); if (d) {
var h = !0 === b.colmodel.editoptions.multiple ? !0 : !1, l = []; h && (l = c.split(","), l = a.map(l, function (b) { return a.trim(b) })); if (a.fmatter.isstring(d)) {
var k = d.split(g), m = 0, n; for (n = 0; n < k.length; n++) if (g = k[n].split(f), 2 < g.length && (g[1] = a.map(g,
function (a, b) { if (0 < b) return a }).join(f)), h) -1 < a.inarray(g[0], l) && (e[m] = g[1], m++); else if (a.trim(g[0]) === a.trim(c)) { e[0] = g[1]; break }
} else a.fmatter.isobject(d) && (h ? e = a.map(l, function (a) { return d[a] }) : e[0] = d[c] || "")
} c = e.join(", "); return "" === c ? a.fn.fmatter.defaultformat(c, b) : c
}; a.fn.fmatter.rowactions = function (c) {
var b = a(this).closest("tr.jqgrow"), d = b.attr("id"), e = a(this).closest("table.ui-jqgrid-btable").attr("id").replace(/_frozen([^_]*)$/, "$1"), e = a("#" + e), f = e[0], g = f.p, h = g.colmodel[a.jgrid.getcellindex(this)],
l = h.frozen ? a("tr#" + d + " td:eq(" + a.jgrid.getcellindex(this) + ") > div", e) : a(this).parent(), k = { extraparam: {} }, m = function (b) { a.isfunction(k.afterrestore) && k.afterrestore.call(f, b); l.find("div.ui-inline-edit,div.ui-inline-del").show(); l.find("div.ui-inline-save,div.ui-inline-cancel").hide() }; void 0 !== h.formatoptions && (k = a.extend(k, h.formatoptions)); void 0 !== g.editoptions && (k.editoptions = g.editoptions); void 0 !== g.deloptions && (k.deloptions = g.deloptions); b.hasclass("jqgrid-new-row") && (k.extraparam[g.prmnames.oper] =
g.prmnames.addoper); b = { keys: k.keys, oneditfunc: k.onedit, successfunc: k.onsuccess, url: k.url, extraparam: k.extraparam, aftersavefunc: function (b, c) { a.isfunction(k.aftersave) && k.aftersave.call(f, b, c); l.find("div.ui-inline-edit,div.ui-inline-del").show(); l.find("div.ui-inline-save,div.ui-inline-cancel").hide() }, errorfunc: k.onerror, afterrestorefunc: m, restoreaftererror: k.restoreaftererror, mtype: k.mtype }; switch (c) {
case "edit": e.jqgrid("editrow", d, b); l.find("div.ui-inline-edit,div.ui-inline-del").hide(); l.find("div.ui-inline-save,div.ui-inline-cancel").show();
e.triggerhandler("jqgridaftergridcomplete"); break; case "save": e.jqgrid("saverow", d, b) && (l.find("div.ui-inline-edit,div.ui-inline-del").show(), l.find("div.ui-inline-save,div.ui-inline-cancel").hide(), e.triggerhandler("jqgridaftergridcomplete")); break; case "cancel": e.jqgrid("restorerow", d, m); l.find("div.ui-inline-edit,div.ui-inline-del").show(); l.find("div.ui-inline-save,div.ui-inline-cancel").hide(); e.triggerhandler("jqgridaftergridcomplete"); break; case "del": e.jqgrid("delgridrow", d, k.deloptions);
break; case "formedit": e.jqgrid("setselection", d), e.jqgrid("editgridrow", d, k.editoptions)
}
}; a.fn.fmatter.actions = function (c, b) {
var d = { keys: !1, editbutton: !0, delbutton: !0, editformbutton: !1 }, e = b.rowid, f = ""; void 0 !== b.colmodel.formatoptions && (d = a.extend(d, b.colmodel.formatoptions)); if (void 0 === e || a.fmatter.isempty(e)) return ""; d.editformbutton ? f += "
" : d.editbutton && (f += "
"); d.delbutton && (f += "
"); f += "
"; f += "
"; return "
" + f + "
"
}; a.unformat = function (c,
b, d, e) {
var f, g = b.colmodel.formatter, h = b.colmodel.formatoptions || {}, l = /([\.\*\_\'\(\)\{\}\+\?\\])/g, k = b.colmodel.unformat || a.fn.fmatter[g] && a.fn.fmatter[g].unformat; if (void 0 !== k && a.isfunction(k)) f = k.call(this, a(c).text(), b, c); else if (void 0 !== g && a.fmatter.isstring(g)) switch (f = a.jgrid.formatter || {}, g) {
case "integer": h = a.extend({}, f.integer, h); b = h.thousandsseparator.replace(l, "\\$1"); b = regexp(b, "g"); f = a(c).text().replace(b, ""); break; case "number": h = a.extend({}, f.number, h); b = h.thousandsseparator.replace(l,
"\\$1"); b = regexp(b, "g"); f = a(c).text().replace(b, "").replace(h.decimalseparator, "."); break; case "currency": h = a.extend({}, f.currency, h); b = h.thousandsseparator.replace(l, "\\$1"); b = regexp(b, "g"); f = a(c).text(); h.prefix && h.prefix.length && (f = f.substr(h.prefix.length)); h.suffix && h.suffix.length && (f = f.substr(0, f.length - h.suffix.length)); f = f.replace(b, "").replace(h.decimalseparator, "."); break; case "checkbox": h = b.colmodel.editoptions ? b.colmodel.editoptions.value.split(":") : ["yes", "no"]; f = a("input", c).is(":checked") ?
h[0] : h[1]; break; case "select": f = a.unformat.select(c, b, d, e); break; case "actions": return ""; default: f = a(c).text()
} return void 0 !== f ? f : !0 === e ? a(c).text() : a.jgrid.htmldecode(a(c).html())
}; a.unformat.select = function (c, b, d, e) {
d = []; c = a(c).text(); if (!0 === e) return c; e = a.extend({}, void 0 !== b.colmodel.formatoptions ? b.colmodel.formatoptions : b.colmodel.editoptions); b = void 0 === e.separator ? ":" : e.separator; var f = void 0 === e.delimiter ? ";" : e.delimiter; if (e.value) {
var g = e.value; e = !0 === e.multiple ? !0 : !1; var h = []; e && (h =
c.split(","), h = a.map(h, function (b) { return a.trim(b) })); if (a.fmatter.isstring(g)) { var l = g.split(f), k = 0, m; for (m = 0; m < l.length; m++) if (f = l[m].split(b), 2 < f.length && (f[1] = a.map(f, function (a, b) { if (0 < b) return a }).join(b)), e) -1 < a.inarray(f[1], h) && (d[k] = f[0], k++); else if (a.trim(f[1]) === a.trim(c)) { d[0] = f[0]; break } } else if (a.fmatter.isobject(g) || a.isarray(g)) e || (h[0] = c), d = a.map(h, function (b) { var c; a.each(g, function (a, d) { if (d === b) return c = a, !1 }); if (void 0 !== c) return c }); return d.join(", ")
} return c || ""
}; a.unformat.date =
function (c, b) { var d = a.jgrid.formatter.date || {}; void 0 !== b.formatoptions && (d = a.extend({}, d, b.formatoptions)); return a.fmatter.isempty(c) ? a.fn.fmatter.defaultformat(c, b) : a.jgrid.parsedate(d.newformat, c, d.srcformat, d) }
})(jquery);
(function (a) {
a.jgrid.extend({
getcolprop: function (a) { var c = {}, d = this[0]; if (!d.grid) return !1; var d = d.p.colmodel, h; for (h = 0; h < d.length; h++) if (d[h].name === a) { c = d[h]; break } return c }, setcolprop: function (b, c) { return this.each(function () { if (this.grid && c) { var d = this.p.colmodel, h; for (h = 0; h < d.length; h++) if (d[h].name === b) { a.extend(!0, this.p.colmodel[h], c); break } } }) }, sortgrid: function (a, c, d) {
return this.each(function () {
var h = -1, k, e = !1; if (this.grid) {
a || (a = this.p.sortname); for (k = 0; k < this.p.colmodel.length; k++) if (this.p.colmodel[k].index ===
a || this.p.colmodel[k].name === a) { h = k; !0 === this.p.frozencolumns && !0 === this.p.colmodel[k].frozen && (e = this.grid.fhdiv.find("#" + this.p.id + "_" + a)); break } -1 !== h && (k = this.p.colmodel[h].sortable, e || (e = this.grid.headers[h].el), "boolean" !== typeof k && (k = !0), "boolean" !== typeof c && (c = !1), k && this.sortdata("jqgh_" + this.p.id + "_" + a, h, c, d, e))
}
})
}, clearbeforeunload: function () {
return this.each(function () {
var b = this.grid; a.isfunction(b.emptyrows) && b.emptyrows.call(this, !0, !0); a(document).unbind("mouseup.jqgrid" + this.p.id);
a(b.hdiv).unbind("mousemove"); a(this).unbind(); b.dragend = null; b.dragmove = null; b.dragstart = null; b.emptyrows = null; b.populate = null; b.populatevisible = null; b.scrollgrid = null; b.selectionpreserver = null; b.bdiv = null; b.cdiv = null; b.hdiv = null; b.cols = null; var c, d = b.headers.length; for (c = 0; c < d; c++) b.headers[c].el = null; this.grid = this.addjsondata = this.addxmldata = this.formatter = this.constructtr = this.setheadcheckbox = this.refreshindex = this.updatepager = this.sortdata = this.formatcol = null
})
}, griddestroy: function () {
return this.each(function () {
if (this.grid) {
this.p.pager &&
a(this.p.pager).remove(); try { a(this).jqgrid("clearbeforeunload"), a("#gbox_" + a.jgrid.jqid(this.id)).remove() } catch (b) { }
}
})
}, gridunload: function () {
return this.each(function () {
if (this.grid) {
var b = a(this).attr("id"), c = a(this).attr("class"); this.p.pager && a(this.p.pager).empty().removeclass("ui-state-default ui-jqgrid-pager ui-corner-bottom"); var d = document.createelement("table"); a(d).attr({ id: b }); d.classname = c; b = a.jgrid.jqid(this.id); a(d).removeclass("ui-jqgrid-btable"); 1 === a(this.p.pager).parents("#gbox_" +
b).length ? (a(d).insertbefore("#gbox_" + b).show(), a(this.p.pager).insertbefore("#gbox_" + b)) : a(d).insertbefore("#gbox_" + b).show(); a(this).jqgrid("clearbeforeunload"); a("#gbox_" + b).remove()
}
})
}, setgridstate: function (b) {
return this.each(function () {
this.grid && ("hidden" === b ? (a(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv", "#gview_" + a.jgrid.jqid(this.p.id)).slideup("fast"), this.p.pager && a(this.p.pager).slideup("fast"), this.p.toppager && a(this.p.toppager).slideup("fast"), !0 === this.p.toolbar[0] && ("both" === this.p.toolbar[1] &&
a(this.grid.ubdiv).slideup("fast"), a(this.grid.udiv).slideup("fast")), this.p.footerrow && a(".ui-jqgrid-sdiv", "#gbox_" + a.jgrid.jqid(this.p.id)).slideup("fast"), a(".ui-jqgrid-titlebar-close span", this.grid.cdiv).removeclass("ui-icon-circle-triangle-n").addclass("ui-icon-circle-triangle-s"), this.p.gridstate = "hidden") : "visible" === b && (a(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv", "#gview_" + a.jgrid.jqid(this.p.id)).slidedown("fast"), this.p.pager && a(this.p.pager).slidedown("fast"), this.p.toppager && a(this.p.toppager).slidedown("fast"),
!0 === this.p.toolbar[0] && ("both" === this.p.toolbar[1] && a(this.grid.ubdiv).slidedown("fast"), a(this.grid.udiv).slidedown("fast")), this.p.footerrow && a(".ui-jqgrid-sdiv", "#gbox_" + a.jgrid.jqid(this.p.id)).slidedown("fast"), a(".ui-jqgrid-titlebar-close span", this.grid.cdiv).removeclass("ui-icon-circle-triangle-s").addclass("ui-icon-circle-triangle-n"), this.p.gridstate = "visible"))
})
}, filtertoolbar: function (b) {
b = a.extend({
autosearch: !0, searchonenter: !0, beforesearch: null, aftersearch: null, beforeclear: null, afterclear: null,
searchurl: "", stringresult: !1, groupop: "and", defaultsearch: "bw", searchoperators: !1, reseticon: "x", operands: { eq: "==", ne: "!", lt: "<", le: "<=", gt: ">", ge: ">=", bw: "^", bn: "!^", "in": "=", ni: "!=", ew: "|", en: "!@", cn: "~", nc: "!~", nu: "#", nn: "!#" }
}, a.jgrid.search, b || {}); return this.each(function () {
var c = this; if (!this.ftoolbar) {
var d = function () {
var d = {}, f = 0, g, m, e = {}, q; a.each(c.p.colmodel, function () {
var l = a("#gs_" + a.jgrid.jqid(this.name), !0 === this.frozen && !0 === c.p.frozencolumns ? c.grid.fhdiv : c.grid.hdiv); m = this.index ||
this.name; q = b.searchoperators ? l.parent().prev().children("a").attr("soper") || b.defaultsearch : this.searchoptions && this.searchoptions.sopt ? this.searchoptions.sopt[0] : "select" === this.stype ? "eq" : b.defaultsearch; if ((g = "custom" === this.stype && a.isfunction(this.searchoptions.custom_value) && 0 < l.length && "span" === l[0].nodename.touppercase() ? this.searchoptions.custom_value.call(c, l.children(".customelement:first"), "get") : l.val()) || "nu" === q || "nn" === q) d[m] = g, e[m] = q, f++; else try { delete c.p.postdata[m] } catch (k) { }
});
var k = 0 < f ? !0 : !1; if (!0 === b.stringresult || "local" === c.p.datatype) { var l = '{"groupop":"' + b.groupop + '","rules":[', n = 0; a.each(d, function (a, b) { 0 < n && (l += ","); l += '{"field":"' + a + '",'; l += '"op":"' + e[a] + '",'; l += '"data":"' + (b + "").replace(/\\/g, "\\\\").replace(/\"/g, '\\"') + '"}'; n++ }); l += "]}"; a.extend(c.p.postdata, { filters: l }); a.each(["searchfield", "searchstring", "searchoper"], function (a, b) { c.p.postdata.hasownproperty(b) && delete c.p.postdata[b] }) } else a.extend(c.p.postdata, d); var r; c.p.searchurl && (r = c.p.url, a(c).jqgrid("setgridparam",
{ url: c.p.searchurl })); var h = "stop" === a(c).triggerhandler("jqgridtoolbarbeforesearch") ? !0 : !1; !h && a.isfunction(b.beforesearch) && (h = b.beforesearch.call(c)); h || a(c).jqgrid("setgridparam", { search: k }).trigger("reloadgrid", [{ page: 1 }]); r && a(c).jqgrid("setgridparam", { url: r }); a(c).triggerhandler("jqgridtoolbaraftersearch"); a.isfunction(b.aftersearch) && b.aftersearch.call(c)
}, h = function (e, f, g) {
a("#sopt_menu").remove(); f = parseint(f, 10); g = parseint(g, 10) + 18; f = '
'; g = a(e).attr("soper"); var k, h = [], q, p = 0, l = a(e).attr("colname"); for (k = c.p.colmodel.length; p < k && c.p.colmodel[p].name !== l;) p++; p = c.p.colmodel[p]; l = a.extend({}, p.searchoptions); l.sopt || (l.sopt = [], l.sopt[0] = "select" === p.stype ? "eq" : b.defaultsearch); a.each(b.odata, function () { h.push(this.oper) }); for (p = 0; p < l.sopt.length; p++) q = a.inarray(l.sopt[p], h), -1 !== q && (k = g === b.odata[q].oper ? "ui-state-highlight" : "", f += '
' + b.operands[b.odata[q].oper] + "
" + b.odata[q].text + "
"); f += "
"; a("body").append(f); a("#sopt_menu").addclass("ui-menu ui-widget ui-widget-content ui-corner-all"); a("#sopt_menu > li > a").hover(function () { a(this).addclass("ui-state-hover") },
function () { a(this).removeclass("ui-state-hover") }).click(function (f) { f = a(this).attr("value"); var g = a(this).attr("oper"); a(c).triggerhandler("jqgridtoolbarselectoper", [f, g, e]); a("#sopt_menu").hide(); a(e).text(g).attr("soper", f); !0 === b.autosearch && (g = a(e).parent().next().children()[0], (a(g).val() || "nu" === f || "nn" === f) && d()) })
}, k = a("
"), e; a.each(c.p.colmodel, function (h) {
var f = this, g, m; m = ""; var x = "=", q, p = a("
"), l = a(""), n = a("
"); !0 === this.hidden && a(p).css("display", "none"); this.search = !1 === this.search ? !1 : !0; void 0 === this.stype && (this.stype = "text"); g = a.extend({}, this.searchoptions || {}); if (this.search) {
if (b.searchoperators) {
m = g.sopt ? g.sopt[0] :
"select" === f.stype ? "eq" : b.defaultsearch; for (q = 0; q < b.odata.length; q++) if (b.odata[q].oper === m) { x = b.operands[m] || ""; break } m = "" + x + ""
} a("td:eq(0)", n).attr("colindex", h).append(m); void 0 === g.clearsearch && (g.clearsearch = !0); g.clearsearch ? (m = b.resettitle || "clear search value", a("td:eq(2)", n).append("" +
b.reseticon + "")) : a("td:eq(2)", n).hide(); switch (this.stype) {
case "select": if (m = this.surl || g.dataurl) a(l).append(n), a.ajax(a.extend({
url: m, datatype: "html", success: function (e) {
void 0 !== g.buildselect ? (e = g.buildselect(e)) && a("td:eq(1)", n).append(e) : a("td:eq(1)", n).append(e); void 0 !== g.defaultvalue && a("select", l).val(g.defaultvalue); a("select", l).attr({ name: f.index || f.name, id: "gs_" + f.name }); g.attr && a("select", l).attr(g.attr); a("select", l).css({ width: "100%" }); a.jgrid.bindev.call(c, a("select", l)[0], g);
!0 === b.autosearch && a("select", l).change(function () { d(); return !1 }); e = null
}
}, a.jgrid.ajaxoptions, c.p.ajaxselectoptions || {})); else {
var r, w, u; f.searchoptions ? (r = void 0 === f.searchoptions.value ? "" : f.searchoptions.value, w = void 0 === f.searchoptions.separator ? ":" : f.searchoptions.separator, u = void 0 === f.searchoptions.delimiter ? ";" : f.searchoptions.delimiter) : f.editoptions && (r = void 0 === f.editoptions.value ? "" : f.editoptions.value, w = void 0 === f.editoptions.separator ? ":" : f.editoptions.separator, u = void 0 === f.editoptions.delimiter ?
";" : f.editoptions.delimiter); if (r) {
var t = document.createelement("select"); t.style.width = "100%"; a(t).attr({ name: f.index || f.name, id: "gs_" + f.name }); var v; if ("string" === typeof r) for (m = r.split(u), v = 0; v < m.length; v++) r = m[v].split(w), u = document.createelement("option"), u.value = r[0], u.innerhtml = r[1], t.appendchild(u); else if ("object" === typeof r) for (v in r) r.hasownproperty(v) && (u = document.createelement("option"), u.value = v, u.innerhtml = r[v], t.appendchild(u)); void 0 !== g.defaultvalue && a(t).val(g.defaultvalue); g.attr &&
a(t).attr(g.attr); a(l).append(n); a.jgrid.bindev.call(c, t, g); a("td:eq(1)", n).append(t); !0 === b.autosearch && a(t).change(function () { d(); return !1 })
}
} break; case "text": w = void 0 !== g.defaultvalue ? g.defaultvalue : ""; a("td:eq(1)", n).append(""); a(l).append(n); g.attr && a("input", l).attr(g.attr); a.jgrid.bindev.call(c, a("input", l)[0], g); !0 === b.autosearch && (b.searchonenter ? a("input", l).keypress(function (a) {
return 13 ===
(a.charcode || a.keycode || 0) ? (d(), !1) : this
}) : a("input", l).keydown(function (a) { switch (a.which) { case 13: return !1; case 9: case 16: case 37: case 38: case 39: case 40: case 27: break; default: e && cleartimeout(e), e = settimeout(function () { d() }, 500) } })); break; case "custom": a("td:eq(1)", n).append(""); a(l).append(n); try {
if (a.isfunction(g.custom_element)) if (t = g.custom_element.call(c, void 0 !== g.defaultvalue ? g.defaultvalue : "", g)) t = a(t).addclass("customelement"),
a(l).find(">span").append(t); else throw "e2"; else throw "e1";
} catch (y) { "e1" === y && a.jgrid.info_dialog(a.jgrid.errors.errcap, "function 'custom_element' " + a.jgrid.edit.msg.nodefined, a.jgrid.edit.bclose), "e2" === y ? a.jgrid.info_dialog(a.jgrid.errors.errcap, "function 'custom_element' " + a.jgrid.edit.msg.novalue, a.jgrid.edit.bclose) : a.jgrid.info_dialog(a.jgrid.errors.errcap, "string" === typeof y ? y : y.message, a.jgrid.edit.bclose) }
}
} a(p).append(l); a(k).append(p); b.searchoperators || a("td:eq(0)", n).hide()
}); a("table thead",
c.grid.hdiv).append(k); b.searchoperators && (a(".soptclass", k).click(function (b) { var c = a(this).offset(); h(this, c.left, c.top); b.stoppropagation() }), a("body").on("click", function (b) { "soptclass" !== b.target.classname && a("#sopt_menu").hide() })); a(".clearsearchclass", k).click(function (e) {
e = a(this).parents("tr:first"); var f = parseint(a("td.ui-search-oper", e).attr("colindex"), 10), g = a.extend({}, c.p.colmodel[f].searchoptions || {}), g = g.defaultvalue ? g.defaultvalue : ""; "select" === c.p.colmodel[f].stype ? g ? a("td.ui-search-input select",
e).val(g) : a("td.ui-search-input select", e)[0].selectedindex = 0 : a("td.ui-search-input input", e).val(g); !0 === b.autosearch && d()
}); this.ftoolbar = !0; this.triggertoolbar = d; this.cleartoolbar = function (d) {
var f = {}, g = 0, e; d = "boolean" !== typeof d ? !0 : d; a.each(c.p.colmodel, function () {
var b, d = a("#gs_" + a.jgrid.jqid(this.name), !0 === this.frozen && !0 === c.p.frozencolumns ? c.grid.fhdiv : c.grid.hdiv); this.searchoptions && void 0 !== this.searchoptions.defaultvalue && (b = this.searchoptions.defaultvalue); e = this.index || this.name; switch (this.stype) {
case "select": d.find("option").each(function (c) {
0 ===
c && (this.selected = !0); if (a(this).val() === b) return this.selected = !0, !1
}); if (void 0 !== b) f[e] = b, g++; else try { delete c.p.postdata[e] } catch (h) { } break; case "text": d.val(b || ""); if (void 0 !== b) f[e] = b, g++; else try { delete c.p.postdata[e] } catch (k) { } break; case "custom": a.isfunction(this.searchoptions.custom_value) && 0 < d.length && "span" === d[0].nodename.touppercase() && this.searchoptions.custom_value.call(c, d.children(".customelement:first"), "set", b || "")
}
}); var k = 0 < g ? !0 : !1; c.p.resetsearch = !0; if (!0 === b.stringresult ||
"local" === c.p.datatype) { var h = '{"groupop":"' + b.groupop + '","rules":[', p = 0; a.each(f, function (a, b) { 0 < p && (h += ","); h += '{"field":"' + a + '",'; h += '"op":"eq",'; h += '"data":"' + (b + "").replace(/\\/g, "\\\\").replace(/\"/g, '\\"') + '"}'; p++ }); h += "]}"; a.extend(c.p.postdata, { filters: h }); a.each(["searchfield", "searchstring", "searchoper"], function (a, b) { c.p.postdata.hasownproperty(b) && delete c.p.postdata[b] }) } else a.extend(c.p.postdata, f); var l; c.p.searchurl && (l = c.p.url, a(c).jqgrid("setgridparam", { url: c.p.searchurl })); var n =
"stop" === a(c).triggerhandler("jqgridtoolbarbeforeclear") ? !0 : !1; !n && a.isfunction(b.beforeclear) && (n = b.beforeclear.call(c)); n || d && a(c).jqgrid("setgridparam", { search: k }).trigger("reloadgrid", [{ page: 1 }]); l && a(c).jqgrid("setgridparam", { url: l }); a(c).triggerhandler("jqgridtoolbarafterclear"); a.isfunction(b.afterclear) && b.afterclear()
}; this.toggletoolbar = function () {
var b = a("tr.ui-search-toolbar", c.grid.hdiv), d = !0 === c.p.frozencolumns ? a("tr.ui-search-toolbar", c.grid.fhdiv) : !1; "none" === b.css("display") ? (b.show(),
d && d.show()) : (b.hide(), d && d.hide())
}
}
})
}, destroyfiltertoolbar: function () { return this.each(function () { this.ftoolbar && (this.toggletoolbar = this.cleartoolbar = this.triggertoolbar = null, this.ftoolbar = !1, a(this.grid.hdiv).find("table thead tr.ui-search-toolbar").remove()) }) }, destroygroupheader: function (b) {
void 0 === b && (b = !0); return this.each(function () {
var c, d, h, k, e, s; d = this.grid; var f = a("table.ui-jqgrid-htable thead", d.hdiv), g = this.p.colmodel; if (d) {
a(this).unbind(".setgroupheaders"); c = a("
", { role: "rowheader" }).addclass("ui-jqgrid-labels");
k = d.headers; d = 0; for (h = k.length; d < h; d++) { e = g[d].hidden ? "none" : ""; e = a(k[d].el).width(k[d].width).css("display", e); try { e.removeattr("rowspan") } catch (m) { e.attr("rowspan", 1) } c.append(e); s = e.children("span.ui-jqgrid-resize"); 0 < s.length && (s[0].style.height = ""); e.children("div")[0].style.top = "" } a(f).children("tr.ui-jqgrid-labels").remove(); a(f).prepend(c); !0 === b && a(this).jqgrid("setgridparam", { groupheader: null })
}
})
}, setgroupheaders: function (b) {
b = a.extend({ usecolspanstyle: !1, groupheaders: [] }, b || {}); return this.each(function () {
this.p.groupheader =
b; var c, d, h = 0, k, e, s, f, g, m = this.p.colmodel, x = m.length, q = this.grid.headers, p = a("table.ui-jqgrid-htable", this.grid.hdiv), l = p.children("thead").children("tr.ui-jqgrid-labels:last").addclass("jqg-second-row-header"); k = p.children("thead"); var n = p.find(".jqg-first-row-header"); void 0 === n[0] ? n = a("
", { role: "row", "aria-hidden": "true" }).addclass("jqg-first-row-header").css("height", "auto") : n.empty(); var r, w = function (a, b) { var c = b.length, d; for (d = 0; d < c; d++) if (b[d].startcolumnname === a) return d; return -1 }; a(this).prepend(k);
k = a("
", { role: "rowheader" }).addclass("ui-jqgrid-labels jqg-third-row-header"); for (c = 0; c < x; c++) if (s = q[c].el, f = a(s), d = m[c], e = { height: "0px", width: q[c].width + "px", display: d.hidden ? "none" : "" }, a("
", { role: "gridcell" }).css(e).addclass("ui-first-th-" + this.p.direction).appendto(n), s.style.width = "", e = w(d.name, b.groupheaders), 0 <= e) {
e = b.groupheaders[e]; h = e.numberofcolumns; g = e.titletext; for (e = d = 0; e < h && c + e < x; e++) m[c + e].hidden || d++; e = a("
"; return !1
}
}); a += r
} return a
} var e = this, f = e.p.groupingview, h = "", p = "", r, q, n = f.groupcollapse ? f.plusicon : f.minusicon, t, y = [], z = f.groupfield.length, n = n + (" tree-wrap-" + e.p.direction); d.each(e.p.colmodel, function (a, b) {
var c; for (c = 0; c < z; c++) if (f.groupfield[c] === b.name) {
y[c] =
a; break
}
}); var x = 0, a = d.makearray(f.groupsummary); a.reverse(); d.each(f.groups, function (g, l) {
if (f._locgr && !(l.startrow + l.cnt > (a - 1) * c && l.startrow < a * c)) return !0; x++; q = e.p.id + "ghead_" + l.idx; r = q + "_" + g; p = ""; try {
d.isarray(f.formatdisplayfield) && d.isfunction(f.formatdisplayfield[l.idx]) ? (l.displayvalue = f.formatdisplayfield[l.idx].call(e, l.displayvalue, l.value,
e.p.colmodel[y[l.idx]], l.idx, f), t = l.displayvalue) : t = e.formatter(r, l.displayvalue, y[l.idx], l.value)
} catch (c) { t = l.displayvalue } "header" === f.groupsummarypos[l.idx] ? (h += '
' + p + d.jgrid.template(f.grouptext[l.idx], t, l.cnt, l.summary) + "
", h += m(g, l.idx - 1, f.groups, 1), h += "
") : h += '
' + p + d.jgrid.template(f.grouptext[l.idx], t, l.cnt, l.summary) + "
"; if (z - 1 === l.idx) {
var s = f.groups[g + 1], v, u = 0; v = l.startrow; var b = void 0 !== s ? f.groups[g + 1].startrow : b.length; f._locgr && (u = (a - 1) * c, u > l.startrow && (v = u)); for (; v < b && b[v - u]; v++) h += b[v - u].join(""); if ("header" !== f.groupsummarypos[l.idx]) {
var w; if (void 0 !== s) {
for (w = 0; w <
f.groupfield.length && s.dataindex !== f.groupfield[w]; w++); x = f.groupfield.length - w
} for (s = 0; s < x; s++) a[s] && (u = "", f.groupcollapse && !f.showsummaryonhide && (u = ' style="display:none;"'), h += "
', h += m(g, s, f.groups, 0), h += "
"); x = w
}
}
}); d("#" + d.jgrid.jqid(e.p.id) + " tbody:first").append(h); h = null
})
}, groupinggroupby: function (b, k) {
return this.each(function () {
"string" === typeof b && (b = [b]); var a = this.p.groupingview;
this.p.grouping = !0; void 0 === a.visibiltyonnextgrouping && (a.visibiltyonnextgrouping = []); var c; for (c = 0; c < a.groupfield.length; c++) !a.groupcolumnshow[c] && a.visibiltyonnextgrouping[c] && d(this).jqgrid("showcol", a.groupfield[c]); for (c = 0; c < b.length; c++) a.visibiltyonnextgrouping[c] = d("#" + d.jgrid.jqid(this.p.id) + "_" + d.jgrid.jqid(b[c])).is(":visible"); this.p.groupingview = d.extend(this.p.groupingview, k || {}); a.groupfield = b; d(this).trigger("reloadgrid")
})
}, groupingremove: function (b) {
return this.each(function () {
void 0 ===
b && (b = !0); this.p.grouping = !1; if (!0 === b) { var k = this.p.groupingview, a; for (a = 0; a < k.groupfield.length; a++) !k.groupcolumnshow[a] && k.visibiltyonnextgrouping[a] && d(this).jqgrid("showcol", k.groupfield); d("tr.jqgroup, tr.jqfoot", "#" + d.jgrid.jqid(this.p.id) + " tbody:first").remove(); d("tr.jqgrow:hidden", "#" + d.jgrid.jqid(this.p.id) + " tbody:first").show() } else d(this).trigger("reloadgrid")
})
}, groupingcalculations: {
handler: function (b, d, a, c, g, m) {
var e = {
sum: function () { return parsefloat(d || 0) + parsefloat(m[a] || 0) },
min: function () { return "" === d ? parsefloat(m[a] || 0) : math.min(parsefloat(d), parsefloat(m[a] || 0)) }, max: function () { return "" === d ? parsefloat(m[a] || 0) : math.max(parsefloat(d), parsefloat(m[a] || 0)) }, count: function () { "" === d && (d = 0); return m.hasownproperty(a) ? d + 1 : 0 }, avg: function () { return e.sum() }
}; if (!e[b]) throw "jqgrid grouping no such method: " + b; b = e[b](); null != c && ("fixed" === g ? b = b.tofixed(c) : (c = math.pow(10, c), b = math.round(b * c) / c)); return b
}
}
})
})(jquery);
(function (d) {
d.jgrid.extend({
settreenode: function (b, c) {
return this.each(function () {
var a = this; if (a.grid && a.p.treegrid) for (var h = a.p.expcolind, e = a.p.treereader.expanded_field, k = a.p.treereader.leaf_field, g = a.p.treereader.level_field, f = a.p.treereader.icon_field, n = a.p.treereader.loaded, m, p, q, l; b < c;) l = d.jgrid.strippref(a.p.idprefix, a.rows[b].id), l = a.p.data[a.p._index[l]], "nested" !== a.p.treegridmodel || l[k] || (m = parseint(l[a.p.treereader.left_field], 10), p = parseint(l[a.p.treereader.right_field], 10), l[k] = p ===
m + 1 ? "true" : "false", a.rows[b].cells[a.p._treeleafpos].innerhtml = l[k]), m = parseint(l[g], 10), 0 === a.p.tree_root_level ? (q = m + 1, p = m) : (q = m, p = m - 1), q = "
", q += "
", d(a.rows[b].cells[h]).wrapinner("").prepend(q), m !== parseint(a.p.tree_root_level, 10) && ((l = (l = d(a).jqgrid("getnodeparent", l)) && l.hasownproperty(e) ? l[e] : !0) || d(a.rows[b]).css("display", "none")), d(a.rows[b].cells[h]).find("div.treeclick").bind("click", function (b) {
b =
d.jgrid.strippref(a.p.idprefix, d(b.target || b.srcelement, a.rows).closest("tr.jqgrow")[0].id); b = a.p._index[b]; a.p.data[b][k] || (a.p.data[b][e] ? (d(a).jqgrid("collapserow", a.p.data[b]), d(a).jqgrid("collapsenode", a.p.data[b])) : (d(a).jqgrid("expandrow", a.p.data[b]), d(a).jqgrid("expandnode", a.p.data[b]))); return !1
}), !0 === a.p.expandcolclick && d(a.rows[b].cells[h]).find("span.cell-wrapper").css("cursor", "pointer").bind("click", function (b) {
b = d.jgrid.strippref(a.p.idprefix, d(b.target || b.srcelement, a.rows).closest("tr.jqgrow")[0].id);
var c = a.p._index[b]; a.p.data[c][k] || (a.p.data[c][e] ? (d(a).jqgrid("collapserow", a.p.data[c]), d(a).jqgrid("collapsenode", a.p.data[c])) : (d(a).jqgrid("expandrow", a.p.data[c]), d(a).jqgrid("expandnode", a.p.data[c]))); d(a).jqgrid("setselection", b); return !1
}), b++
})
}, settreegrid: function () {
return this.each(function () {
var b = this, c = 0, a, h = !1, e, k, g = []; if (b.p.treegrid) {
b.p.treedatatype || d.extend(b.p, { treedatatype: b.p.datatype }); b.p.subgrid = !1; b.p.altrows = !1; b.p.pgbuttons = !1; b.p.pginput = !1; b.p.gridview = !0; null ===
b.p.rowtotal && (b.p.rownum = 1e4); b.p.multiselect = !1; b.p.rowlist = []; b.p.expcolind = 0; a = "ui-icon-triangle-1-" + ("rtl" === b.p.direction ? "w" : "e"); b.p.treeicons = d.extend({ plus: a, minus: "ui-icon-triangle-1-s", leaf: "ui-icon-radio-off" }, b.p.treeicons || {}); "nested" === b.p.treegridmodel ? b.p.treereader = d.extend({ level_field: "level", left_field: "lft", right_field: "rgt", leaf_field: "isleaf", expanded_field: "expanded", loaded: "loaded", icon_field: "icon" }, b.p.treereader) : "adjacency" === b.p.treegridmodel && (b.p.treereader = d.extend({
level_field: "level",
parent_id_field: "parent", leaf_field: "isleaf", expanded_field: "expanded", loaded: "loaded", icon_field: "icon"
}, b.p.treereader)); for (e in b.p.colmodel) if (b.p.colmodel.hasownproperty(e)) for (k in a = b.p.colmodel[e].name, a !== b.p.expandcolumn || h || (h = !0, b.p.expcolind = c), c++, b.p.treereader) b.p.treereader.hasownproperty(k) && b.p.treereader[k] === a && g.push(a); d.each(b.p.treereader, function (a, e) {
e && -1 === d.inarray(e, g) && ("leaf_field" === a && (b.p._treeleafpos = c), c++, b.p.colnames.push(e), b.p.colmodel.push({
name: e, width: 1,
hidden: !0, sortable: !1, resizable: !1, hidedlg: !0, editable: !0, search: !1
}))
})
}
})
}, expandrow: function (b) { this.each(function () { var c = this; if (c.grid && c.p.treegrid) { var a = d(c).jqgrid("getnodechildren", b), h = c.p.treereader.expanded_field; d(a).each(function () { var a = c.p.idprefix + d.jgrid.getaccessor(this, c.p.localreader.id); d(d(c).jqgrid("getgridrowbyid", a)).css("display", ""); this[h] && d(c).jqgrid("expandrow", this) }) } }) }, collapserow: function (b) {
this.each(function () {
var c = this; if (c.grid && c.p.treegrid) {
var a = d(c).jqgrid("getnodechildren",
b), h = c.p.treereader.expanded_field; d(a).each(function () { var a = c.p.idprefix + d.jgrid.getaccessor(this, c.p.localreader.id); d(d(c).jqgrid("getgridrowbyid", a)).css("display", "none"); this[h] && d(c).jqgrid("collapserow", this) })
}
})
}, getrootnodes: function () {
var b = []; this.each(function () {
var c = this; if (c.grid && c.p.treegrid) switch (c.p.treegridmodel) {
case "nested": var a = c.p.treereader.level_field; d(c.p.data).each(function () { parseint(this[a], 10) === parseint(c.p.tree_root_level, 10) && b.push(this) }); break; case "adjacency": var h =
c.p.treereader.parent_id_field; d(c.p.data).each(function () { null !== this[h] && "null" !== string(this[h]).tolowercase() || b.push(this) })
}
}); return b
}, getnodedepth: function (b) { var c = null; this.each(function () { if (this.grid && this.p.treegrid) switch (this.p.treegridmodel) { case "nested": c = parseint(b[this.p.treereader.level_field], 10) - parseint(this.p.tree_root_level, 10); break; case "adjacency": c = d(this).jqgrid("getnodeancestors", b).length } }); return c }, getnodeparent: function (b) {
var c = null; this.each(function () {
var a =
this; if (a.grid && a.p.treegrid) switch (a.p.treegridmodel) {
case "nested": var h = a.p.treereader.left_field, e = a.p.treereader.right_field, k = a.p.treereader.level_field, g = parseint(b[h], 10), f = parseint(b[e], 10), n = parseint(b[k], 10); d(this.p.data).each(function () { if (parseint(this[k], 10) === n - 1 && parseint(this[h], 10) < g && parseint(this[e], 10) > f) return c = this, !1 }); break; case "adjacency": var m = a.p.treereader.parent_id_field, p = a.p.localreader.id; d(this.p.data).each(function () {
if (this[p] === d.jgrid.strippref(a.p.idprefix,
b[m])) return c = this, !1
})
}
}); return c
}, getnodechildren: function (b) {
var c = []; this.each(function () {
var a = this; if (a.grid && a.p.treegrid) switch (a.p.treegridmodel) {
case "nested": var h = a.p.treereader.left_field, e = a.p.treereader.right_field, k = a.p.treereader.level_field, g = parseint(b[h], 10), f = parseint(b[e], 10), n = parseint(b[k], 10); d(this.p.data).each(function () { parseint(this[k], 10) === n + 1 && parseint(this[h], 10) > g && parseint(this[e], 10) < f && c.push(this) }); break; case "adjacency": var m = a.p.treereader.parent_id_field,
p = a.p.localreader.id; d(this.p.data).each(function () { this[m] == d.jgrid.strippref(a.p.idprefix, b[p]) && c.push(this) })
}
}); return c
}, getfulltreenode: function (b) {
var c = []; this.each(function () {
var a = this, h; if (a.grid && a.p.treegrid) switch (a.p.treegridmodel) {
case "nested": var e = a.p.treereader.left_field, k = a.p.treereader.right_field, g = a.p.treereader.level_field, f = parseint(b[e], 10), n = parseint(b[k], 10), m = parseint(b[g], 10); d(this.p.data).each(function () {
parseint(this[g], 10) >= m && parseint(this[e], 10) >= f && parseint(this[e],
10) <= n && c.push(this)
}); break; case "adjacency": if (b) { c.push(b); var p = a.p.treereader.parent_id_field, q = a.p.localreader.id; d(this.p.data).each(function (b) { h = c.length; for (b = 0; b < h; b++) if (d.jgrid.strippref(a.p.idprefix, c[b][q]) === this[p]) { c.push(this); break } }) }
}
}); return c
}, getnodeancestors: function (b) { var c = []; this.each(function () { if (this.grid && this.p.treegrid) for (var a = d(this).jqgrid("getnodeparent", b) ; a;) c.push(a), a = d(this).jqgrid("getnodeparent", a) }); return c }, isvisiblenode: function (b) {
var c = !0; this.each(function () {
if (this.grid &&
this.p.treegrid) { var a = d(this).jqgrid("getnodeancestors", b), h = this.p.treereader.expanded_field; d(a).each(function () { c = c && this[h]; if (!c) return !1 }) }
}); return c
}, isnodeloaded: function (b) { var c; this.each(function () { if (this.grid && this.p.treegrid) { var a = this.p.treereader.leaf_field, h = this.p.treereader.loaded; c = void 0 !== b ? void 0 !== b[h] ? b[h] : b[a] || 0 < d(this).jqgrid("getnodechildren", b).length ? !0 : !1 : !1 } }); return c }, expandnode: function (b) {
return this.each(function () {
if (this.grid && this.p.treegrid) {
var c = this.p.treereader.expanded_field,
a = this.p.treereader.parent_id_field, h = this.p.treereader.loaded, e = this.p.treereader.level_field, k = this.p.treereader.left_field, g = this.p.treereader.right_field; if (!b[c]) {
var f = d.jgrid.getaccessor(b, this.p.localreader.id), n = d("#" + this.p.idprefix + d.jgrid.jqid(f), this.grid.bdiv)[0], m = this.p._index[f]; d(this).jqgrid("isnodeloaded", this.p.data[m]) ? (b[c] = !0, d("div.treeclick", n).removeclass(this.p.treeicons.plus + " tree-plus").addclass(this.p.treeicons.minus + " tree-minus")) : this.grid.hdiv.loading || (b[c] = !0,
d("div.treeclick", n).removeclass(this.p.treeicons.plus + " tree-plus").addclass(this.p.treeicons.minus + " tree-minus"), this.p.treeanode = n.rowindex, this.p.datatype = this.p.treedatatype, "nested" === this.p.treegridmodel ? d(this).jqgrid("setgridparam", { postdata: { nodeid: f, n_left: b[k], n_right: b[g], n_level: b[e] } }) : d(this).jqgrid("setgridparam", { postdata: { nodeid: f, parentid: b[a], n_level: b[e] } }), d(this).trigger("reloadgrid"), b[h] = !0, "nested" === this.p.treegridmodel ? d(this).jqgrid("setgridparam", {
postdata: {
nodeid: "",
n_left: "", n_right: "", n_level: ""
}
}) : d(this).jqgrid("setgridparam", { postdata: { nodeid: "", parentid: "", n_level: "" } }))
}
}
})
}, collapsenode: function (b) { return this.each(function () { if (this.grid && this.p.treegrid) { var c = this.p.treereader.expanded_field; b[c] && (b[c] = !1, c = d.jgrid.getaccessor(b, this.p.localreader.id), c = d("#" + this.p.idprefix + d.jgrid.jqid(c), this.grid.bdiv)[0], d("div.treeclick", c).removeclass(this.p.treeicons.minus + " tree-minus").addclass(this.p.treeicons.plus + " tree-plus")) } }) }, sorttree: function (b,
c, a, h) { return this.each(function () { if (this.grid && this.p.treegrid) { var e, k, g, f = [], n = this, m; e = d(this).jqgrid("getrootnodes"); e = d.jgrid.from(e); e.orderby(b, c, a, h); m = e.select(); e = 0; for (k = m.length; e < k; e++) g = m[e], f.push(g), d(this).jqgrid("collectchildrensorttree", f, g, b, c, a, h); d.each(f, function (a) { var b = d.jgrid.getaccessor(this, n.p.localreader.id); d("#" + d.jgrid.jqid(n.p.id) + " tbody tr:eq(" + a + ")").after(d("tr#" + d.jgrid.jqid(b), n.grid.bdiv)) }); f = m = e = null } }) }, collectchildrensorttree: function (b, c, a, h, e, k) {
return this.each(function () {
if (this.grid &&
this.p.treegrid) { var g, f, n, m; g = d(this).jqgrid("getnodechildren", c); g = d.jgrid.from(g); g.orderby(a, h, e, k); m = g.select(); g = 0; for (f = m.length; g < f; g++) n = m[g], b.push(n), d(this).jqgrid("collectchildrensorttree", b, n, a, h, e, k) }
})
}, settreerow: function (b, c) { var a = !1; this.each(function () { this.grid && this.p.treegrid && (a = d(this).jqgrid("setrowdata", b, c)) }); return a }, deltreenode: function (b) {
return this.each(function () {
var c = this.p.localreader.id, a, h = this.p.treereader.left_field, e = this.p.treereader.right_field, k, g, f;
if (this.grid && this.p.treegrid && (a = this.p._index[b], void 0 !== a)) {
k = parseint(this.p.data[a][e], 10); g = k - parseint(this.p.data[a][h], 10) + 1; var n = d(this).jqgrid("getfulltreenode", this.p.data[a]); if (0 < n.length) for (a = 0; a < n.length; a++) d(this).jqgrid("delrowdata", n[a][c]); if ("nested" === this.p.treegridmodel) {
c = d.jgrid.from(this.p.data).greater(h, k, { stype: "integer" }).select(); if (c.length) for (f in c) c.hasownproperty(f) && (c[f][h] = parseint(c[f][h], 10) - g); c = d.jgrid.from(this.p.data).greater(e, k, { stype: "integer" }).select();
if (c.length) for (f in c) c.hasownproperty(f) && (c[f][e] = parseint(c[f][e], 10) - g)
}
}
})
}, addchildnode: function (b, c, a, h) {
var e = this[0]; if (a) {
var k = e.p.treereader.expanded_field, g = e.p.treereader.leaf_field, f = e.p.treereader.level_field, n = e.p.treereader.parent_id_field, m = e.p.treereader.left_field, p = e.p.treereader.right_field, q = e.p.treereader.loaded, l, u, t, w, s; l = 0; var v = c, x; void 0 === h && (h = !1); if (void 0 === b || null === b) {
s = e.p.data.length - 1; if (0 <= s) for (; 0 <= s;) l = math.max(l, parseint(e.p.data[s][e.p.localreader.id],
10)), s--; b = l + 1
} var y = d(e).jqgrid("getind", c); x = !1; void 0 === c || null === c || "" === c ? (v = c = null, l = "last", w = e.p.tree_root_level, s = e.p.data.length + 1) : (l = "after", u = e.p._index[c], t = e.p.data[u], c = t[e.p.localreader.id], w = parseint(t[f], 10) + 1, s = d(e).jqgrid("getfulltreenode", t), s.length ? (v = s = s[s.length - 1][e.p.localreader.id], s = d(e).jqgrid("getind", v) + 1) : s = d(e).jqgrid("getind", c) + 1, t[g] && (x = !0, t[k] = !0, d(e.rows[y]).find("span.cell-wrapperleaf").removeclass("cell-wrapperleaf").addclass("cell-wrapper").end().find("div.tree-leaf").removeclass(e.p.treeicons.leaf +
" tree-leaf").addclass(e.p.treeicons.minus + " tree-minus"), e.p.data[u][g] = !1, t[q] = !0)); u = s + 1; void 0 === a[k] && (a[k] = !1); void 0 === a[q] && (a[q] = !1); a[f] = w; void 0 === a[g] && (a[g] = !0); "adjacency" === e.p.treegridmodel && (a[n] = c); if ("nested" === e.p.treegridmodel) {
var r; if (null !== c) {
g = parseint(t[p], 10); f = d.jgrid.from(e.p.data); f = f.greaterorequals(p, g, { stype: "integer" }); f = f.select(); if (f.length) for (r in f) f.hasownproperty(r) && (f[r][m] = f[r][m] > g ? parseint(f[r][m], 10) + 2 : f[r][m], f[r][p] = f[r][p] >= g ? parseint(f[r][p], 10) +
2 : f[r][p]); a[m] = g; a[p] = g + 1
} else { g = parseint(d(e).jqgrid("getcol", p, !1, "max"), 10); f = d.jgrid.from(e.p.data).greater(m, g, { stype: "integer" }).select(); if (f.length) for (r in f) f.hasownproperty(r) && (f[r][m] = parseint(f[r][m], 10) + 2); f = d.jgrid.from(e.p.data).greater(p, g, { stype: "integer" }).select(); if (f.length) for (r in f) f.hasownproperty(r) && (f[r][p] = parseint(f[r][p], 10) + 2); a[m] = g + 1; a[p] = g + 2 }
} if (null === c || d(e).jqgrid("isnodeloaded", t) || x) d(e).jqgrid("addrowdata", b, a, l, v), d(e).jqgrid("settreenode", s, u); t && !t[k] &&
h && d(e.rows[y]).find("div.treeclick").click()
}
}
})
})(jquery);
(function (d) {
function i(d, n) { var h, e, v = [], r; if (!this || "function" !== typeof d || d instanceof regexp) throw new typeerror; r = this.length; for (h = 0; h < r; h++) if (this.hasownproperty(h) && (e = this[h], d.call(n, e, h, this))) { v.push(e); break } return v } d.assocarraysize = function (d) { var n = 0, h; for (h in d) d.hasownproperty(h) && n++; return n }; d.jgrid.extend({
pivotsetup: function (q, n) {
var h = [], e = [], v = [], r = [], b = { grouping: !0, groupingview: { groupfield: [], groupsummary: [], groupsummarypos: [] } }, f = [], c = d.extend({
rowtotals: !1, rowtotalstext: "total",
coltotals: !1, groupsummary: !0, groupsummarypos: "header", frozenstaticcols: !1
}, n || {}); this.each(function () {
function n(c, c, a) { c = i.call(c, c, a); return 0 < c.length ? c[0] : null } function j(c, a) { var d = 0, f = !0, h; for (h in c) { if (c[h] != this[d]) { f = !1; break } d++; if (d >= this.length) break } f && (d = a); return f } function e(c, a, f, h) {
var g = a.length, b, k, e, l; l = d.isarray(f) ? f.length : 1; r = []; for (e = r.root = 0; e < l; e++) {
var n = [], m; for (b = 0; b < g; b++) {
if (null == f) m = k = d.trim(a[b].member) + "_" + a[b].aggregator; else {
m = f[e].replace(/\s+/g, ""); try {
k =
1 === g ? m : m + "_" + a[b].aggregator + "_" + b
} catch (v) { }
} var t = h, u = k, x = n, y = k, w = h[k], p = a[b].member, q = c, s = void 0; switch (a[b].aggregator) { case "sum": s = parsefloat(w || 0) + parsefloat(q[p] || 0); break; case "count": if ("" === w || null == w) w = 0; s = q.hasownproperty(p) ? w + 1 : 0; break; case "min": s = "" === w || null == w ? parsefloat(q[p] || 0) : math.min(parsefloat(w), parsefloat(q[p] || 0)); break; case "max": s = "" === w || null == w ? parsefloat(q[p] || 0) : math.max(parsefloat(w), parsefloat(q[p] || 0)) } t[u] = x[y] = s
} r[m] = n
} return h
} function h(a) {
var d, b, g, k, e; for (g in a) if (a.hasownproperty(g)) {
if ("object" !==
typeof a[g] && ("level" === g && (void 0 === f[a.level] && (f[a.level] = "", 0 < a.level && "_r_totals" !== a.text && (f[a.level - 1] = { usecolspanstyle: !1, groupheaders: [] })), f[a.level] !== a.text && a.children.length && "_r_totals" !== a.text && 0 < a.level && (f[a.level - 1].groupheaders.push({ titletext: a.text }), b = f[a.level - 1].groupheaders.length, e = 1 === b ? k : g + (b - 1) * z, f[a.level - 1].groupheaders[b - 1].startcolumnname = h[e].name, f[a.level - 1].groupheaders[b - 1].numberofcolumns = h.length - e, g = h.length), f[a.level] = a.text), a.level === l && "level" === g &&
0 < l)) if (1 < z) { b = 1; for (d in a.fields) 1 === b && f[l - 1].groupheaders.push({ startcolumnname: d, numberofcolumns: 1, titletext: a.text }), b++; f[l - 1].groupheaders[f[l - 1].groupheaders.length - 1].numberofcolumns = b - 1 } else f.splice(l - 1, 1); null != a[g] && "object" === typeof a[g] && h(a[g]); if ("level" === g && 0 < a.level) for (d in b = 0, a.fields) {
e = {}; for (k in c.aggregates[b]) if (c.aggregates[b].hasownproperty(k)) switch (k) { case "member": case "label": case "aggregator": break; default: e[k] = c.aggregates[b][k] } 1 < z ? (e.name = d, e.label = c.aggregates[b].label ||
d) : (e.name = a.text, e.label = "_r_totals" === a.text ? c.rowtotalstext : a.text); h.push(e); b++
}
}
} var m, d, a, y = q.length, s, l, z, k, p = 0; c.rowtotals && 0 < c.ydimension.length && (c.ydimension.splice(0, 0, { dataname: c.ydimension[0].dataname }), c.ydimension[0].converter = function () { return "_r_totals" }); s = d.isarray(c.xdimension) ? c.xdimension.length : 0; l = c.ydimension.length; z = d.isarray(c.aggregates) ? c.aggregates.length : 0; if (0 === s || 0 === z) throw "xdimension or aggregates optiona are not set!"; var x; for (a = 0; a < s; a++) x = {
name: c.xdimension[a].dataname,
frozen: c.frozenstaticcols
}, x = d.extend(!0, x, c.xdimension[a]), h.push(x); x = s - 1; for (var a = {}; p < y;) {
m = q[p]; var t = [], u = []; k = {}; a = 0; do t[a] = d.trim(m[c.xdimension[a].dataname]), k[c.xdimension[a].dataname] = t[a], a++; while (a < s); var g = 0; d = -1; a = n(e, j, t); if (!a) {
g = 0; if (1 <= l) { for (g = 0; g < l; g++) u[g] = d.trim(m[c.ydimension[g].dataname]), c.ydimension[g].converter && d.isfunction(c.ydimension[g].converter) && (u[g] = c.ydimension[g].converter.call(this, u[g], t, u)); k = e(m, c.aggregates, u, k) } else 0 === l && (k = e(m, c.aggregates, null, k));
e.push(k)
} else if (0 <= d) { g = 0; if (1 <= l) { for (g = 0; g < l; g++) u[g] = d.trim(m[c.ydimension[g].dataname]), c.ydimension[g].converter && d.isfunction(c.ydimension[g].converter) && (u[g] = c.ydimension[g].converter.call(this, u[g], t, u)); a = e(m, c.aggregates, u, a) } else 0 === l && (a = e(m, c.aggregates, null, a)); e[d] = a } m = 0; var t = k = null, b; for (b in r) {
if (0 === m) a.children && void 0 !== a.children || (a = { text: b, level: 0, children: [] }), k = a.children; else {
t = null; for (a = 0; a < k.length; a++) if (k[a].text === b) { t = k[a]; break } t ? k = t.children : (k.push({
children: [],
text: b, level: m, fields: r[b]
}), k = k[k.length - 1].children)
} m++
} p++
} var f = [], g = h.length, k = g; 0 < l && (f[l - 1] = { usecolspanstyle: !1, groupheaders: [] }); h(a, 0); if (c.coltotals) for (p = e.length; p--;) for (a = s; a < h.length; a++) y = h[a].name, v[y] = v[y] ? v[y] + parsefloat(e[p][y] || 0) : parsefloat(e[p][y] || 0); if (0 < x) for (a = 0; a < x; a++) b.groupingview.groupfield[a] = h[a].name, b.groupingview.groupsummary[a] = c.groupsummary, b.groupingview.groupsummarypos[a] = c.groupsummarypos; else b.grouping = !1; b.sortname = h[x].name; b.groupingview.hidefirstgroupcol =
!0
}); return { colmodel: h, rows: e, groupoptions: b, groupheaders: f, summary: v }
}, jqpivot: function (q, n, h, e) {
return this.each(function () {
function v(b) {
var f = jquery(r).jqgrid("pivotsetup", b, n), c = 0 < d.assocarraysize(f.summary) ? !0 : !1, e = d.jgrid.from(f.rows); for (b = 0; b < f.groupoptions.groupingview.groupfield.length; b++) e.orderby(f.groupoptions.groupingview.groupfield[b], "a", "text", ""); jquery(r).jqgrid(d.extend({
datastr: d.extend(e.select(), c ? { userdata: f.summary } : {}), datatype: "jsonstring", footerrow: c, userdataonfooter: c,
colmodel: f.colmodel, viewrecords: !0, sortname: n.xdimension[0].dataname
}, h || {}, f.groupoptions)); f = f.groupheaders; if (f.length) for (b = 0; b < f.length; b++) f[b] && f[b].groupheaders.length && jquery(r).jqgrid("setgroupheaders", f[b]); n.frozenstaticcols && jquery(r).jqgrid("setfrozencolumns")
} var r = this; "string" === typeof q ? d.ajax(d.extend({ url: q, datatype: "json", success: function (b) { v(d.jgrid.getaccessor(b, e && e.reader ? e.reader : "rows")) } }, e || {})) : v(q)
})
}
})
})(jquery);
(function (c) {
c.jgrid.extend({
jqgridimport: function (a) {
a = c.extend({ imptype: "xml", impstring: "", impurl: "", mtype: "get", impdata: {}, xmlgrid: { config: "roots>grid", data: "roots>rows" }, jsongrid: { config: "grid", data: "data" }, ajaxoptions: {} }, a || {}); return this.each(function () {
var d = this, f = function (a, b) {
var e = c(b.xmlgrid.config, a)[0], h = c(b.xmlgrid.data, a)[0], f, g; if (xmljsonclass.xml2json && c.jgrid.parse) {
e = xmljsonclass.xml2json(e, " "); e = c.jgrid.parse(e); for (g in e) e.hasownproperty(g) && (f = e[g]); h ? (h = e.grid.datatype,
e.grid.datatype = "xmlstring", e.grid.datastr = a, c(d).jqgrid(f).jqgrid("setgridparam", { datatype: h })) : c(d).jqgrid(f)
} else alert("xml2json or parse are not present")
}, b = function (a, b) { if (a && "string" === typeof a) { var e = !1; c.jgrid.usejson && (c.jgrid.usejson = !1, e = !0); var f = c.jgrid.parse(a); e && (c.jgrid.usejson = !0); e = f[b.jsongrid.config]; if (f = f[b.jsongrid.data]) { var g = e.datatype; e.datatype = "jsonstring"; e.datastr = f; c(d).jqgrid(e).jqgrid("setgridparam", { datatype: g }) } else c(d).jqgrid(e) } }; switch (a.imptype) {
case "xml": c.ajax(c.extend({
url: a.impurl,
type: a.mtype, data: a.impdata, datatype: "xml", complete: function (b, g) { "success" === g && (f(b.responsexml, a), c(d).triggerhandler("jqgridimportcomplete", [b, a]), c.isfunction(a.importcomplete) && a.importcomplete(b)) }
}, a.ajaxoptions)); break; case "xmlstring": if (a.impstring && "string" === typeof a.impstring) { var g = c.parsexml(a.impstring); g && (f(g, a), c(d).triggerhandler("jqgridimportcomplete", [g, a]), c.isfunction(a.importcomplete) && a.importcomplete(g), a.impstring = null); g = null } break; case "json": c.ajax(c.extend({
url: a.impurl,
type: a.mtype, data: a.impdata, datatype: "json", complete: function (f) { try { b(f.responsetext, a), c(d).triggerhandler("jqgridimportcomplete", [f, a]), c.isfunction(a.importcomplete) && a.importcomplete(f) } catch (g) { } }
}, a.ajaxoptions)); break; case "jsonstring": a.impstring && "string" === typeof a.impstring && (b(a.impstring, a), c(d).triggerhandler("jqgridimportcomplete", [a.impstring, a]), c.isfunction(a.importcomplete) && a.importcomplete(a.impstring), a.impstring = null)
}
})
}, jqgridexport: function (a) {
a = c.extend({
exptype: "xmlstring",
root: "grid", ident: "\t"
}, a || {}); var d = null; this.each(function () {
if (this.grid) {
var f, b = c.extend(!0, {}, c(this).jqgrid("getgridparam")); b.rownumbers && (b.colnames.splice(0, 1), b.colmodel.splice(0, 1)); b.multiselect && (b.colnames.splice(0, 1), b.colmodel.splice(0, 1)); b.subgrid && (b.colnames.splice(0, 1), b.colmodel.splice(0, 1)); b.knv = null; if (b.treegrid) for (f in b.treereader) b.treereader.hasownproperty(f) && (b.colnames.splice(b.colnames.length - 1), b.colmodel.splice(b.colmodel.length - 1)); switch (a.exptype) {
case "xmlstring": d =
"<" + a.root + ">" + xmljsonclass.json2xml(b, a.ident) + "" + a.root + ">"; break; case "jsonstring": d = "{" + xmljsonclass.tojson(b, a.root, a.ident, !1) + "}", void 0 !== b.postdata.filters && (d = d.replace(/filters":"/, 'filters":'), d = d.replace(/}]}"/, "}]}"))
}
}
}); return d
}, excelexport: function (a) {
a = c.extend({ exptype: "remote", url: null, oper: "oper", tag: "excel", exportoptions: {} }, a || {}); return this.each(function () {
if (this.grid) {
var d; "remote" === a.exptype && (d = c.extend({}, this.p.postdata), d[a.oper] = a.tag, d = jquery.param(d), d = -1 !==
a.url.indexof("?") ? a.url + "&" + d : a.url + "?" + d, window.location = d)
}
})
}
})
})(jquery);
var xmljsonclass = {
xml2json: function (a, b) { 9 === a.nodetype && (a = a.documentelement); var g = this.removewhite(a), g = this.toobj(g), g = this.tojson(g, a.nodename, "\t"); return "{\n" + b + (b ? g.replace(/\t/g, b) : g.replace(/\t|\n/g, "")) + "\n}" }, json2xml: function (a, b) {
var g = function (a, b, e) {
var d = "", f, k; if (a instanceof array) if (0 === a.length) d += e + "<" + b + ">__empty_array_" + b + ">\n"; else for (f = 0, k = a.length; f < k; f += 1) var n = e + g(a[f], b, e + "\t") + "\n", d = d + n; else if ("object" === typeof a) {
f = !1; d += e + "<" + b; for (k in a) a.hasownproperty(k) &&
("@" === k.charat(0) ? d += " " + k.substr(1) + '="' + a[k].tostring() + '"' : f = !0); d += f ? ">" : "/>"; if (f) { for (k in a) a.hasownproperty(k) && ("#text" === k ? d += a[k] : "#cdata" === k ? d += "" }
} else "function" === typeof a ? d += e + "<" + b + ">" : (void 0 === a && (a = ""), d = '""' === a.tostring() || 0 === a.tostring().length ? d + (e + "<" + b + ">__empty_string_" + b + ">") : d + (e + "<" + b + ">" + a.tostring() + "" + b + ">")); return d
},
f = "", e; for (e in a) a.hasownproperty(e) && (f += g(a[e], e, "")); return b ? f.replace(/\t/g, b) : f.replace(/\t|\n/g, "")
}, toobj: function (a) {
var b = {}, g = /function/i; if (1 === a.nodetype) {
if (a.attributes.length) { var f; for (f = 0; f < a.attributes.length; f += 1) b["@" + a.attributes[f].nodename] = (a.attributes[f].nodevalue || "").tostring() } if (a.firstchild) {
var e = f = 0, h = !1, c; for (c = a.firstchild; c; c = c.nextsibling) 1 === c.nodetype ? h = !0 : 3 === c.nodetype && c.nodevalue.match(/[^ \f\n\r\t\v]/) ? f += 1 : 4 === c.nodetype && (e += 1); if (h) if (2 > f && 2 > e) for (this.removewhite(a),
c = a.firstchild; c; c = c.nextsibling) 3 === c.nodetype ? b["#text"] = this.escape(c.nodevalue) : 4 === c.nodetype ? g.test(c.nodevalue) ? b[c.nodename] = [b[c.nodename], c.nodevalue] : b["#cdata"] = this.escape(c.nodevalue) : b[c.nodename] ? b[c.nodename] instanceof array ? b[c.nodename][b[c.nodename].length] = this.toobj(c) : b[c.nodename] = [b[c.nodename], this.toobj(c)] : b[c.nodename] = this.toobj(c); else a.attributes.length ? b["#text"] = this.escape(this.innerxml(a)) : b = this.escape(this.innerxml(a)); else if (f) a.attributes.length ? b["#text"] =
this.escape(this.innerxml(a)) : (b = this.escape(this.innerxml(a)), "__empty_array_" === b ? b = "[]" : "__empty_string_" === b && (b = "")); else if (e) if (1 < e) b = this.escape(this.innerxml(a)); else for (c = a.firstchild; c; c = c.nextsibling) if (g.test(a.firstchild.nodevalue)) { b = a.firstchild.nodevalue; break } else b["#cdata"] = this.escape(c.nodevalue)
} a.attributes.length || a.firstchild || (b = null)
} else 9 === a.nodetype ? b = this.toobj(a.documentelement) : alert("unhandled node type: " + a.nodetype); return b
}, tojson: function (a, b, g, f) {
void 0 ===
f && (f = !0); var e = b ? '"' + b + '"' : "", h = "\t", c = "\n"; f || (c = h = ""); if ("[]" === a) e += b ? ":[]" : "[]"; else if (a instanceof array) { var l, d, m = []; d = 0; for (l = a.length; d < l; d += 1) m[d] = this.tojson(a[d], "", g + h, f); e += (b ? ":[" : "[") + (1 < m.length ? c + g + h + m.join("," + c + g + h) + c + g : m.join("")) + "]" } else if (null === a) e += (b && ":") + "null"; else if ("object" === typeof a) { l = []; for (d in a) a.hasownproperty(d) && (l[l.length] = this.tojson(a[d], d, g + h, f)); e += (b ? ":{" : "{") + (1 < l.length ? c + g + h + l.join("," + c + g + h) + c + g : l.join("")) + "}" } else e = "string" === typeof a ? e +
((b && ":") + '"' + a.replace(/\\/g, "\\\\").replace(/\"/g, '\\"') + '"') : e + ((b && ":") + a.tostring()); return e
}, innerxml: function (a) {
var b = ""; if ("innerhtml" in a) b = a.innerhtml; else {
var g = function (a) {
var b = "", h; if (1 === a.nodetype) { b += "<" + a.nodename; for (h = 0; h < a.attributes.length; h += 1) b += " " + a.attributes[h].nodename + '="' + (a.attributes[h].nodevalue || "").tostring() + '"'; if (a.firstchild) { b += ">"; for (h = a.firstchild; h; h = h.nextsibling) b += g(h); b += "" + a.nodename + ">" } else b += "/>" } else 3 === a.nodetype ? b += a.nodevalue : 4 === a.nodetype &&
(b += " tr", jquery(this)).each(function () { var b = {}, a = 0; jquery("td", jquery(this)).each(function () { if (0 === a && k) { var c = jquery("input", jquery(this)), e = c.attr("value"); g.push(e || f.length); c.is(":checked") && h.push(e); b[d[a].name] = c.attr("value") } else b[d[a].name] = jquery(this).html(); a++ }); 0 < a && f.push(b) });
jquery(this).empty(); jquery(this).addclass("scroll"); jquery(this).jqgrid(jquery.extend({ datatype: "local", width: b, colnames: e, colmodel: d, multiselect: c }, m || {})); for (b = 0; b < f.length; b++) a = null, 0 < g.length && (a = g[b]) && a.replace && (a = encodeuricomponent(a).replace(/[.\-%]/g, "_")), null === a && (a = b + 1), jquery(this).jqgrid("addrowdata", a, f[b]); for (b = 0; b < h.length; b++) jquery(this).jqgrid("setselection", h[b])
}
})
};
(function (b) {
b.jgrid.msie && 8 === b.jgrid.msiever() && (b.expr[":"].hidden = function (b) { return 0 === b.offsetwidth || 0 === b.offsetheight || "none" === b.style.display }); b.jgrid._multiselect = !1; if (b.ui && b.ui.multiselect) {
if (b.ui.multiselect.prototype._setselected) { var r = b.ui.multiselect.prototype._setselected; b.ui.multiselect.prototype._setselected = function (a, d) { var c = r.call(this, a, d); if (d && this.selectedlist) { var e = this.element; this.selectedlist.find("li").each(function () { b(this).data("optionlink") && b(this).data("optionlink").remove().appendto(e) }) } return c } } b.ui.multiselect.prototype.destroy &&
(b.ui.multiselect.prototype.destroy = function () { this.element.show(); this.container.remove(); void 0 === b.widget ? b.widget.prototype.destroy.apply(this, arguments) : b.widget.prototype.destroy.apply(this, arguments) }); b.jgrid._multiselect = !0
} b.jgrid.extend({
sortablecolumns: function (a) {
return this.each(function () {
function d() { c.p.disableclick = !0 } var c = this, e = b.jgrid.jqid(c.p.id), e = {
tolerance: "pointer", axis: "x", scrollsensitivity: "1", items: ">th:not(:has(#jqgh_" + e + "_cb,#jqgh_" + e + "_rn,#jqgh_" + e + "_subgrid),:hidden)",
placeholder: { element: function (a) { return b(document.createelement(a[0].nodename)).addclass(a[0].classname + " ui-sortable-placeholder ui-state-highlight").removeclass("ui-sortable-helper")[0] }, update: function (b, a) { a.height(b.currentitem.innerheight() - parseint(b.currentitem.css("paddingtop") || 0, 10) - parseint(b.currentitem.css("paddingbottom") || 0, 10)); a.width(b.currentitem.innerwidth() - parseint(b.currentitem.css("paddingleft") || 0, 10) - parseint(b.currentitem.css("paddingright") || 0, 10)) } }, update: function (a,
e) { var d = b(e.item).parent(), d = b(">th", d), f = {}, g = c.p.id + "_"; b.each(c.p.colmodel, function (b) { f[this.name] = b }); var l = []; d.each(function () { var a = b(">div", this).get(0).id.replace(/^jqgh_/, "").replace(g, ""); f.hasownproperty(a) && l.push(f[a]) }); b(c).jqgrid("remapcolumns", l, !0, !0); b.isfunction(c.p.sortable.update) && c.p.sortable.update(l); settimeout(function () { c.p.disableclick = !1 }, 50) }
}; c.p.sortable.options ? b.extend(e, c.p.sortable.options) : b.isfunction(c.p.sortable) && (c.p.sortable = { update: c.p.sortable }); if (e.start) {
var g =
e.start; e.start = function (b, a) { d(); g.call(this, b, a) }
} else e.start = d; c.p.sortable.exclude && (e.items += ":not(" + c.p.sortable.exclude + ")"); a.sortable(e).data("sortable").floating = !0
})
}, columnchooser: function (a) {
function d(a, c) { a && ("string" === typeof a ? b.fn[a] && b.fn[a].apply(c, b.makearray(arguments).slice(2)) : b.isfunction(a) && a.apply(c, b.makearray(arguments).slice(2))) } var c = this; if (!b("#colchooser_" + b.jgrid.jqid(c[0].p.id)).length) {
var e = b('
'),
g = b("select", e); a = b.extend({
width: 420, height: 240, classname: null, done: function (b) { b && c.jqgrid("remapcolumns", b, !0) }, msel: "multiselect", dlog: "dialog", dialog_opts: { minwidth: 470 }, dlog_opts: function (a) { var c = {}; c[a.bsubmit] = function () { a.apply_perm(); a.cleanup(!1) }; c[a.bcancel] = function () { a.cleanup(!0) }; return b.extend(!0, { buttons: c, close: function () { a.cleanup(!0) }, modal: a.modal || !1, resizable: a.resizable || !0, width: a.width + 20 }, a.dialog_opts || {}) }, apply_perm: function () {
b("option", g).each(function () {
this.selected ?
c.jqgrid("showcol", k[this.value].name) : c.jqgrid("hidecol", k[this.value].name)
}); var e = []; b("option:selected", g).each(function () { e.push(parseint(this.value, 10)) }); b.each(e, function () { delete p[k[parseint(this, 10)].name] }); b.each(p, function () { var b = parseint(this, 10); var a = e, c = b; if (0 <= c) { var d = a.slice(), k = d.splice(c, math.max(a.length - c, c)); c > a.length && (c = a.length); d[c] = b; e = d.concat(k) } else e = void 0 }); a.done && a.done.call(c, e)
}, cleanup: function (b) {
d(a.dlog, e, "destroy"); d(a.msel, g, "destroy"); e.remove();
b && a.done && a.done.call(c)
}, msel_opts: {}
}, b.jgrid.col, a || {}); if (b.ui && b.ui.multiselect && "multiselect" === a.msel) { if (!b.jgrid._multiselect) { alert("multiselect plugin loaded after jqgrid. please load the plugin before the jqgrid!"); return } a.msel_opts = b.extend(b.ui.multiselect.defaults, a.msel_opts) } a.caption && e.attr("title", a.caption); a.classname && (e.addclass(a.classname), g.addclass(a.classname)); a.width && (b(">div", e).css({ width: a.width, margin: "0 auto" }), g.css("width", a.width)); a.height && (b(">div", e).css("height",
a.height), g.css("height", a.height - 10)); var k = c.jqgrid("getgridparam", "colmodel"), t = c.jqgrid("getgridparam", "colnames"), p = {}, f = []; g.empty(); b.each(k, function (a) { p[this.name] = a; this.hidedlg ? this.hidden || f.push(a) : g.append("") }); var q = b.isfunction(a.dlog_opts) ? a.dlog_opts.call(c, a) : a.dlog_opts; d(a.dlog, e, q); q = b.isfunction(a.msel_opts) ? a.msel_opts.call(c, a) : a.msel_opts; d(a.msel, g, q)
}
}, sortablerows: function (a) {
return this.each(function () {
var d =
this; d.grid && !d.p.treegrid && b.fn.sortable && (a = b.extend({ cursor: "move", axis: "y", items: ".jqgrow" }, a || {}), a.start && b.isfunction(a.start) ? (a._start_ = a.start, delete a.start) : a._start_ = !1, a.update && b.isfunction(a.update) ? (a._update_ = a.update, delete a.update) : a._update_ = !1, a.start = function (c, e) {
b(e.item).css("border-width", "0"); b("td", e.item).each(function (b) { this.style.width = d.grid.cols[b].style.width }); if (d.p.subgrid) { var g = b(e.item).attr("id"); try { b(d).jqgrid("collapsesubgridrow", g) } catch (k) { } } a._start_ &&
a._start_.apply(this, [c, e])
}, a.update = function (c, e) { b(e.item).css("border-width", ""); !0 === d.p.rownumbers && b("td.jqgrid-rownum", d.rows).each(function (a) { b(this).html(a + 1 + (parseint(d.p.page, 10) - 1) * parseint(d.p.rownum, 10)) }); a._update_ && a._update_.apply(this, [c, e]) }, b("tbody:first", d).sortable(a), b("tbody:first", d).disableselection())
})
}, griddnd: function (a) {
return this.each(function () {
function d() {
var a = b.data(c, "dnd"); b("tr.jqgrow:not(.ui-draggable)", c).draggable(b.isfunction(a.drag) ? a.drag.call(b(c),
a) : a.drag)
} var c = this, e, g; if (c.grid && !c.p.treegrid && b.fn.draggable && b.fn.droppable) if (void 0 === b("#jqgrid_dnd")[0] && b("body").append("
"), "string" === typeof a && "updatednd" === a && !0 === c.p.jqgdnd) d(); else if (a = b.extend({
drag: function (a) {
return b.extend({
start: function (e, d) {
var f; if (c.p.subgrid) { f = b(d.helper).attr("id"); try { b(c).jqgrid("collapsesubgridrow", f) } catch (g) { } } for (f = 0; f < b.data(c, "dnd").connectwith.length; f++) 0 === b(b.data(c, "dnd").connectwith[f]).jqgrid("getgridparam",
"reccount") && b(b.data(c, "dnd").connectwith[f]).jqgrid("addrowdata", "jqg_empty_row", {}); d.helper.addclass("ui-state-highlight"); b("td", d.helper).each(function (b) { this.style.width = c.grid.headers[b].width + "px" }); a.onstart && b.isfunction(a.onstart) && a.onstart.call(b(c), e, d)
}, stop: function (e, d) {
var f; d.helper.dropped && !a.dragcopy && (f = b(d.helper).attr("id"), void 0 === f && (f = b(this).attr("id")), b(c).jqgrid("delrowdata", f)); for (f = 0; f < b.data(c, "dnd").connectwith.length; f++) b(b.data(c, "dnd").connectwith[f]).jqgrid("delrowdata",
"jqg_empty_row"); a.onstop && b.isfunction(a.onstop) && a.onstop.call(b(c), e, d)
}
}, a.drag_opts || {})
}, drop: function (a) {
return b.extend({
accept: function (a) { if (!b(a).hasclass("jqgrow")) return a; a = b(a).closest("table.ui-jqgrid-btable"); return 0 < a.length && void 0 !== b.data(a[0], "dnd") ? (a = b.data(a[0], "dnd").connectwith, -1 !== b.inarray("#" + b.jgrid.jqid(this.id), a) ? !0 : !1) : !1 }, drop: function (e, d) {
if (b(d.draggable).hasclass("jqgrow")) {
var f = b(d.draggable).attr("id"), f = d.draggable.parent().parent().jqgrid("getrowdata",
f); if (!a.dropbyname) { var g = 0, l = {}, h, n, s = b("#" + b.jgrid.jqid(this.id)).jqgrid("getgridparam", "colmodel"); try { for (n in f) f.hasownproperty(n) && (h = s[g].name, "cb" !== h && "rn" !== h && "subgrid" !== h && f.hasownproperty(n) && s[g] && (l[h] = f[n]), g++); f = l } catch (r) { } } d.helper.dropped = !0; a.beforedrop && b.isfunction(a.beforedrop) && (h = a.beforedrop.call(this, e, d, f, b("#" + b.jgrid.jqid(c.p.id)), b(this)), void 0 !== h && null !== h && "object" === typeof h && (f = h)); if (d.helper.dropped) {
var m; a.autoid && (b.isfunction(a.autoid) ? m = a.autoid.call(this,
f) : (m = math.ceil(1e3 * math.random()), m = a.autoidprefix + m)); b("#" + b.jgrid.jqid(this.id)).jqgrid("addrowdata", m, f, a.droppos)
} a.ondrop && b.isfunction(a.ondrop) && a.ondrop.call(this, e, d, f)
}
}
}, a.drop_opts || {})
}, onstart: null, onstop: null, beforedrop: null, ondrop: null, drop_opts: { activeclass: "ui-state-active", hoverclass: "ui-state-hover" }, drag_opts: { revert: "invalid", helper: "clone", cursor: "move", appendto: "#jqgrid_dnd", zindex: 5e3 }, dragcopy: !1, dropbyname: !1, droppos: "first", autoid: !0, autoidprefix: "dnd_"
}, a || {}), a.connectwith) for (a.connectwith =
a.connectwith.split(","), a.connectwith = b.map(a.connectwith, function (a) { return b.trim(a) }), b.data(c, "dnd", a), 0 === c.p.reccount || c.p.jqgdnd || d(), c.p.jqgdnd = !0, e = 0; e < a.connectwith.length; e++) g = a.connectwith[e], b(g).droppable(b.isfunction(a.drop) ? a.drop.call(b(c), a) : a.drop)
})
}, gridresize: function (a) {
return this.each(function () {
var d = this, c = b.jgrid.jqid(d.p.id); d.grid && b.fn.resizable && (a = b.extend({}, a || {}), a.alsoresize ? (a._alsoresize_ = a.alsoresize, delete a.alsoresize) : a._alsoresize_ = !1, a.stop && b.isfunction(a.stop) ?
(a._stop_ = a.stop, delete a.stop) : a._stop_ = !1, a.stop = function (e, g) { b(d).jqgrid("setgridparam", { height: b("#gview_" + c + " .ui-jqgrid-bdiv").height() }); b(d).jqgrid("setgridwidth", g.size.width, a.shrinktofit); a._stop_ && a._stop_.call(d, e, g) }, a.alsoresize = a._alsoresize_ ? eval("(" + ("{'#gview_" + c + " .ui-jqgrid-bdiv':true,'" + a._alsoresize_ + "':true}") + ")") : b(".ui-jqgrid-bdiv", "#gview_" + c), delete a._alsoresize_, b("#gbox_" + c).resizable(a))
})
}
})
})(jquery);
; (function ($) {
/**
* jqgrid chinese translation
* 咖啡兔 yanhonglei@gmail.com
* http://www.kafeitu.me
* dual licensed under the mit and gpl licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = $.jgrid || {};
$.extend($.jgrid, {
defaults: {
recordtext: "{0} - {1}\u3000共 {2} 条", // 共字前是全角空格
emptyrecords: "无数据显示",
loadtext: "读取中...",
pgtext: " {0} 共 {1} 页"
},
search: {
caption: "搜索...",
find: "查找",
reset: "重置",
odata: [{ oper: 'eq', text: '等于\u3000\u3000' }, { oper: 'ne', text: '不等\u3000\u3000' }, { oper: 'lt', text: '小于\u3000\u3000' }, { oper: 'le', text: '小于等于' }, { oper: 'gt', text: '大于\u3000\u3000' }, { oper: 'ge', text: '大于等于' }, { oper: 'bw', text: '开始于' }, { oper: 'bn', text: '不开始于' }, { oper: 'in', text: '属于\u3000\u3000' }, { oper: 'ni', text: '不属于' }, { oper: 'ew', text: '结束于' }, { oper: 'en', text: '不结束于' }, { oper: 'cn', text: '包含\u3000\u3000' }, { oper: 'nc', text: '不包含' }, { oper: 'nu', text: '不存在' }, { oper: 'nn', text: '存在' }],
groupops: [{ op: "and", text: "所有" }, { op: "or", text: "任一" }],
operandtitle: "click to select search operation.",
resettitle: "reset search value"
},
edit: {
addcaption: "添加记录",
editcaption: "编辑记录",
bsubmit: "提交",
bcancel: "取消",
bclose: "关闭",
savedata: "数据已改变,是否保存?",
byes: "是",
bno: "否",
bexit: "取消",
msg: {
required: "此字段必需",
number: "请输入有效数字",
minvalue: "输值必须大于等于 ",
maxvalue: "输值必须小于等于 ",
email: "这不是有效的e-mail地址",
integer: "请输入有效整数",
date: "请输入有效时间",
url: "无效网址。前缀必须为 ('http://' 或 'https://')",
nodefined: " 未定义!",
novalue: " 需要返回值!",
customarray: "自定义函数需要返回数组!",
customfcheck: "必须有自定义函数!"
}
},
view: {
caption: "查看记录",
bclose: "关闭"
},
del: {
caption: "删除",
msg: "删除所选记录?",
bsubmit: "删除",
bcancel: "取消"
},
nav: {
edittext: "",
edittitle: "编辑所选记录",
addtext: "",
addtitle: "添加新记录",
deltext: "",
deltitle: "删除所选记录",
searchtext: "",
searchtitle: "查找",
refreshtext: "",
refreshtitle: "刷新表格",
alertcap: "注意",
alerttext: "请选择记录",
viewtext: "",
viewtitle: "查看所选记录"
},
col: {
caption: "选择列",
bsubmit: "确定",
bcancel: "取消"
},
errors: {
errcap: "错误",
nourl: "没有设置url",
norecords: "没有要处理的记录",
model: "colnames 和 colmodel 长度不等!"
},
formatter: {
integer: { thousandsseparator: ",", defaultvalue: '0' },
number: { decimalseparator: ".", thousandsseparator: ",", decimalplaces: 2, defaultvalue: '0.00' },
currency: { decimalseparator: ".", thousandsseparator: ",", decimalplaces: 2, prefix: "", suffix: "", defaultvalue: '0.00' },
date: {
daynames: [
"日", "一", "二", "三", "四", "五", "六",
"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六",
],
monthnames: [
"一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二",
"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
],
ampm: ["am", "pm", "上午", "下午"],
s: function (j) { return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][math.min((j - 1) % 10, 3)] : 'th'; },
srcformat: 'y-m-d',
newformat: 'y-m-d',
parsere: /[#%\\\/:_;.,\t\s-]/,
masks: {
// see http://php.net/manual/en/function.date.php for php format used in jqgrid
// and see http://docs.jquery.com/ui/datepicker/formatdate
// and https://github.com/jquery/globalize#dates for alternative formats used frequently
// one can find on https://github.com/jquery/globalize/tree/master/lib/cultures many
// information about date, time, numbers and currency formats used in different countries
// one should just convert the information in php format
iso8601long: "y-m-d h:i:s",
iso8601short: "y-m-d",
// short date:
// n - numeric representation of a month, without leading zeros
// j - day of the month without leading zeros
// y - a full numeric representation of a year, 4 digits
// example: 3/1/2012 which means 1 march 2012
shortdate: "n/j/y", // in jquery ui datepicker: "m/d/yyyy"
// long date:
// l - a full textual representation of the day of the week
// f - a full textual representation of a month
// d - day of the month, 2 digits with leading zeros
// y - a full numeric representation of a year, 4 digits
longdate: "l, f d, y", // in jquery ui datepicker: "dddd, mmmm dd, yyyy"
// long date with long time:
// l - a full textual representation of the day of the week
// f - a full textual representation of a month
// d - day of the month, 2 digits with leading zeros
// y - a full numeric representation of a year, 4 digits
// g - 12-hour format of an hour without leading zeros
// i - minutes with leading zeros
// s - seconds, with leading zeros
// a - uppercase ante meridiem and post meridiem (am or pm)
fulldatetime: "l, f d, y g:i:s a", // in jquery ui datepicker: "dddd, mmmm dd, yyyy h:mm:ss tt"
// month day:
// f - a full textual representation of a month
// d - day of the month, 2 digits with leading zeros
monthday: "f d", // in jquery ui datepicker: "mmmm dd"
// short time (without seconds)
// g - 12-hour format of an hour without leading zeros
// i - minutes with leading zeros
// a - uppercase ante meridiem and post meridiem (am or pm)
shorttime: "g:i a", // in jquery ui datepicker: "h:mm tt"
// long time (with seconds)
// g - 12-hour format of an hour without leading zeros
// i - minutes with leading zeros
// s - seconds, with leading zeros
// a - uppercase ante meridiem and post meridiem (am or pm)
longtime: "g:i:s a", // in jquery ui datepicker: "h:mm:ss tt"
sortabledatetime: "y-m-d\\th:i:s",
universalsortabledatetime: "y-m-d h:i:so",
// month with year
// y - a full numeric representation of a year, 4 digits
// f - a full textual representation of a month
yearmonth: "f, y" // in jquery ui datepicker: "mmmm, yyyy"
},
reformatafteredit: false
},
baselinkurl: '',
showaction: '',
target: '',
checkbox: { disabled: true },
idname: 'id'
}
});
})(jquery);