/* * 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 = ""; k += "" } "rtl" === f && (g += k); !0 === a.p.pginput && (d = "" + b.jgrid.format(a.p.pgtext || "", "", "") + ""); !0 === a.p.pgbuttons ? (m = ["first" + e, "prev" + e, "next" + e, "last" + e], "rtl" === f && m.reverse(), g += "", g += "", g = g + ("" !== d ? "" + d + "" : "") + (""), g += "") : "" !== d && (g += d); "ltr" === f && (g += k); g += ""; !0 === a.p.viewrecords && b("td#" + c + "_" + a.p.recordpos, "#" + l).append("
"); b("td#" + c + "_" + a.p.pagerpos, "#" + l).append(g); k = b(".ui-jqgrid").css("font-size") || "11px"; b(document.body).append(""); g = b(g).clone().appendto("#testpg").width(); b("#testpg").remove(); 0 < g && ("" !== d && (g += 50), b("td#" + c + "_" + a.p.pagerpos, "#" + l).width(g)); a.p._nvtd = []; a.p._nvtd[0] = g ? math.floor((a.p.width - g) / 2) : math.floor(a.p.width / 3); a.p._nvtd[1] = 0; g = null; b(".ui-pg-selbox", "#" + l).bind("change", function () { if (!q("records")) return !1; a.p.page = math.round(a.p.rownum * (a.p.page - 1) / this.value - 0.5) + 1; a.p.rownum = this.value; a.p.pager && b(".ui-pg-selbox", a.p.pager).val(this.value); a.p.toppager && b(".ui-pg-selbox", a.p.toppager).val(this.value); q(); return !1 }); !0 === a.p.pgbuttons && (b(".ui-pg-button", "#" + l).hover(function () { b(this).hasclass("ui-state-disabled") ? this.style.cursor = "default" : (b(this).addclass("ui-state-hover"), this.style.cursor = "pointer") }, function () { b(this).hasclass("ui-state-disabled") || (b(this).removeclass("ui-state-hover"), this.style.cursor = "default") }), b("#first" + b.jgrid.jqid(e) + ", #prev" + b.jgrid.jqid(e) + ", #next" + b.jgrid.jqid(e) + ", #last" + b.jgrid.jqid(e)).click(function () { if (b(this).hasclass("ui-state-disabled")) return !1; var c = r(a.p.page, 1), d = r(a.p.lastpage, 1), g = !1, f = !0, h = !0, k = !0, l = !0; 0 === d || 1 === d ? l = k = h = f = !1 : 1 < d && 1 <= c ? 1 === c ? h = f = !1 : c === d && (l = k = !1) : 1 < d && 0 === c && (l = k = !1, c = d - 1); if (!q(this.id)) return !1; this.id === "first" + e && f && (a.p.page = 1, g = !0); this.id === "prev" + e && h && (a.p.page = c - 1, g = !0); this.id === "next" + e && k && (a.p.page = c + 1, g = !0); this.id === "last" + e && l && (a.p.page = d, g = !0); g && q(); return !1 })); !0 === a.p.pginput && b("input.ui-pg-input", "#" + l).keypress(function (c) { if (13 === (c.charcode || c.keycode || 0)) { if (!q("user")) return !1; b(this).val(r(b(this).val(), 1)); a.p.page = 0 < b(this).val() ? b(this).val() : a.p.page; q(); return !1 } return this }) }, wa = function (c, e) { var d, g = "", f = a.p.colmodel, h = !1, k; k = a.p.frozencolumns ? e : a.grid.headers[c].el; var l = ""; b("span.ui-grid-ico-sort", k).addclass("ui-state-disabled"); b(k).attr("aria-selected", "false"); if (f[c].lso) if ("asc" === f[c].lso) f[c].lso += "-desc", l = "desc"; else if ("desc" === f[c].lso) f[c].lso += "-asc", l = "asc"; else { if ("asc-desc" === f[c].lso || "desc-asc" === f[c].lso) f[c].lso = "" } else f[c].lso = l = f[c].firstsortorder || "asc"; l ? (b("span.s-ico", k).show(), b("span.ui-icon-" + l, k).removeclass("ui-state-disabled"), b(k).attr("aria-selected", "true")) : a.p.viewsortcols[0] || b("span.s-ico", k).hide(); a.p.sortorder = ""; b.each(f, function (b) { this.lso && (0 < b && h && (g += ", "), d = this.lso.split("-"), g += f[b].index || f[b].name, g += " " + d[d.length - 1], h = !0, a.p.sortorder = d[d.length - 1]) }); k = g.lastindexof(a.p.sortorder); g = g.substring(0, k); a.p.sortname = g }, ra = function (c, d, e, g, f) { if (a.p.colmodel[d].sortable && !(0 < a.p.savedrow.length)) { e || (a.p.lastsort === d ? "asc" === a.p.sortorder ? a.p.sortorder = "desc" : "desc" === a.p.sortorder && (a.p.sortorder = "asc") : a.p.sortorder = a.p.colmodel[d].firstsortorder || "asc", a.p.page = 1); if (a.p.multisort) wa(d, f); else { if (g) { if (a.p.lastsort === d && a.p.sortorder === g && !e) return; a.p.sortorder = g } e = a.grid.headers[a.p.lastsort].el; f = a.p.frozencolumns ? f : a.grid.headers[d].el; b("span.ui-grid-ico-sort", e).addclass("ui-state-disabled"); b(e).attr("aria-selected", "false"); a.p.frozencolumns && (a.grid.fhdiv.find("span.ui-grid-ico-sort").addclass("ui-state-disabled"), a.grid.fhdiv.find("th").attr("aria-selected", "false")); b("span.ui-icon-" + a.p.sortorder, f).removeclass("ui-state-disabled"); b(f).attr("aria-selected", "true"); a.p.viewsortcols[0] || a.p.lastsort === d || (a.p.frozencolumns && a.grid.fhdiv.find("span.s-ico").hide(), b("span.s-ico", e).hide(), b("span.s-ico", f).show()); c = c.substring(5 + a.p.id.length + 1); a.p.sortname = a.p.colmodel[d].index || c } "stop" === b(a).triggerhandler("jqgridsortcol", [a.p.sortname, d, a.p.sortorder]) ? a.p.lastsort = d : b.isfunction(a.p.onsortcol) && "stop" === a.p.onsortcol.call(a, a.p.sortname, d, a.p.sortorder) ? a.p.lastsort = d : ("local" === a.p.datatype ? a.p.deselectaftersort && b(a).jqgrid("resetselection") : (a.p.selrow = null, a.p.multiselect && ha(!1), a.p.selarrrow = [], a.p.savedrow = []), a.p.scroll && (f = a.grid.bdiv.scrollleft, x.call(a, !0, !1), a.grid.hdiv.scrollleft = f), a.p.subgrid && "local" === a.p.datatype && b("td.sgexpanded", "#" + b.jgrid.jqid(a.p.id)).each(function () { b(this).trigger("click") }), q(), a.p.lastsort = d, a.p.sortname !== c && d && (a.p.lastsort = d)) } }, xa = function (c) { c = b(a.grid.headers[c].el); c = [c.position().left + c.outerwidth()]; "rtl" === a.p.direction && (c[0] = a.p.width - c[0]); c[0] -= a.grid.bdiv.scrollleft; c.push(b(a.grid.hdiv).position().top); c.push(b(a.grid.bdiv).offset().top - b(a.grid.hdiv).offset().top + b(a.grid.bdiv).height()); return c }, sa = function (c) { var d, e = a.grid.headers, g = b.jgrid.getcellindex(c); for (d = 0; d < e.length; d++) if (c === e[d].el) { g = d; break } return g }; this.p.id = this.id; -1 === b.inarray(a.p.multikey, ["shiftkey", "altkey", "ctrlkey"]) && (a.p.multikey = !1); a.p.keyindex = !1; a.p.keyname = !1; for (g = 0; g < a.p.colmodel.length; g++) a.p.colmodel[g] = b.extend(!0, {}, a.p.cmtemplate, a.p.colmodel[g].template || {}, a.p.colmodel[g]), !1 === a.p.keyindex && !0 === a.p.colmodel[g].key && (a.p.keyindex = g); a.p.sortorder = a.p.sortorder.tolowercase(); b.jgrid.cell_width = b.jgrid.cellwidth(); !0 === a.p.grouping && (a.p.scroll = !1, a.p.rownumbers = !1, a.p.treegrid = !1, a.p.gridview = !0); if (!0 === this.p.treegrid) { try { b(this).jqgrid("settreegrid") } catch (za) { } "local" !== a.p.datatype && (a.p.localreader = { id: "_id_" }) } if (this.p.subgrid) try { b(a).jqgrid("setsubgrid") } catch (aa) { } this.p.multiselect && (this.p.colnames.unshift(""), this.p.colmodel.unshift({ name: "cb", width: b.jgrid.cell_width ? a.p.multiselectwidth + a.p.celllayout : a.p.multiselectwidth, sortable: !1, resizable: !1, hidedlg: !0, search: !1, align: "center", fixed: !0 })); this.p.rownumbers && (this.p.colnames.unshift(""), this.p.colmodel.unshift({ name: "rn", width: a.p.rownumwidth, sortable: !1, resizable: !1, hidedlg: !0, search: !1, align: "center", fixed: !0 })); a.p.xmlreader = b.extend(!0, { root: "rows", row: "row", page: "rows>page", total: "rows>total", records: "rows>records", repeatitems: !0, cell: "cell", id: "[id]", userdata: "userdata", subgrid: { root: "rows", row: "row", repeatitems: !0, cell: "cell" } }, a.p.xmlreader); a.p.jsonreader = b.extend(!0, { root: "rows", page: "page", total: "total", records: "records", repeatitems: !0, cell: "cell", id: "id", userdata: "userdata", subgrid: { root: "rows", repeatitems: !0, cell: "cell" } }, a.p.jsonreader); a.p.localreader = b.extend(!0, { root: "rows", page: "page", total: "total", records: "records", repeatitems: !1, cell: "cell", id: "id", userdata: "userdata", subgrid: { root: "rows", repeatitems: !0, cell: "cell" } }, a.p.localreader); a.p.scroll && (a.p.pgbuttons = !1, a.p.pginput = !1, a.p.rowlist = []); a.p.data.length && o(); var d = "", ta, f, ja, fa, ka, y, t, ba, ua = ba = "", ga = [], va = []; f = []; if (!0 === a.p.shrinktofit && !0 === a.p.forcefit) for (g = a.p.colmodel.length - 1; 0 <= g; g--) if (!a.p.colmodel[g].hidden) { a.p.colmodel[g].resizable = !1; break } "horizontal" === a.p.viewsortcols[1] && (ba = " ui-i-asc", ua = " ui-i-desc"); ta = n ? "class='ui-th-div-ie'" : ""; ba = ""); if (a.p.multisort) for (ga = a.p.sortname.split(","), g = 0; g < ga.length; g++) f = b.trim(ga[g]).split(" "), ga[g] = b.trim(f[0]), va[g] = f[1] ? b.trim(f[1]) : a.p.sortorder || "asc"; for (g = 0; g < this.p.colnames.length; g++) f = a.p.headertitles ? ' title="' + b.jgrid.striphtml(a.p.colnames[g]) + '"' : "", d += "", f = a.p.colmodel[g].index || a.p.colmodel[g].name, d += "
" + a.p.colnames[g], a.p.colmodel[g].width = a.p.colmodel[g].width ? parseint(a.p.colmodel[g].width, 10) : 150, "boolean" !== typeof a.p.colmodel[g].title && (a.p.colmodel[g].title = !0), a.p.colmodel[g].lso = "", f === a.p.sortname && (a.p.lastsort = g), a.p.multisort && (f = b.inarray(f, ga), -1 !== f && (a.p.colmodel[g].lso = va[f])), d += ba + "
"; d += ""; 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 = '"; 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("").attr({ role: "columnheader" }).addclass("ui-state-default ui-th-column-header ui-th-" + this.p.direction).css({ height: "22px", "border-top": "0 none" }).html(g); 0 < d && e.attr("colspan", string(d)); this.p.headertitles && e.attr("title", e.text()); 0 === d && e.hide(); f.before(e); k.append(s); h -= 1 } else 0 === h ? b.usecolspanstyle ? f.attr("rowspan", "2") : (a("", { role: "columnheader" }).addclass("ui-state-default ui-th-column-header ui-th-" + this.p.direction).css({ display: d.hidden ? "none" : "", "border-top": "0 none" }).insertbefore(f), k.append(s)) : (k.append(s), h--); m = a(this).children("thead"); m.prepend(n); k.insertafter(l); p.append(m); b.usecolspanstyle && (p.find("span.ui-jqgrid-resize").each(function () { var b = a(this).parent(); b.is(":visible") && (this.style.csstext = "height: " + b.height() + "px !important; cursor: col-resize;") }), p.find("div.ui-jqgrid-sortable").each(function () { var b = a(this), c = b.parent(); c.is(":visible") && c.is(":has(span.ui-jqgrid-resize)") && b.css("top", (c.height() - b.outerheight()) / 2 + "px") })); r = m.find("tr.jqg-first-row-header"); a(this).bind("jqgridresizestop.setgroupheaders", function (a, b, c) { r.find("th").eq(c).width(b) }) }) }, setfrozencolumns: function () { return this.each(function () { if (this.grid) { var b = this, c = b.p.colmodel, d = 0, h = c.length, k = -1, e = !1; if (!0 !== b.p.subgrid && !0 !== b.p.treegrid && !0 !== b.p.celledit && !b.p.sortable && !b.p.scroll) { b.p.rownumbers && d++; for (b.p.multiselect && d++; d < h;) { if (!0 === c[d].frozen) e = !0, k = d; else break; d++ } if (0 <= k && e) { c = b.p.caption ? a(b.grid.cdiv).outerheight() : 0; d = a(".ui-jqgrid-htable", "#gview_" + a.jgrid.jqid(b.p.id)).height(); b.p.toppager && (c += a(b.grid.topdiv).outerheight()); !0 === b.p.toolbar[0] && "bottom" !== b.p.toolbar[1] && (c += a(b.grid.udiv).outerheight()); b.grid.fhdiv = a('
'); b.grid.fbdiv = a('
'); a("#gview_" + a.jgrid.jqid(b.p.id)).append(b.grid.fhdiv); c = a(".ui-jqgrid-htable", "#gview_" + a.jgrid.jqid(b.p.id)).clone(!0); if (b.p.groupheader) { a("tr.jqg-first-row-header, tr.jqg-third-row-header", c).each(function () { a("th:gt(" + k + ")", this).remove() }); var s = -1, f = -1, g, m; a("tr.jqg-second-row-header th", c).each(function () { g = parseint(a(this).attr("colspan"), 10); if (m = parseint(a(this).attr("rowspan"), 10)) s++, f++; g && (s += g, f++); if (s === k) return !1 }); s !== k && (f = k); a("tr.jqg-second-row-header", c).each(function () { a("th:gt(" + f + ")", this).remove() }) } else a("tr", c).each(function () { a("th:gt(" + k + ")", this).remove() }); a(c).width(1); a(b.grid.fhdiv).append(c).mousemove(function (a) { if (b.grid.resizing) return b.grid.dragmove(a), !1 }); a(b).bind("jqgridresizestop.setfrozencolumns", function (c, d, e) { c = a(".ui-jqgrid-htable", b.grid.fhdiv); a("th:eq(" + e + ")", c).width(d); c = a(".ui-jqgrid-btable", b.grid.fbdiv); a("tr:first td:eq(" + e + ")", c).width(d) }); a(b).bind("jqgridsortcol.setfrozencolumns", function (c, d, e) { c = a("tr.ui-jqgrid-labels:last th:eq(" + b.p.lastsort + ")", b.grid.fhdiv); d = a("tr.ui-jqgrid-labels:last th:eq(" + e + ")", b.grid.fhdiv); a("span.ui-grid-ico-sort", c).addclass("ui-state-disabled"); a(c).attr("aria-selected", "false"); a("span.ui-icon-" + b.p.sortorder, d).removeclass("ui-state-disabled"); a(d).attr("aria-selected", "true"); b.p.viewsortcols[0] || b.p.lastsort === e || (a("span.s-ico", c).hide(), a("span.s-ico", d).show()) }); a("#gview_" + a.jgrid.jqid(b.p.id)).append(b.grid.fbdiv); a(b.grid.bdiv).scroll(function () { a(b.grid.fbdiv).scrolltop(a(this).scrolltop()) }); !0 === b.p.hoverrows && a("#" + a.jgrid.jqid(b.p.id)).unbind("mouseover").unbind("mouseout"); a(b).bind("jqgridaftergridcomplete.setfrozencolumns", function () { a("#" + a.jgrid.jqid(b.p.id) + "_frozen").remove(); a(b.grid.fbdiv).height(a(b.grid.bdiv).height() - 16); var c = a("#" + a.jgrid.jqid(b.p.id)).clone(!0); a("tr[role=row]", c).each(function () { a("td[role=gridcell]:gt(" + k + ")", this).remove() }); a(c).width(1).attr("id", b.p.id + "_frozen"); a(b.grid.fbdiv).append(c); !0 === b.p.hoverrows && (a("tr.jqgrow", c).hover(function () { a(this).addclass("ui-state-hover"); a("#" + a.jgrid.jqid(this.id), "#" + a.jgrid.jqid(b.p.id)).addclass("ui-state-hover") }, function () { a(this).removeclass("ui-state-hover"); a("#" + a.jgrid.jqid(this.id), "#" + a.jgrid.jqid(b.p.id)).removeclass("ui-state-hover") }), a("tr.jqgrow", "#" + a.jgrid.jqid(b.p.id)).hover(function () { a(this).addclass("ui-state-hover"); a("#" + a.jgrid.jqid(this.id), "#" + a.jgrid.jqid(b.p.id) + "_frozen").addclass("ui-state-hover") }, function () { a(this).removeclass("ui-state-hover"); a("#" + a.jgrid.jqid(this.id), "#" + a.jgrid.jqid(b.p.id) + "_frozen").removeclass("ui-state-hover") })); c = null }); b.grid.hdiv.loading || a(b).triggerhandler("jqgridaftergridcomplete"); b.p.frozencolumns = !0 } } } }) }, destroyfrozencolumns: function () { return this.each(function () { if (this.grid && !0 === this.p.frozencolumns) { a(this.grid.fhdiv).remove(); a(this.grid.fbdiv).remove(); this.grid.fhdiv = null; this.grid.fbdiv = null; a(this).unbind(".setfrozencolumns"); if (!0 === this.p.hoverrows) { var b; a("#" + a.jgrid.jqid(this.p.id)).bind("mouseover", function (c) { b = a(c.target).closest("tr.jqgrow"); "ui-subgrid" !== a(b).attr("class") && a(b).addclass("ui-state-hover") }).bind("mouseout", function (c) { b = a(c.target).closest("tr.jqgrow"); a(b).removeclass("ui-state-hover") }) } this.p.frozencolumns = !1 } }) } }) })(jquery); (function (a) { a.extend(a.jgrid, { showmodal: function (a) { a.w.show() }, closemodal: function (a) { a.w.hide().attr("aria-hidden", "true"); a.o && a.o.remove() }, hidemodal: function (d, b) { b = a.extend({ jqm: !0, gb: "" }, b || {}); if (b.onclose) { var c = b.gb && "string" === typeof b.gb && "#gbox_" === b.gb.substr(0, 6) ? b.onclose.call(a("#" + b.gb.substr(6))[0], d) : b.onclose(d); if ("boolean" === typeof c && !c) return } if (a.fn.jqm && !0 === b.jqm) a(d).attr("aria-hidden", "true").jqmhide(); else { if ("" !== b.gb) try { a(".jqgrid-overlay:first", b.gb).hide() } catch (g) { } a(d).hide().attr("aria-hidden", "true") } }, findpos: function (a) { var b = 0, c = 0; if (a.offsetparent) { do b += a.offsetleft, c += a.offsettop; while (a = a.offsetparent) } return [b, c] }, createmodal: function (d, b, c, g, e, h, f) { c = a.extend(!0, {}, a.jgrid.jqmodal || {}, c); var k = document.createelement("div"), l, m = this; f = a.extend({}, f || {}); l = "rtl" === a(c.gbox).attr("dir") ? !0 : !1; k.classname = "ui-widget ui-widget-content ui-corner-all ui-jqdialog"; k.id = d.themodal; var n = document.createelement("div"); n.classname = "ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"; n.id = d.modalhead; a(n).append("" + c.caption + ""); var q = a("").hover(function () { q.addclass("ui-state-hover") }, function () { q.removeclass("ui-state-hover") }).append(""); a(n).append(q); l ? (k.dir = "rtl", a(".ui-jqdialog-title", n).css("float", "right"), a(".ui-jqdialog-titlebar-close", n).css("left", "0.3em")) : (k.dir = "ltr", a(".ui-jqdialog-title", n).css("float", "left"), a(".ui-jqdialog-titlebar-close", n).css("right", "0.3em")); var p = document.createelement("div"); a(p).addclass("ui-jqdialog-content ui-widget-content").attr("id", d.modalcontent); a(p).append(b); k.appendchild(p); a(k).prepend(n); !0 === h ? a("body").append(k) : "string" === typeof h ? a(h).append(k) : a(k).insertbefore(g); a(k).css(f); void 0 === c.jqmodal && (c.jqmodal = !0); b = {}; if (a.fn.jqm && !0 === c.jqmodal) 0 === c.left && 0 === c.top && c.overlay && (f = [], f = a.jgrid.findpos(e), c.left = f[0] + 4, c.top = f[1] + 4), b.top = c.top + "px", b.left = c.left; else if (0 !== c.left || 0 !== c.top) b.left = c.left, b.top = c.top + "px"; a("a.ui-jqdialog-titlebar-close", n).click(function () { var b = a("#" + a.jgrid.jqid(d.themodal)).data("onclose") || c.onclose, e = a("#" + a.jgrid.jqid(d.themodal)).data("gbox") || c.gbox; m.hidemodal("#" + a.jgrid.jqid(d.themodal), { gb: e, jqm: c.jqmodal, onclose: b }); return !1 }); 0 !== c.width && c.width || (c.width = 300); 0 !== c.height && c.height || (c.height = 200); c.zindex || (g = a(g).parents("*[role=dialog]").filter(":first").css("z-index"), c.zindex = g ? parseint(g, 10) + 2 : 950); g = 0; l && b.left && !h && (g = a(c.gbox).width() - (isnan(c.width) ? 0 : parseint(c.width, 10)) - 8, b.left = parseint(b.left, 10) + parseint(g, 10)); b.left && (b.left += "px"); a(k).css(a.extend({ width: isnan(c.width) ? "auto" : c.width + "px", height: isnan(c.height) ? "auto" : c.height + "px", zindex: c.zindex, overflow: "hidden" }, b)).attr({ tabindex: "-1", role: "dialog", "aria-labelledby": d.modalhead, "aria-hidden": "true" }); void 0 === c.drag && (c.drag = !0); void 0 === c.resize && (c.resize = !0); if (c.drag) if (a(n).css("cursor", "move"), a.fn.jqdrag) a(k).jqdrag(n); else try { a(k).draggable({ handle: a("#" + a.jgrid.jqid(n.id)) }) } catch (r) { } if (c.resize) if (a.fn.jqresize) a(k).append("
"), a("#" + a.jgrid.jqid(d.themodal)).jqresize(".jqresize", d.scrollelm ? "#" + a.jgrid.jqid(d.scrollelm) : !1); else try { a(k).resizable({ handles: "se, sw", alsoresize: d.scrollelm ? "#" + a.jgrid.jqid(d.scrollelm) : !1 }) } catch (s) { } !0 === c.closeonescape && a(k).keydown(function (b) { 27 == b.which && (b = a("#" + a.jgrid.jqid(d.themodal)).data("onclose") || c.onclose, m.hidemodal("#" + a.jgrid.jqid(d.themodal), { gb: c.gbox, jqm: c.jqmodal, onclose: b })) }) }, viewmodal: function (d, b) { b = a.extend({ totop: !0, overlay: 10, modal: !1, overlayclass: "ui-widget-overlay", onshow: a.jgrid.showmodal, onhide: a.jgrid.closemodal, gbox: "", jqm: !0, jqm: !0 }, b || {}); if (a.fn.jqm && !0 === b.jqm) b.jqm ? a(d).attr("aria-hidden", "false").jqm(b).jqmshow() : a(d).attr("aria-hidden", "false").jqmshow(); else { "" !== b.gbox && (a(".jqgrid-overlay:first", b.gbox).show(), a(d).data("gbox", b.gbox)); a(d).show().attr("aria-hidden", "false"); try { a(":input:visible", d)[0].focus() } catch (c) { } } }, info_dialog: function (d, b, c, g) { var e = { width: 290, height: "auto", dataheight: "auto", drag: !0, resize: !1, left: 250, top: 170, zindex: 1e3, jqmodal: !0, modal: !1, closeonescape: !0, align: "center", buttonalign: "center", buttons: [] }; a.extend(!0, e, a.jgrid.jqmodal || {}, { caption: "" + d + "" }, g || {}); var h = e.jqmodal, f = this; a.fn.jqm && !h && (h = !1); d = ""; if (0 < e.buttons.length) for (g = 0; g < e.buttons.length; g++) void 0 === e.buttons[g].id && (e.buttons[g].id = "info_button_" + g), d += "" + e.buttons[g].text + ""; g = isnan(e.dataheight) ? e.dataheight : e.dataheight + "px"; b = "
" + ("
" + b + "
"); b += c ? "
" + c + "" + d + "
" : "" !== d ? "
" + d + "
" : ""; b += "
"; try { "false" === a("#info_dialog").attr("aria-hidden") && a.jgrid.hidemodal("#info_dialog", { jqm: h }), a("#info_dialog").remove() } catch (k) { } a.jgrid.createmodal({ themodal: "info_dialog", modalhead: "info_head", modalcontent: "info_content", scrollelm: "infocnt" }, b, e, "", "", !0); d && a.each(e.buttons, function (b) { a("#" + a.jgrid.jqid(this.id), "#info_id").bind("click", function () { e.buttons[b].onclick.call(a("#info_dialog")); return !1 }) }); a("#closedialog", "#info_id").click(function () { f.hidemodal("#info_dialog", { jqm: h, onclose: a("#info_dialog").data("onclose") || e.onclose, gb: a("#info_dialog").data("gbox") || e.gbox }); return !1 }); a(".fm-button", "#info_dialog").hover(function () { a(this).addclass("ui-state-hover") }, function () { a(this).removeclass("ui-state-hover") }); a.isfunction(e.beforeopen) && e.beforeopen(); a.jgrid.viewmodal("#info_dialog", { onhide: function (a) { a.w.hide().remove(); a.o && a.o.remove() }, modal: e.modal, jqm: h }); a.isfunction(e.afteropen) && e.afteropen(); try { a("#info_dialog").focus() } catch (l) { } }, bindev: function (d, b) { a.isfunction(b.datainit) && b.datainit.call(this, d, b); b.dataevents && a.each(b.dataevents, function () { void 0 !== this.data ? a(d).bind(this.type, this.data, this.fn) : a(d).bind(this.type, this.fn) }) }, createel: function (d, b, c, g, e) { function h(b, d, c) { var e = "datainit dataevents dataurl buildselect sopt searchhidden defaultvalue attr custom_element custom_value".split(" "); void 0 !== c && a.isarray(c) && a.merge(e, c); a.each(d, function (d, c) { -1 === a.inarray(d, e) && a(b).attr(d, c) }); d.hasownproperty("id") || a(b).attr("id", a.jgrid.randid()) } var f = "", k = this; switch (d) { case "textarea": f = document.createelement("textarea"); g ? b.cols || a(f).css({ width: "98%" }) : b.cols || (b.cols = 20); b.rows || (b.rows = 2); if (" " === c || " " === c || 1 === c.length && 160 === c.charcodeat(0)) c = ""; f.value = c; h(f, b); a(f).attr({ role: "textbox", multiline: "true" }); break; case "checkbox": f = document.createelement("input"); f.type = "checkbox"; b.value ? (d = b.value.split(":"), c === d[0] && (f.checked = !0, f.defaultchecked = !0), f.value = d[0], a(f).attr("offval", d[1])) : (d = (c + "").tolowercase(), 0 > d.search(/(false|f|0|no|n|off|undefined)/i) && "" !== d ? (f.checked = !0, f.defaultchecked = !0, f.value = c) : f.value = "on", a(f).attr("offval", "off")); h(f, b, ["value"]); a(f).attr("role", "checkbox"); break; case "select": f = document.createelement("select"); f.setattribute("role", "select"); g = []; !0 === b.multiple ? (d = !0, f.multiple = "multiple", a(f).attr("aria-multiselectable", "true")) : d = !1; if (void 0 !== b.dataurl) { d = b.name ? string(b.id).substring(0, string(b.id).length - string(b.name).length - 1) : string(b.id); var l = b.postdata || e.postdata; k.p && k.p.idprefix && (d = a.jgrid.strippref(k.p.idprefix, d)); a.ajax(a.extend({ url: a.isfunction(b.dataurl) ? b.dataurl.call(k, d, c, string(b.name)) : b.dataurl, type: "get", datatype: "html", data: a.isfunction(l) ? l.call(k, d, c, string(b.name)) : l, context: { elem: f, options: b, vl: c }, success: function (b) { var d = [], c = this.elem, e = this.vl, f = a.extend({}, this.options), g = !0 === f.multiple; b = a.isfunction(f.buildselect) ? f.buildselect.call(k, b) : b; "string" === typeof b && (b = a(a.trim(b)).html()); b && (a(c).append(b), h(c, f, l ? ["postdata"] : void 0), void 0 === f.size && (f.size = g ? 3 : 1), g ? (d = e.split(","), d = a.map(d, function (b) { return a.trim(b) })) : d[0] = a.trim(e), settimeout(function () { a("option", c).each(function (b) { 0 === b && c.multiple && (this.selected = !1); a(this).attr("role", "option"); if (-1 < a.inarray(a.trim(a(this).text()), d) || -1 < a.inarray(a.trim(a(this).val()), d)) this.selected = "selected" }) }, 0)) } }, e || {})) } else if (b.value) { var m; void 0 === b.size && (b.size = d ? 3 : 1); d && (g = c.split(","), g = a.map(g, function (b) { return a.trim(b) })); "function" === typeof b.value && (b.value = b.value()); var n, q, p = void 0 === b.separator ? ":" : b.separator; e = void 0 === b.delimiter ? ";" : b.delimiter; if ("string" === typeof b.value) for (n = b.value.split(e), m = 0; m < n.length; m++) q = n[m].split(p), 2 < q.length && (q[1] = a.map(q, function (a, b) { if (0 < b) return a }).join(p)), e = document.createelement("option"), e.setattribute("role", "option"), e.value = q[0], e.innerhtml = q[1], f.appendchild(e), d || a.trim(q[0]) !== a.trim(c) && a.trim(q[1]) !== a.trim(c) || (e.selected = "selected"), d && (-1 < a.inarray(a.trim(q[1]), g) || -1 < a.inarray(a.trim(q[0]), g)) && (e.selected = "selected"); else if ("object" === typeof b.value) for (m in p = b.value, p) p.hasownproperty(m) && (e = document.createelement("option"), e.setattribute("role", "option"), e.value = m, e.innerhtml = p[m], f.appendchild(e), d || a.trim(m) !== a.trim(c) && a.trim(p[m]) !== a.trim(c) || (e.selected = "selected"), d && (-1 < a.inarray(a.trim(p[m]), g) || -1 < a.inarray(a.trim(m), g)) && (e.selected = "selected")); h(f, b, ["value"]) } break; case "text": case "password": case "button": m = "button" === d ? "button" : "textbox"; f = document.createelement("input"); f.type = d; f.value = c; h(f, b); "button" !== d && (g ? b.size || a(f).css({ width: "98%" }) : b.size || (b.size = 20)); a(f).attr("role", m); break; case "image": case "file": f = document.createelement("input"); f.type = d; h(f, b); break; case "custom": f = document.createelement("span"); try { if (a.isfunction(b.custom_element)) if (p = b.custom_element.call(k, c, b)) p = a(p).addclass("customelement").attr({ id: b.id, name: b.name }), a(f).empty().append(p); else throw "e2"; else throw "e1"; } catch (r) { "e1" === r && a.jgrid.info_dialog(a.jgrid.errors.errcap, "function 'custom_element' " + a.jgrid.edit.msg.nodefined, a.jgrid.edit.bclose), "e2" === r ? 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 r ? r : r.message, a.jgrid.edit.bclose) } } return f }, checkdate: function (a, b) { var c = {}, g; a = a.tolowercase(); g = -1 !== a.indexof("/") ? "/" : -1 !== a.indexof("-") ? "-" : -1 !== a.indexof(".") ? "." : "/"; a = a.split(g); b = b.split(g); if (3 !== b.length) return !1; var e = -1, h, f = g = -1, k; for (k = 0; k < a.length; k++) h = isnan(b[k]) ? 0 : parseint(b[k], 10), c[a[k]] = h, h = a[k], -1 !== h.indexof("y") && (e = k), -1 !== h.indexof("m") && (f = k), -1 !== h.indexof("d") && (g = k); h = "y" === a[e] || "yyyy" === a[e] ? 4 : "yy" === a[e] ? 2 : -1; k = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; var l; if (-1 === e) return !1; l = c[a[e]].tostring(); 2 === h && 1 === l.length && (h = 1); if (l.length !== h || 0 === c[a[e]] && "00" !== b[e] || -1 === f) return !1; l = c[a[f]].tostring(); if (1 > l.length || 1 > c[a[f]] || 12 < c[a[f]] || -1 === g) return !1; l = c[a[g]].tostring(); if (!(h = 1 > l.length) && !(h = 1 > c[a[g]]) && !(h = 31 < c[a[g]])) { if (h = 2 === c[a[f]]) e = c[a[e]], h = c[a[g]] > (0 !== e % 4 || 0 === e % 100 && 0 !== e % 400 ? 28 : 29); h = h || c[a[g]] > k[c[a[f]]] } return h ? !1 : !0 }, isempty: function (a) { return a.match(/^\s+$/) || "" === a ? !0 : !1 }, checktime: function (d) { var b = /^(\d{1,2}):(\d{2})([apap][mm])?$/; if (!a.jgrid.isempty(d)) if (d = d.match(b)) { if (d[3]) { if (1 > d[1] || 12 < d[1]) return !1 } else if (23 < d[1]) return !1; if (59 < d[2]) return !1 } else return !1; return !0 }, checkvalues: function (d, b, c, g) { var e, h, f; f = this.p.colmodel; if (void 0 === c) if ("string" === typeof b) for (c = 0, g = f.length; c < g; c++) { if (f[c].name === b) { e = f[c].editrules; b = c; null != f[c].formoptions && (h = f[c].formoptions.label); break } } else 0 <= b && (e = f[b].editrules); else e = c, h = void 0 === g ? "_" : g; if (e) { h || (h = null != this.p.colnames ? this.p.colnames[b] : f[b].label); if (!0 === e.required && a.jgrid.isempty(d)) return [!1, h + ": " + a.jgrid.edit.msg.required, ""]; c = !1 === e.required ? !1 : !0; if (!0 === e.number && (!1 !== c || !a.jgrid.isempty(d)) && isnan(d)) return [!1, h + ": " + a.jgrid.edit.msg.number, ""]; if (void 0 !== e.minvalue && !isnan(e.minvalue) && parsefloat(d) < parsefloat(e.minvalue)) return [!1, h + ": " + a.jgrid.edit.msg.minvalue + " " + e.minvalue, ""]; if (void 0 !== e.maxvalue && !isnan(e.maxvalue) && parsefloat(d) > parsefloat(e.maxvalue)) return [!1, h + ": " + a.jgrid.edit.msg.maxvalue + " " + e.maxvalue, ""]; if (!(!0 !== e.email || !1 === c && a.jgrid.isempty(d) || (g = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(([a-z]|\d|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])([a-z]|\d|-|\.|_|~|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])*([a-z]|\d|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])))\.)+(([a-z]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(([a-z]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])([a-z]|\d|-|\.|_|~|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])*([a-z]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])))\.?$/i, g.test(d)))) return [!1, h + ": " + a.jgrid.edit.msg.email, ""]; if (!(!0 !== e.integer || !1 === c && a.jgrid.isempty(d) || !isnan(d) && 0 === d % 1 && -1 === d.indexof("."))) return [!1, h + ": " + a.jgrid.edit.msg.integer, ""]; if (!(!0 !== e.date || !1 === c && a.jgrid.isempty(d) || (f[b].formatoptions && f[b].formatoptions.newformat ? (f = f[b].formatoptions.newformat, a.jgrid.formatter.date.masks.hasownproperty(f) && (f = a.jgrid.formatter.date.masks[f])) : f = f[b].datefmt || "y-m-d", a.jgrid.checkdate(f, d)))) return [!1, h + ": " + a.jgrid.edit.msg.date + " - " + f, ""]; if (!0 === e.time && !(!1 === c && a.jgrid.isempty(d) || a.jgrid.checktime(d))) return [!1, h + ": " + a.jgrid.edit.msg.date + " - hh:mm (am/pm)", ""]; if (!(!0 !== e.url || !1 === c && a.jgrid.isempty(d) || (g = /^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i, g.test(d)))) return [!1, h + ": " + a.jgrid.edit.msg.url, ""]; if (!0 === e.custom && (!1 !== c || !a.jgrid.isempty(d))) return a.isfunction(e.custom_func) ? (d = e.custom_func.call(this, d, h, b), a.isarray(d) ? d : [!1, a.jgrid.edit.msg.customarray, ""]) : [!1, a.jgrid.edit.msg.customfcheck, ""] } return [!0, "", ""] } }) })(jquery); (function (a) { var b = {}; a.jgrid.extend({ searchgrid: function (b) { b = a.extend(!0, { recreatefilter: !1, drag: !0, sfield: "searchfield", svalue: "searchstring", soper: "searchoper", sfilter: "filters", loaddefaults: !0, beforeshowsearch: null, aftershowsearch: null, oninitializesearch: null, afterredraw: null, afterchange: null, closeaftersearch: !1, closeafterreset: !1, closeonescape: !1, searchonenter: !1, multiplesearch: !1, multiplegroup: !1, top: 0, left: 0, jqmodal: !0, modal: !1, resize: !0, width: 450, height: "auto", dataheight: "auto", showquery: !1, errorcheck: !0, sopt: null, stringresult: void 0, onclose: null, onsearch: null, onreset: null, totop: !0, overlay: 30, columns: [], tmplnames: null, tmplfilters: null, tmpllabel: " template: ", showonload: !1, layer: null, operands: { eq: "=", ne: "<>", lt: "<", le: "<=", gt: ">", ge: ">=", bw: "like", bn: "not like", "in": "in", ni: "not in", ew: "like", en: "not like", cn: "like", nc: "not like", nu: "is null", nn: "isnot null" } }, a.jgrid.search, b || {}); return this.each(function () { function c(c) { w = a(e).triggerhandler("jqgridfilterbeforeshow", [c]); void 0 === w && (w = !0); w && a.isfunction(b.beforeshowsearch) && (w = b.beforeshowsearch.call(e, c)); w && (a.jgrid.viewmodal("#" + a.jgrid.jqid(s.themodal), { gbox: "#gbox_" + a.jgrid.jqid(h), jqm: b.jqmodal, modal: b.modal, overlay: b.overlay, totop: b.totop }), a(e).triggerhandler("jqgridfilteraftershow", [c]), a.isfunction(b.aftershowsearch) && b.aftershowsearch.call(e, c)) } var e = this; if (e.grid) { var h = "fbox_" + e.p.id, w = !0, t = !0, s = { themodal: "searchmod" + h, modalhead: "searchhd" + h, modalcontent: "searchcnt" + h, scrollelm: h }, r = e.p.postdata[b.sfilter]; "string" === typeof r && (r = a.jgrid.parse(r)); !0 === b.recreatefilter && a("#" + a.jgrid.jqid(s.themodal)).remove(); if (void 0 !== a("#" + a.jgrid.jqid(s.themodal))[0]) c(a("#fbox_" + a.jgrid.jqid(+e.p.id))); else { var f = a("
").insertbefore("#gview_" + a.jgrid.jqid(e.p.id)), k = "left", u = ""; "rtl" === e.p.direction && (k = "right", u = " style='text-align:left'", f.attr("dir", "rtl")); var x = a.extend([], e.p.colmodel), d = "" + b.find + "", v = "" + b.reset + "", g = "", m = "", p, q = !1, y = -1; b.showquery && (g = "query"); b.columns.length ? (x = b.columns, y = 0, p = x[0].index || x[0].name) : a.each(x, function (a, b) { b.label || (b.label = e.p.colnames[a]); if (!q) { var c = void 0 === b.search ? !0 : b.search, d = !0 === b.hidden; if (b.searchoptions && !0 === b.searchoptions.searchhidden && c || c && !d) q = !0, p = b.index || b.name, y = a } }); if (!r && p || !1 === b.multiplesearch) { var d = "eq"; 0 <= y && x[y].searchoptions && x[y].searchoptions.sopt ? d = x[y].searchoptions.sopt[0] : b.sopt && b.sopt.length && (d = b.sopt[0]); r = { groupop: "and", rules: [{ field: p, op: d, data: "" }] } } q = !1; b.tmplnames && b.tmplnames.length && (q = !0, m = b.tmpllabel, m += ""); k = "

" + v + m + "" + g + d + "
"; h = a.jgrid.jqid(h); a("#" + h).jqfilter({ columns: x, filter: b.loaddefaults ? r : null, showquery: b.showquery, errorcheck: b.errorcheck, sopt: b.sopt, groupbutton: b.multiplegroup, rulebuttons: b.multiplesearch, afterredraw: b.afterredraw, ops: b.odata, operands: b.operands, ajaxselectoptions: e.p.ajaxselectoptions, groupops: b.groupops, onchange: function () { this.p.showquery && a(".query", this).html(this.touserfriendlystring()); a.isfunction(b.afterchange) && b.afterchange.call(e, a("#" + h), b) }, direction: e.p.direction, id: e.p.id }); f.append(k); q && b.tmplfilters && b.tmplfilters.length && a(".ui-template", f).bind("change", function () { var c = a(this).val(); "default" === c ? a("#" + h).jqfilter("addfilter", r) : a("#" + h).jqfilter("addfilter", b.tmplfilters[parseint(c, 10)]); return !1 }); !0 === b.multiplegroup && (b.multiplesearch = !0); a(e).triggerhandler("jqgridfilterinitialize", [a("#" + h)]); a.isfunction(b.oninitializesearch) && b.oninitializesearch.call(e, a("#" + h)); b.gbox = "#gbox_" + h; b.layer ? a.jgrid.createmodal(s, f, b, "#gview_" + a.jgrid.jqid(e.p.id), a("#gbox_" + a.jgrid.jqid(e.p.id))[0], "#" + a.jgrid.jqid(b.layer), { position: "relative" }) : a.jgrid.createmodal(s, f, b, "#gview_" + a.jgrid.jqid(e.p.id), a("#gbox_" + a.jgrid.jqid(e.p.id))[0]); (b.searchonenter || b.closeonescape) && a("#" + a.jgrid.jqid(s.themodal)).keydown(function (c) { var d = a(c.target); if (b.searchonenter && 13 === c.which && !(d.hasclass("add-group") || d.hasclass("add-rule") || d.hasclass("delete-group") || d.hasclass("delete-rule") || d.hasclass("fm-button") && d.is("[id$=_query]"))) return a("#" + h + "_search").click(), !1; if (b.closeonescape && 27 === c.which) return a("#" + a.jgrid.jqid(s.modalhead)).find(".ui-jqdialog-titlebar-close").click(), !1 }); g && a("#" + h + "_query").bind("click", function () { a(".queryresult", f).toggle(); return !1 }); void 0 === b.stringresult && (b.stringresult = b.multiplesearch); a("#" + h + "_search").bind("click", function () { var c = a("#" + h), d = {}, n, g; c.find(".input-elm:focus").change(); g = c.jqfilter("filterdata"); if (b.errorcheck && (c[0].hideerror(), b.showquery || c.jqfilter("tosqlstring"), c[0].p.error)) return c[0].showerror(), !1; if (b.stringresult) { try { n = xmljsonclass.tojson(g, "", "", !1) } catch (f) { try { n = json.stringify(g) } catch (k) { } } "string" === typeof n && (d[b.sfilter] = n, a.each([b.sfield, b.svalue, b.soper], function () { d[this] = "" })) } else b.multiplesearch ? (d[b.sfilter] = g, a.each([b.sfield, b.svalue, b.soper], function () { d[this] = "" })) : (d[b.sfield] = g.rules[0].field, d[b.svalue] = g.rules[0].data, d[b.soper] = g.rules[0].op, d[b.sfilter] = ""); e.p.search = !0; a.extend(e.p.postdata, d); t = a(e).triggerhandler("jqgridfiltersearch"); void 0 === t && (t = !0); t && a.isfunction(b.onsearch) && (t = b.onsearch.call(e, e.p.filters)); !1 !== t && a(e).trigger("reloadgrid", [{ page: 1 }]); b.closeaftersearch && a.jgrid.hidemodal("#" + a.jgrid.jqid(s.themodal), { gb: "#gbox_" + a.jgrid.jqid(e.p.id), jqm: b.jqmodal, onclose: b.onclose }); return !1 }); a("#" + h + "_reset").bind("click", function () { var c = {}, d = a("#" + h); e.p.search = !1; e.p.resetsearch = !0; !1 === b.multiplesearch ? c[b.sfield] = c[b.svalue] = c[b.soper] = "" : c[b.sfilter] = ""; d[0].resetfilter(); q && a(".ui-template", f).val("default"); a.extend(e.p.postdata, c); t = a(e).triggerhandler("jqgridfilterreset"); void 0 === t && (t = !0); t && a.isfunction(b.onreset) && (t = b.onreset.call(e)); !1 !== t && a(e).trigger("reloadgrid", [{ page: 1 }]); b.closeafterreset && a.jgrid.hidemodal("#" + a.jgrid.jqid(s.themodal), { gb: "#gbox_" + a.jgrid.jqid(e.p.id), jqm: b.jqmodal, onclose: b.onclose }); return !1 }); c(a("#" + h)); a(".fm-button:not(.ui-state-disabled)", f).hover(function () { a(this).addclass("ui-state-hover") }, function () { a(this).removeclass("ui-state-hover") }) } } }) }, editgridrow: function (z, c) { c = a.extend(!0, { top: 0, left: 0, width: 300, datawidth: "auto", height: "auto", dataheight: "auto", modal: !1, overlay: 30, drag: !0, resize: !0, url: null, mtype: "post", clearafteradd: !0, closeafteredit: !1, reloadaftersubmit: !0, oninitializeform: null, beforeinitdata: null, beforeshowform: null, aftershowform: null, beforesubmit: null, aftersubmit: null, onclicksubmit: null, aftercomplete: null, onclickpgbuttons: null, afterclickpgbuttons: null, editdata: {}, recreateform: !1, jqmodal: !0, closeonescape: !1, addedrow: "first", topinfo: "", bottominfo: "", saveicon: [], closeicon: [], savekey: [!1, 13], navkeys: [!1, 38, 40], checkonsubmit: !1, checkonupdate: !1, _saveddata: {}, processing: !1, onclose: null, ajaxeditoptions: {}, serializeeditdata: null, viewpagerbuttons: !0, overlayclass: "ui-widget-overlay" }, a.jgrid.edit, c || {}); b[a(this)[0].p.id] = c; return this.each(function () { function e() { a(p + " > tbody > tr > td > .formelement").each(function () { var b = a(".customelement", this); if (b.length) { var c = a(b[0]).attr("name"); a.each(d.p.colmodel, function () { if (this.name === c && this.editoptions && a.isfunction(this.editoptions.custom_value)) { try { if (l[c] = this.editoptions.custom_value.call(d, a("#" + a.jgrid.jqid(c), p), "get"), void 0 === l[c]) throw "e1"; } catch (b) { "e1" === b ? a.jgrid.info_dialog(a.jgrid.errors.errcap, "function 'custom_value' " + a.jgrid.edit.msg.novalue, a.jgrid.edit.bclose) : a.jgrid.info_dialog(a.jgrid.errors.errcap, b.message, a.jgrid.edit.bclose) } return !0 } }) } else { switch (a(this).get(0).type) { case "checkbox": a(this).is(":checked") ? l[this.name] = a(this).val() : (b = a(this).attr("offval"), l[this.name] = b); break; case "select-one": l[this.name] = a("option:selected", this).val(); break; case "select-multiple": l[this.name] = a(this).val(); l[this.name] = l[this.name] ? l[this.name].join(",") : ""; a("option:selected", this).each(function (b, c) { a(c).text() }); break; case "password": case "text": case "textarea": case "button": l[this.name] = a(this).val() } d.p.autoencode && (l[this.name] = a.jgrid.htmlencode(l[this.name])) } }); return !0 } function h(c, e, n, f) { var k, l, p, h = 0, q, m, r, c = [], u = !1, z = "", t; for (t = 1; t <= f; t++) z += "  "; "_empty" !== c && (u = a(e).jqgrid("getind", c)); a(e.p.colmodel).each(function (t) { k = this.name; m = (l = this.editrules && !0 === this.editrules.edithidden ? !1 : !0 === this.hidden ? !0 : !1) ? "style='display:none'" : ""; if ("cb" !== k && "subgrid" !== k && !0 === this.editable && "rn" !== k) { if (!1 === u) q = ""; else if (k === e.p.expandcolumn && !0 === e.p.treegrid) q = a("td[role='gridcell']:eq(" + t + ")", e.rows[u]).text(); else { try { q = a.unformat.call(e, a("td[role='gridcell']:eq(" + t + ")", e.rows[u]), { rowid: c, colmodel: this }, t) } catch (w) { q = this.edittype && "textarea" === this.edittype ? a("td[role='gridcell']:eq(" + t + ")", e.rows[u]).text() : a("td[role='gridcell']:eq(" + t + ")", e.rows[u]).html() } if (!q || " " === q || " " === q || 1 === q.length && 160 === q.charcodeat(0)) q = "" } var s = a.extend({}, this.editoptions || {}, { id: k, name: k }), y = a.extend({}, { elmprefix: "", elmsuffix: "", rowabove: !1, rowcontent: "" }, this.formoptions || {}), v = parseint(y.rowpos, 10) || h + 1, a = parseint(2 * (parseint(y.colpos, 10) || 1), 10); "_empty" === c && s.defaultvalue && (q = a.isfunction(s.defaultvalue) ? s.defaultvalue.call(d) : s.defaultvalue); this.edittype || (this.edittype = "text"); d.p.autoencode && (q = a.jgrid.htmldecode(q)); r = a.jgrid.createel.call(d, this.edittype, s, q, !1, a.extend({}, a.jgrid.ajaxoptions, e.p.ajaxselectoptions || {})); if (b[d.p.id].checkonsubmit || b[d.p.id].checkonupdate) b[d.p.id]._saveddata[k] = q; a(r).addclass("formelement"); -1 < a.inarray(this.edittype, ["text", "textarea", "password", "select"]) && a(r).addclass("ui-widget-content ui-corner-all"); p = a(n).find("tr[rowpos=" + v + "]"); if (y.rowabove) { var x = a("" + y.rowcontent + ""); a(n).append(x); x[0].rp = v } 0 === p.length && (p = a("").addclass("formdata").attr("id", "tr_" + k), a(p).append(z), a(n).append(p), p[0].rp = v); a("td:eq(" + (a - 2) + ")", p[0]).html(void 0 === y.label ? e.p.colnames[t] : y.label); a("td:eq(" + (a - 1) + ")", p[0]).append(y.elmprefix).append(r).append(y.elmsuffix); "custom" === this.edittype && a.isfunction(s.custom_value) && s.custom_value.call(d, a("#" + k, "#" + g), "set", q); a.jgrid.bindev.call(d, r, s); c[h] = t; h++ } }); 0 < h && (t = a(""), t[0].rp = h + 999, a(n).append(t), b[d.p.id].checkonsubmit || b[d.p.id].checkonupdate) && (b[d.p.id]._saveddata[e.p.id + "_id"] = c); return c } function w(c, e, n) { var g, k = 0, f, l, q, h, r; if (b[d.p.id].checkonsubmit || b[d.p.id].checkonupdate) b[d.p.id]._saveddata = {}, b[d.p.id]._saveddata[e.p.id + "_id"] = c; var m = e.p.colmodel; if ("_empty" === c) a(m).each(function () { g = this.name; q = a.extend({}, this.editoptions || {}); (l = a("#" + a.jgrid.jqid(g), "#" + n)) && l.length && null !== l[0] && (h = "", "custom" === this.edittype && a.isfunction(q.custom_value) ? q.custom_value.call(d, a("#" + g, "#" + n), "set", h) : q.defaultvalue ? (h = a.isfunction(q.defaultvalue) ? q.defaultvalue.call(d) : q.defaultvalue, "checkbox" === l[0].type ? (r = h.tolowercase(), 0 > r.search(/(false|f|0|no|n|off|undefined)/i) && "" !== r ? (l[0].checked = !0, l[0].defaultchecked = !0, l[0].value = h) : (l[0].checked = !1, l[0].defaultchecked = !1)) : l.val(h)) : "checkbox" === l[0].type ? (l[0].checked = !1, l[0].defaultchecked = !1, h = a(l).attr("offval")) : l[0].type && "select" === l[0].type.substr(0, 6) ? l[0].selectedindex = 0 : l.val(h), !0 === b[d.p.id].checkonsubmit || b[d.p.id].checkonupdate) && (b[d.p.id]._saveddata[g] = h) }), a("#id_g", "#" + n).val(c); else { var t = a(e).jqgrid("getind", c, !0); t && (a('td[role="gridcell"]', t).each(function (l) { g = m[l].name; if ("cb" !== g && "subgrid" !== g && "rn" !== g && !0 === m[l].editable) { if (g === e.p.expandcolumn && !0 === e.p.treegrid) f = a(this).text(); else try { f = a.unformat.call(e, a(this), { rowid: c, colmodel: m[l] }, l) } catch (q) { f = "textarea" === m[l].edittype ? a(this).text() : a(this).html() } d.p.autoencode && (f = a.jgrid.htmldecode(f)); if (!0 === b[d.p.id].checkonsubmit || b[d.p.id].checkonupdate) b[d.p.id]._saveddata[g] = f; g = a.jgrid.jqid(g); switch (m[l].edittype) { case "password": case "text": case "button": case "image": case "textarea": if (" " === f || " " === f || 1 === f.length && 160 === f.charcodeat(0)) f = ""; a("#" + g, "#" + n).val(f); break; case "select": var h = f.split(","), h = a.map(h, function (b) { return a.trim(b) }); a("#" + g + " option", "#" + n).each(function () { m[l].editoptions.multiple || a.trim(f) !== a.trim(a(this).text()) && h[0] !== a.trim(a(this).text()) && h[0] !== a.trim(a(this).val()) ? m[l].editoptions.multiple ? -1 < a.inarray(a.trim(a(this).text()), h) || -1 < a.inarray(a.trim(a(this).val()), h) ? this.selected = !0 : this.selected = !1 : this.selected = !1 : this.selected = !0 }); break; case "checkbox": f = string(f); if (m[l].editoptions && m[l].editoptions.value) if (m[l].editoptions.value.split(":")[0] === f) a("#" + g, "#" + n)[d.p.useprop ? "prop" : "attr"]({ checked: !0, defaultchecked: !0 }); else a("#" + g, "#" + n)[d.p.useprop ? "prop" : "attr"]({ checked: !1, defaultchecked: !1 }); else f = f.tolowercase(), 0 > f.search(/(false|f|0|no|n|off|undefined)/i) && "" !== f ? (a("#" + g, "#" + n)[d.p.useprop ? "prop" : "attr"]("checked", !0), a("#" + g, "#" + n)[d.p.useprop ? "prop" : "attr"]("defaultchecked", !0)) : (a("#" + g, "#" + n)[d.p.useprop ? "prop" : "attr"]("checked", !1), a("#" + g, "#" + n)[d.p.useprop ? "prop" : "attr"]("defaultchecked", !1)); break; case "custom": try { if (m[l].editoptions && a.isfunction(m[l].editoptions.custom_value)) m[l].editoptions.custom_value.call(d, a("#" + g, "#" + n), "set", f); else throw "e1"; } catch (p) { "e1" === p ? a.jgrid.info_dialog(a.jgrid.errors.errcap, "function 'custom_value' " + a.jgrid.edit.msg.nodefined, a.jgrid.edit.bclose) : a.jgrid.info_dialog(a.jgrid.errors.errcap, p.message, a.jgrid.edit.bclose) } } k++ } }), 0 < k && a("#id_g", p).val(c)) } } function t() { a.each(d.p.colmodel, function (a, b) { b.editoptions && !0 === b.editoptions.nullifempty && l.hasownproperty(b.name) && "" === l[b.name] && (l[b.name] = "null") }) } function s() { var e, n = [!0, "", ""], f = {}, k = d.p.prmnames, h, m, r, u, s, c = a(d).triggerhandler("jqgridaddeditbeforecheckvalues", [a("#" + g), b]); c && "object" === typeof c && (l = c); a.isfunction(b[d.p.id].beforecheckvalues) && (c = b[d.p.id].beforecheckvalues.call(d, l, a("#" + g), b)) && "object" === typeof c && (l = c); for (r in l) if (l.hasownproperty(r) && (n = a.jgrid.checkvalues.call(d, l[r], r), !1 === n[0])) break; t(); n[0] && (f = a(d).triggerhandler("jqgridaddeditclicksubmit", [b[d.p.id], l, b]), void 0 === f && a.isfunction(b[d.p.id].onclicksubmit) && (f = b[d.p.id].onclicksubmit.call(d, b[d.p.id], l, b) || {}), n = a(d).triggerhandler("jqgridaddeditbeforesubmit", [l, a("#" + g), b]), void 0 === n && (n = [!0, "", ""]), n[0] && a.isfunction(b[d.p.id].beforesubmit) && (n = b[d.p.id].beforesubmit.call(d, l, a("#" + g), b))); if (n[0] && !b[d.p.id].processing) { b[d.p.id].processing = !0; a("#sdata", p + "_2").addclass("ui-state-active"); m = k.oper; h = k.id; l[m] = "_empty" === a.trim(l[d.p.id + "_id"]) ? k.addoper : k.editoper; l[m] !== k.addoper ? l[h] = l[d.p.id + "_id"] : void 0 === l[h] && (l[h] = l[d.p.id + "_id"]); delete l[d.p.id + "_id"]; l = a.extend(l, b[d.p.id].editdata, f); if (!0 === d.p.treegrid) for (s in l[m] === k.addoper && (u = a(d).jqgrid("getgridparam", "selrow"), l["adjacency" === d.p.treegridmodel ? d.p.treereader.parent_id_field : "parent_id"] = u), d.p.treereader) d.p.treereader.hasownproperty(s) && (f = d.p.treereader[s], !l.hasownproperty(f) || l[m] === k.addoper && "parent_id_field" === s || delete l[f]); l[h] = a.jgrid.strippref(d.p.idprefix, l[h]); s = a.extend({ url: b[d.p.id].url || a(d).jqgrid("getgridparam", "editurl"), type: b[d.p.id].mtype, data: a.isfunction(b[d.p.id].serializeeditdata) ? b[d.p.id].serializeeditdata.call(d, l) : l, complete: function (f, r) { var s; l[h] = d.p.idprefix + l[h]; 300 <= f.status && 304 !== f.status ? (n[0] = !1, n[1] = a(d).triggerhandler("jqgridaddediterrortextformat", [f, b]), a.isfunction(b[d.p.id].errortextformat) ? n[1] = b[d.p.id].errortextformat.call(d, f, b) : n[1] = r + " status: '" + f.statustext + "'. error code: " + f.status) : (n = a(d).triggerhandler("jqgridaddeditaftersubmit", [f, l, b]), void 0 === n && (n = [!0, "", ""]), n[0] && a.isfunction(b[d.p.id].aftersubmit) && (n = b[d.p.id].aftersubmit.call(d, f, l, b))); if (!1 === n[0]) a("#formerror>td", p).html(n[1]), a("#formerror", p).show(); else if (d.p.autoencode && a.each(l, function (b, c) { l[b] = a.jgrid.htmldecode(c) }), l[m] === k.addoper ? (n[2] || (n[2] = a.jgrid.randid()), l[h] = n[2], b[d.p.id].reloadaftersubmit ? a(d).trigger("reloadgrid") : !0 === d.p.treegrid ? a(d).jqgrid("addchildnode", n[2], u, l) : a(d).jqgrid("addrowdata", n[2], l, c.addedrow), b[d.p.id].closeafteradd ? (!0 !== d.p.treegrid && a(d).jqgrid("setselection", n[2]), a.jgrid.hidemodal("#" + a.jgrid.jqid(q.themodal), { gb: "#gbox_" + a.jgrid.jqid(v), jqm: c.jqmodal, onclose: b[d.p.id].onclose })) : b[d.p.id].clearafteradd && w("_empty", d, g)) : (b[d.p.id].reloadaftersubmit ? (a(d).trigger("reloadgrid"), b[d.p.id].closeafteredit || settimeout(function () { a(d).jqgrid("setselection", l[h]) }, 1e3)) : !0 === d.p.treegrid ? a(d).jqgrid("settreerow", l[h], l) : a(d).jqgrid("setrowdata", l[h], l), b[d.p.id].closeafteredit && a.jgrid.hidemodal("#" + a.jgrid.jqid(q.themodal), { gb: "#gbox_" + a.jgrid.jqid(v), jqm: c.jqmodal, onclose: b[d.p.id].onclose })), a.isfunction(b[d.p.id].aftercomplete) && (e = f, settimeout(function () { a(d).triggerhandler("jqgridaddeditaftercomplete", [e, l, a("#" + g), b]); b[d.p.id].aftercomplete.call(d, e, l, a("#" + g), b); e = null }, 500)), b[d.p.id].checkonsubmit || b[d.p.id].checkonupdate) if (a("#" + g).data("disabled", !1), "_empty" !== b[d.p.id]._saveddata[d.p.id + "_id"]) for (s in b[d.p.id]._saveddata) b[d.p.id]._saveddata.hasownproperty(s) && l[s] && (b[d.p.id]._saveddata[s] = l[s]); b[d.p.id].processing = !1; a("#sdata", p + "_2").removeclass("ui-state-active"); try { a(":input:visible", "#" + g)[0].focus() } catch (t) { } } }, a.jgrid.ajaxoptions, b[d.p.id].ajaxeditoptions); s.url || b[d.p.id].usedataproxy || (a.isfunction(d.p.dataproxy) ? b[d.p.id].usedataproxy = !0 : (n[0] = !1, n[1] += " " + a.jgrid.errors.nourl)); n[0] && (b[d.p.id].usedataproxy ? (f = d.p.dataproxy.call(d, s, "set_" + d.p.id), void 0 === f && (f = [!0, ""]), !1 === f[0] ? (n[0] = !1, n[1] = f[1] || "error deleting the selected row!") : (s.data.oper === k.addoper && b[d.p.id].closeafteradd && a.jgrid.hidemodal("#" + a.jgrid.jqid(q.themodal), { gb: "#gbox_" + a.jgrid.jqid(v), jqm: c.jqmodal, onclose: b[d.p.id].onclose }), s.data.oper === k.editoper && b[d.p.id].closeafteredit && a.jgrid.hidemodal("#" + a.jgrid.jqid(q.themodal), { gb: "#gbox_" + a.jgrid.jqid(v), jqm: c.jqmodal, onclose: b[d.p.id].onclose }))) : a.ajax(s)) } !1 === n[0] && (a("#formerror>td", p).html(n[1]), a("#formerror", p).show()) } function r(a, b) { var c = !1, d; for (d in a) if (a.hasownproperty(d) && a[d] != b[d]) { c = !0; break } return c } function f() { var c = !0; a("#formerror", p).hide(); b[d.p.id].checkonupdate && (l = {}, e(), m = r(l, b[d.p.id]._saveddata)) && (a("#" + g).data("disabled", !0), a(".confirm", "#" + q.themodal).show(), c = !1); return c } function k() { var b; if ("_empty" !== z && void 0 !== d.p.savedrow && 0 < d.p.savedrow.length && a.isfunction(a.fn.jqgrid.restorerow)) for (b = 0; b < d.p.savedrow.length; b++) if (d.p.savedrow[b].id == z) { a(d).jqgrid("restorerow", z); break } } function u(b, c) { var d = c[1].length - 1; 0 === b ? a("#pdata", p + "_2").addclass("ui-state-disabled") : void 0 !== c[1][b - 1] && a("#" + a.jgrid.jqid(c[1][b - 1])).hasclass("ui-state-disabled") ? a("#pdata", p + "_2").addclass("ui-state-disabled") : a("#pdata", p + "_2").removeclass("ui-state-disabled"); b === d ? a("#ndata", p + "_2").addclass("ui-state-disabled") : void 0 !== c[1][b + 1] && a("#" + a.jgrid.jqid(c[1][b + 1])).hasclass("ui-state-disabled") ? a("#ndata", p + "_2").addclass("ui-state-disabled") : a("#ndata", p + "_2").removeclass("ui-state-disabled") } function x() { var b = a(d).jqgrid("getdataids"), c = a("#id_g", p).val(); return [a.inarray(c, b), b] } var d = this; if (d.grid && z) { var v = d.p.id, g = "frmgrid_" + v, m = "tblgrid_" + v, p = "#" + a.jgrid.jqid(m), q = { themodal: "editmod" + v, modalhead: "edithd" + v, modalcontent: "editcnt" + v, scrollelm: g }, y = a.isfunction(b[d.p.id].beforeshowform) ? b[d.p.id].beforeshowform : !1, d = a.isfunction(b[d.p.id].aftershowform) ? b[d.p.id].aftershowform : !1, a = a.isfunction(b[d.p.id].beforeinitdata) ? b[d.p.id].beforeinitdata : !1, e = a.isfunction(b[d.p.id].oninitializeform) ? b[d.p.id].oninitializeform : !1, n = !0, c = 1, i = 0, l, m, b, g = a.jgrid.jqid(g); "new" === z ? (z = "_empty", b = "add", c.caption = b[d.p.id].addcaption) : (c.caption = b[d.p.id].editcaption, b = "edit"); c.recreateform || a(d).data("formprop") && a.extend(b[a(this)[0].p.id], a(d).data("formprop")); var n = !0; c.checkonupdate && c.jqmodal && !c.modal && (n = !1); var h = isnan(b[a(this)[0].p.id].dataheight) ? b[a(this)[0].p.id].dataheight : b[a(this)[0].p.id].dataheight + "px", n = isnan(b[a(this)[0].p.id].datawidth) ? b[a(this)[0].p.id].datawidth : b[a(this)[0].p.id].datawidth + "px", h = a("
").data("disabled", !1), f = a("
"), n = a(d).triggerhandler("jqgridaddeditbeforeinitdata", [a("#" + g), b]); void 0 === n && (n = !0); n && a && (n = a.call(d, a("#" + g), b)); if (!1 !== n) { k(); a(d.p.colmodel).each(function () { var a = this.formoptions; c = math.max(c, a ? a.colpos || 0 : 0); i = math.max(i, a ? a.rowpos || 0 : 0) }); a(h).append(f); a = a(""); a[0].rp = 0; a(f).append(a); a = a("" + b[d.p.id].topinfo + ""); a[0].rp = 0; a(f).append(a); var n = (a = "rtl" === d.p.direction ? !0 : !1) ? "ndata" : "pdata", g = a ? "pdata" : "ndata"; h(z, d, f, c); var n = "", g = "", j = "" + c.bsubmit + "", k = "" + c.bcancel + "", m = "" + (""), m = m + "

" + j + k + "
"; if (0 < i) { var l = []; a.each(a(f)[0].rows, function (a, b) { l[a] = b }); l.sort(function (a, b) { return a.rp > b.rp ? 1 : a.rp < b.rp ? -1 : 0 }); a.each(l, function (b, c) { a("tbody", f).append(c) }) } c.gbox = "#gbox_" + a.jgrid.jqid(v); var o = !1; !0 === c.closeonescape && (c.closeonescape = !1, o = !0); m = a("
").append(h).append(m); a.jgrid.createmodal(q, m, b[a(this)[0].p.id], "#gview_" + a.jgrid.jqid(d.p.id), a("#gbox_" + a.jgrid.jqid(d.p.id))[0]); a && (a("#pdata, #ndata", p + "_2").css("float", "right"), a(".editbutton", p + "_2").css("text-align", "left")); b[d.p.id].topinfo && a(".tinfo", p).show(); b[d.p.id].bottominfo && a(".binfo", p + "_2").show(); m = m = null; a("#" + a.jgrid.jqid(q.themodal)).keydown(function (e) { var n = e.target; if (!0 === a("#" + g).data("disabled")) return !1; if (!0 === b[d.p.id].savekey[0] && e.which === b[d.p.id].savekey[1] && "textarea" !== n.tagname) return a("#sdata", p + "_2").trigger("click"), !1; if (27 === e.which) { if (!f()) return !1; o && a.jgrid.hidemodal("#" + a.jgrid.jqid(q.themodal), { gb: c.gbox, jqm: c.jqmodal, onclose: b[d.p.id].onclose }); return !1 } if (!0 === b[d.p.id].navkeys[0]) { if ("_empty" === a("#id_g", p).val()) return !0; if (e.which === b[d.p.id].navkeys[1]) return a("#pdata", p + "_2").trigger("click"), !1; if (e.which === b[d.p.id].navkeys[2]) return a("#ndata", p + "_2").trigger("click"), !1 } }); c.checkonupdate && (a("a.ui-jqdialog-titlebar-close span", "#" + a.jgrid.jqid(q.themodal)).removeclass("jqmclose"), a("a.ui-jqdialog-titlebar-close", "#" + a.jgrid.jqid(q.themodal)).unbind("click").click(function () { if (!f()) return !1; a.jgrid.hidemodal("#" + a.jgrid.jqid(q.themodal), { gb: "#gbox_" + a.jgrid.jqid(v), jqm: c.jqmodal, onclose: b[d.p.id].onclose }); return !1 })); c.saveicon = a.extend([!0, "left", "ui-icon-disk"], c.saveicon); c.closeicon = a.extend([!0, "left", "ui-icon-close"], c.closeicon); !0 === c.saveicon[0] && a("#sdata", p + "_2").addclass("right" === c.saveicon[1] ? "fm-button-icon-right" : "fm-button-icon-left").append(""); !0 === c.closeicon[0] && a("#cdata", p + "_2").addclass("right" === c.closeicon[1] ? "fm-button-icon-right" : "fm-button-icon-left").append(""); if (b[d.p.id].checkonsubmit || b[d.p.id].checkonupdate) j = "" + c.byes + "", g = "" + c.bno + "", k = "" + c.bexit + "", m = c.zindex || 999, m++, a("
" + c.savedata + "

" + j + g + k + "
").insertafter("#" + g), a("#snew", "#" + a.jgrid.jqid(q.themodal)).click(function () { s(); a("#" + g).data("disabled", !1); a(".confirm", "#" + a.jgrid.jqid(q.themodal)).hide(); return !1 }), a("#nnew", "#" + a.jgrid.jqid(q.themodal)).click(function () { a(".confirm", "#" + a.jgrid.jqid(q.themodal)).hide(); a("#" + g).data("disabled", !1); settimeout(function () { a(":input:visible", "#" + g)[0].focus() }, 0); return !1 }), a("#cnew", "#" + a.jgrid.jqid(q.themodal)).click(function () { a(".confirm", "#" + a.jgrid.jqid(q.themodal)).hide(); a("#" + g).data("disabled", !1); a.jgrid.hidemodal("#" + a.jgrid.jqid(q.themodal), { gb: "#gbox_" + a.jgrid.jqid(v), jqm: c.jqmodal, onclose: b[d.p.id].onclose }); return !1 }); a(d).triggerhandler("jqgridaddeditinitializeform", [a("#" + g), b]); e && e.call(d, a("#" + g), b); "_empty" !== z && b[d.p.id].viewpagerbuttons ? a("#pdata,#ndata", p + "_2").show() : a("#pdata,#ndata", p + "_2").hide(); a(d).triggerhandler("jqgridaddeditbeforeshowform", [a("#" + g), b]); y && y.call(d, a("#" + g), b); a("#" + a.jgrid.jqid(q.themodal)).data("onclose", b[d.p.id].onclose); a.jgrid.viewmodal("#" + a.jgrid.jqid(q.themodal), { gbox: "#gbox_" + a.jgrid.jqid(v), jqm: c.jqmodal, overlay: c.overlay, modal: c.modal, overlayclass: c.overlayclass, onhide: function (b) { a(d).data("formprop", { top: parsefloat(a(b.w).css("top")), left: parsefloat(a(b.w).css("left")), width: a(b.w).width(), height: a(b.w).height(), dataheight: a("#" + g).height(), datawidth: a("#" + g).width() }); b.w.remove(); b.o && b.o.remove() } }); n || a("." + a.jgrid.jqid(c.overlayclass)).click(function () { if (!f()) return !1; a.jgrid.hidemodal("#" + a.jgrid.jqid(q.themodal), { gb: "#gbox_" + a.jgrid.jqid(v), jqm: c.jqmodal, onclose: b[d.p.id].onclose }); return !1 }); a(".fm-button", "#" + a.jgrid.jqid(q.themodal)).hover(function () { a(this).addclass("ui-state-hover") }, function () { a(this).removeclass("ui-state-hover") }); a("#sdata", p + "_2").click(function () { l = {}; a("#formerror", p).hide(); e(); "_empty" === l[d.p.id + "_id"] ? s() : !0 === c.checkonsubmit ? (m = r(l, b[d.p.id]._saveddata)) ? (a("#" + g).data("disabled", !0), a(".confirm", "#" + a.jgrid.jqid(q.themodal)).show()) : s() : s(); return !1 }); a("#cdata", p + "_2").click(function () { if (!f()) return !1; a.jgrid.hidemodal("#" + a.jgrid.jqid(q.themodal), { gb: "#gbox_" + a.jgrid.jqid(v), jqm: c.jqmodal, onclose: b[d.p.id].onclose }); return !1 }); a("#ndata", p + "_2").click(function () { if (!f()) return !1; a("#formerror", p).hide(); var b = x(); b[0] = parseint(b[0], 10); if (-1 !== b[0] && b[1][b[0] + 1]) { a(d).triggerhandler("jqgridaddeditclickpgbuttons", ["next", a("#" + g), b[1][b[0]]]); var e; if (a.isfunction(c.onclickpgbuttons) && (e = c.onclickpgbuttons.call(d, "next", a("#" + g), b[1][b[0]]), void 0 !== e && !1 === e) || a("#" + a.jgrid.jqid(b[1][b[0] + 1])).hasclass("ui-state-disabled")) return !1; w(b[1][b[0] + 1], d, g); a(d).jqgrid("setselection", b[1][b[0] + 1]); a(d).triggerhandler("jqgridaddeditafterclickpgbuttons", ["next", a("#" + g), b[1][b[0]]]); a.isfunction(c.afterclickpgbuttons) && c.afterclickpgbuttons.call(d, "next", a("#" + g), b[1][b[0] + 1]); u(b[0] + 1, b) } return !1 }); a("#pdata", p + "_2").click(function () { if (!f()) return !1; a("#formerror", p).hide(); var b = x(); if (-1 !== b[0] && b[1][b[0] - 1]) { a(d).triggerhandler("jqgridaddeditclickpgbuttons", ["prev", a("#" + g), b[1][b[0]]]); var e; if (a.isfunction(c.onclickpgbuttons) && (e = c.onclickpgbuttons.call(d, "prev", a("#" + g), b[1][b[0]]), void 0 !== e && !1 === e) || a("#" + a.jgrid.jqid(b[1][b[0] - 1])).hasclass("ui-state-disabled")) return !1; w(b[1][b[0] - 1], d, g); a(d).jqgrid("setselection", b[1][b[0] - 1]); a(d).triggerhandler("jqgridaddeditafterclickpgbuttons", ["prev", a("#" + g), b[1][b[0]]]); a.isfunction(c.afterclickpgbuttons) && c.afterclickpgbuttons.call(d, "prev", a("#" + g), b[1][b[0] - 1]); u(b[0] - 1, b) } return !1 }); a(d).triggerhandler("jqgridaddeditaftershowform", [a("#" + g), b]); d && d.call(d, a("#" + g), b); y = x(); u(y[0], y) } } }) }, viewgridrow: function (z, c) { c = a.extend(!0, { top: 0, left: 0, width: 0, datawidth: "auto", height: "auto", dataheight: "auto", modal: !1, overlay: 30, drag: !0, resize: !0, jqmodal: !0, closeonescape: !1, labelswidth: "30%", closeicon: [], navkeys: [!1, 38, 40], onclose: null, beforeshowform: null, beforeinitdata: null, viewpagerbuttons: !0, recreateform: !1 }, a.jgrid.view, c || {}); b[a(this)[0].p.id] = c; return this.each(function () { function e() { !0 !== b[r.p.id].closeonescape && !0 !== b[r.p.id].navkeys[0] || settimeout(function () { a(".ui-jqdialog-titlebar-close", "#" + a.jgrid.jqid(v.modalhead)).focus() }, 0) } function h(b, d, e, f) { var g, k, h, q = 0, m, p, r = [], s = !1, t, u = "  ", y = "", z = ["integer", "number", "currency"], v = 0, w = 0, a, x, d; for (t = 1; t <= f; t++) y += 1 === t ? u : "  "; a(d.p.colmodel).each(function () { (k = this.editrules && !0 === this.editrules.edithidden ? !1 : !0 === this.hidden ? !0 : !1) || "right" !== this.align || (this.formatter && -1 !== a.inarray(this.formatter, z) ? v = math.max(v, parseint(this.width, 10)) : w = math.max(w, parseint(this.width, 10))) }); a = 0 !== v ? v : 0 !== w ? w : 0; s = a(d).jqgrid("getind", b); a(d.p.colmodel).each(function (b) { g = this.name; x = !1; p = (k = this.editrules && !0 === this.editrules.edithidden ? !1 : !0 === this.hidden ? !0 : !1) ? "style='display:none'" : ""; d = "boolean" !== typeof this.viewable ? !0 : this.viewable; if ("cb" !== g && "subgrid" !== g && "rn" !== g && d) { m = !1 === s ? "" : g === d.p.expandcolumn && !0 === d.p.treegrid ? a("td:eq(" + b + ")", d.rows[s]).text() : a("td:eq(" + b + ")", d.rows[s]).html(); x = "right" === this.align && 0 !== a ? !0 : !1; var c = a.extend({}, { rowabove: !1, rowcontent: "" }, this.formoptions || {}), n = parseint(c.rowpos, 10) || q + 1, t = parseint(2 * (parseint(c.colpos, 10) || 1), 10); if (c.rowabove) { var u = a("" + c.rowcontent + ""); a(e).append(u); u[0].rp = n } h = a(e).find("tr[rowpos=" + n + "]"); 0 === h.length && (h = a("").addclass("formdata").attr("id", "trv_" + g), a(h).append(y), a(e).append(h), h[0].rp = n); a("td:eq(" + (t - 2) + ")", h[0]).html("" + (void 0 === c.label ? d.p.colnames[b] : c.label) + ""); a("td:eq(" + (t - 1) + ")", h[0]).append("" + m + "").attr("id", "v_" + g); x && a("td:eq(" + (t - 1) + ") span", h[0]).css({ "text-align": "right", width: a + "px" }); r[q] = b; q++ } }); 0 < q && (b = a(""), b[0].rp = q + 99, a(e).append(b)); return r } function w(b, c) { var d, e, f = 0, g, k; if (k = a(c).jqgrid("getind", b, !0)) a("td", k).each(function (b) { d = c.p.colmodel[b].name; e = c.p.colmodel[b].editrules && !0 === c.p.colmodel[b].editrules.edithidden ? !1 : !0 === c.p.colmodel[b].hidden ? !0 : !1; "cb" !== d && "subgrid" !== d && "rn" !== d && (g = d === c.p.expandcolumn && !0 === c.p.treegrid ? a(this).text() : a(this).html(), d = a.jgrid.jqid("v_" + d), a("#" + d + " span", "#" + u).html(g), e && a("#" + d, "#" + u).parents("tr:first").hide(), f++) }), 0 < f && a("#id_g", "#" + u).val(b) } function t(b, c) { var d = c[1].length - 1; 0 === b ? a("#pdata", "#" + u + "_2").addclass("ui-state-disabled") : void 0 !== c[1][b - 1] && a("#" + a.jgrid.jqid(c[1][b - 1])).hasclass("ui-state-disabled") ? a("#pdata", u + "_2").addclass("ui-state-disabled") : a("#pdata", "#" + u + "_2").removeclass("ui-state-disabled"); b === d ? a("#ndata", "#" + u + "_2").addclass("ui-state-disabled") : void 0 !== c[1][b + 1] && a("#" + a.jgrid.jqid(c[1][b + 1])).hasclass("ui-state-disabled") ? a("#ndata", u + "_2").addclass("ui-state-disabled") : a("#ndata", "#" + u + "_2").removeclass("ui-state-disabled") } function s() { var b = a(r).jqgrid("getdataids"), c = a("#id_g", "#" + u).val(); return [a.inarray(c, b), b] } var r = this; if (r.grid && z) { var f = r.p.id, k = "viewgrid_" + a.jgrid.jqid(f), u = "viewtbl_" + a.jgrid.jqid(f), x = "viewgrid_" + f, d = "viewtbl_" + f, v = { themodal: "viewmod" + f, modalhead: "viewhd" + f, modalcontent: "viewcnt" + f, scrollelm: k }, g = a.isfunction(b[r.p.id].beforeinitdata) ? b[r.p.id].beforeinitdata : !1, m = !0, p = 1, q = 0; c.recreateform || a(r).data("viewprop") && a.extend(b[a(this)[0].p.id], a(r).data("viewprop")); var y = isnan(b[a(this)[0].p.id].dataheight) ? b[a(this)[0].p.id].dataheight : b[a(this)[0].p.id].dataheight + "px", d = isnan(b[a(this)[0].p.id].datawidth) ? b[a(this)[0].p.id].datawidth : b[a(this)[0].p.id].datawidth + "px", x = a("
"), a = a("
"); g && (m = g.call(r, a("#" + k)), void 0 === m && (m = !0)); if (!1 !== m) { a(r.p.colmodel).each(function () { var a = this.formoptions; p = math.max(p, a ? a.colpos || 0 : 0); q = math.max(q, a ? a.rowpos || 0 : 0) }); a(x).append(a); h(z, r, a, p); d = "rtl" === r.p.direction ? !0 : !1; g = ""; m = ""; y = "" + c.bclose + ""; if (0 < q) { var e = []; a.each(a(a)[0].rows, function (a, b) { e[a] = b }); e.sort(function (a, b) { return a.rp > b.rp ? 1 : a.rp < b.rp ? -1 : 0 }); a.each(e, function (b, c) { a("tbody", a).append(c) }) } c.gbox = "#gbox_" + a.jgrid.jqid(f); x = a("
").append(x).append("
" + y + "
"); a.jgrid.createmodal(v, x, c, "#gview_" + a.jgrid.jqid(r.p.id), a("#gview_" + a.jgrid.jqid(r.p.id))[0]); d && (a("#pdata, #ndata", "#" + u + "_2").css("float", "right"), a(".editbutton", "#" + u + "_2").css("text-align", "left")); c.viewpagerbuttons || a("#pdata, #ndata", "#" + u + "_2").hide(); x = null; a("#" + v.themodal).keydown(function (d) { if (27 === d.which) return b[r.p.id].closeonescape && a.jgrid.hidemodal("#" + a.jgrid.jqid(v.themodal), { gb: c.gbox, jqm: c.jqmodal, onclose: c.onclose }), !1; if (!0 === c.navkeys[0]) { if (d.which === c.navkeys[1]) return a("#pdata", "#" + u + "_2").trigger("click"), !1; if (d.which === c.navkeys[2]) return a("#ndata", "#" + u + "_2").trigger("click"), !1 } }); c.closeicon = a.extend([!0, "left", "ui-icon-close"], c.closeicon); !0 === c.closeicon[0] && a("#cdata", "#" + u + "_2").addclass("right" === c.closeicon[1] ? "fm-button-icon-right" : "fm-button-icon-left").append(""); a.isfunction(c.beforeshowform) && c.beforeshowform.call(r, a("#" + k)); a.jgrid.viewmodal("#" + a.jgrid.jqid(v.themodal), { gbox: "#gbox_" + a.jgrid.jqid(f), jqm: c.jqmodal, overlay: c.overlay, modal: c.modal, onhide: function (b) { a(r).data("viewprop", { top: parsefloat(a(b.w).css("top")), left: parsefloat(a(b.w).css("left")), width: a(b.w).width(), height: a(b.w).height(), dataheight: a("#" + k).height(), datawidth: a("#" + k).width() }); b.w.remove(); b.o && b.o.remove() } }); a(".fm-button:not(.ui-state-disabled)", "#" + u + "_2").hover(function () { a(this).addclass("ui-state-hover") }, function () { a(this).removeclass("ui-state-hover") }); e(); a("#cdata", "#" + u + "_2").click(function () { a.jgrid.hidemodal("#" + a.jgrid.jqid(v.themodal), { gb: "#gbox_" + a.jgrid.jqid(f), jqm: c.jqmodal, onclose: c.onclose }); return !1 }); a("#ndata", "#" + u + "_2").click(function () { a("#formerror", "#" + u).hide(); var b = s(); b[0] = parseint(b[0], 10); -1 !== b[0] && b[1][b[0] + 1] && (a.isfunction(c.onclickpgbuttons) && c.onclickpgbuttons.call(r, "next", a("#" + k), b[1][b[0]]), w(b[1][b[0] + 1], r), a(r).jqgrid("setselection", b[1][b[0] + 1]), a.isfunction(c.afterclickpgbuttons) && c.afterclickpgbuttons.call(r, "next", a("#" + k), b[1][b[0] + 1]), t(b[0] + 1, b)); e(); return !1 }); a("#pdata", "#" + u + "_2").click(function () { a("#formerror", "#" + u).hide(); var b = s(); -1 !== b[0] && b[1][b[0] - 1] && (a.isfunction(c.onclickpgbuttons) && c.onclickpgbuttons.call(r, "prev", a("#" + k), b[1][b[0]]), w(b[1][b[0] - 1], r), a(r).jqgrid("setselection", b[1][b[0] - 1]), a.isfunction(c.afterclickpgbuttons) && c.afterclickpgbuttons.call(r, "prev", a("#" + k), b[1][b[0] - 1]), t(b[0] - 1, b)); e(); return !1 }); x = s(); t(x[0], x) } } }) }, delgridrow: function (z, c) { c = a.extend(!0, { top: 0, left: 0, width: 240, height: "auto", dataheight: "auto", modal: !1, overlay: 30, drag: !0, resize: !0, url: "", mtype: "post", reloadaftersubmit: !0, beforeshowform: null, beforeinitdata: null, aftershowform: null, beforesubmit: null, onclicksubmit: null, aftersubmit: null, jqmodal: !0, closeonescape: !1, deldata: {}, delicon: [], cancelicon: [], onclose: null, ajaxdeloptions: {}, processing: !1, serializedeldata: null, usedataproxy: !1 }, a.jgrid.del, c || {}); b[a(this)[0].p.id] = c; return this.each(function () { var e = this; if (e.grid && z) { var h = a.isfunction(b[e.p.id].beforeshowform), w = a.isfunction(b[e.p.id].aftershowform), t = a.isfunction(b[e.p.id].beforeinitdata) ? b[e.p.id].beforeinitdata : !1, s = e.p.id, r = {}, f = !0, k = "deltbl_" + a.jgrid.jqid(s), u, x, d, v, g = "deltbl_" + s, m = { themodal: "delmod" + s, modalhead: "delhd" + s, modalcontent: "delcnt" + s, scrollelm: k }; a.isarray(z) && (z = z.join()); if (void 0 !== a("#" + a.jgrid.jqid(m.themodal))[0]) { t && (f = t.call(e, a("#" + k)), void 0 === f && (f = !0)); if (!1 === f) return; a("#deldata>td", "#" + k).text(z); a("#delerror", "#" + k).hide(); !0 === b[e.p.id].processing && (b[e.p.id].processing = !1, a("#ddata", "#" + k).removeclass("ui-state-active")); h && b[e.p.id].beforeshowform.call(e, a("#" + k)); a.jgrid.viewmodal("#" + a.jgrid.jqid(m.themodal), { gbox: "#gbox_" + a.jgrid.jqid(s), jqm: b[e.p.id].jqmodal, jqm: !1, overlay: b[e.p.id].overlay, modal: b[e.p.id].modal }) } else { var p = isnan(b[e.p.id].dataheight) ? b[e.p.id].dataheight : b[e.p.id].dataheight + "px", q = isnan(c.datawidth) ? c.datawidth : c.datawidth + "px", g = "
", g = g + "", g = g + (""), g = g + ('"), g = g + "
' + b[e.p.id].msg + "
 
", g = g + ("

" + ("" + c.bsubmit + "") + " " + ("" + c.bcancel + "") + "
"); c.gbox = "#gbox_" + a.jgrid.jqid(s); a.jgrid.createmodal(m, g, c, "#gview_" + a.jgrid.jqid(e.p.id), a("#gview_" + a.jgrid.jqid(e.p.id))[0]); t && (f = t.call(e, a("#" + k)), void 0 === f && (f = !0)); if (!1 === f) return; a(".fm-button", "#" + k + "_2").hover(function () { a(this).addclass("ui-state-hover") }, function () { a(this).removeclass("ui-state-hover") }); c.delicon = a.extend([!0, "left", "ui-icon-scissors"], b[e.p.id].delicon); c.cancelicon = a.extend([!0, "left", "ui-icon-cancel"], b[e.p.id].cancelicon); !0 === c.delicon[0] && a("#ddata", "#" + k + "_2").addclass("right" === c.delicon[1] ? "fm-button-icon-right" : "fm-button-icon-left").append(""); !0 === c.cancelicon[0] && a("#edata", "#" + k + "_2").addclass("right" === c.cancelicon[1] ? "fm-button-icon-right" : "fm-button-icon-left").append(""); a("#ddata", "#" + k + "_2").click(function () { var f = [!0, ""], g, h = a("#deldata>td", "#" + k).text(); r = {}; a.isfunction(b[e.p.id].onclicksubmit) && (r = b[e.p.id].onclicksubmit.call(e, b[e.p.id], h) || {}); a.isfunction(b[e.p.id].beforesubmit) && (f = b[e.p.id].beforesubmit.call(e, h)); if (f[0] && !b[e.p.id].processing) { b[e.p.id].processing = !0; d = e.p.prmnames; u = a.extend({}, b[e.p.id].deldata, r); v = d.oper; u[v] = d.deloper; x = d.id; h = string(h).split(","); if (!h.length) return !1; for (g in h) h.hasownproperty(g) && (h[g] = a.jgrid.strippref(e.p.idprefix, h[g])); u[x] = h.join(); a(this).addclass("ui-state-active"); g = a.extend({ url: b[e.p.id].url || a(e).jqgrid("getgridparam", "editurl"), type: b[e.p.id].mtype, data: a.isfunction(b[e.p.id].serializedeldata) ? b[e.p.id].serializedeldata.call(e, u) : u, complete: function (d, g) { var q; 300 <= d.status && 304 !== d.status ? (f[0] = !1, a.isfunction(b[e.p.id].errortextformat) ? f[1] = b[e.p.id].errortextformat.call(e, d) : f[1] = g + " status: '" + d.statustext + "'. error code: " + d.status) : a.isfunction(b[e.p.id].aftersubmit) && (f = b[e.p.id].aftersubmit.call(e, d, u)); if (!1 === f[0]) a("#delerror>td", "#" + k).html(f[1]), a("#delerror", "#" + k).show(); else { if (b[e.p.id].reloadaftersubmit && "local" !== e.p.datatype) a(e).trigger("reloadgrid"); else { if (!0 === e.p.treegrid) try { a(e).jqgrid("deltreenode", e.p.idprefix + h[0]) } catch (p) { } else for (q = 0; q < h.length; q++) a(e).jqgrid("delrowdata", e.p.idprefix + h[q]); e.p.selrow = null; e.p.selarrrow = [] } a.isfunction(b[e.p.id].aftercomplete) && settimeout(function () { b[e.p.id].aftercomplete.call(e, d, h) }, 500) } b[e.p.id].processing = !1; a("#ddata", "#" + k + "_2").removeclass("ui-state-active"); f[0] && a.jgrid.hidemodal("#" + a.jgrid.jqid(m.themodal), { gb: "#gbox_" + a.jgrid.jqid(s), jqm: c.jqmodal, onclose: b[e.p.id].onclose }) } }, a.jgrid.ajaxoptions, b[e.p.id].ajaxdeloptions); g.url || b[e.p.id].usedataproxy || (a.isfunction(e.p.dataproxy) ? b[e.p.id].usedataproxy = !0 : (f[0] = !1, f[1] += " " + a.jgrid.errors.nourl)); f[0] && (b[e.p.id].usedataproxy ? (g = e.p.dataproxy.call(e, g, "del_" + e.p.id), void 0 === g && (g = [!0, ""]), !1 === g[0] ? (f[0] = !1, f[1] = g[1] || "error deleting the selected row!") : a.jgrid.hidemodal("#" + a.jgrid.jqid(m.themodal), { gb: "#gbox_" + a.jgrid.jqid(s), jqm: c.jqmodal, onclose: b[e.p.id].onclose })) : a.ajax(g)) } !1 === f[0] && (a("#delerror>td", "#" + k).html(f[1]), a("#delerror", "#" + k).show()); return !1 }); a("#edata", "#" + k + "_2").click(function () { a.jgrid.hidemodal("#" + a.jgrid.jqid(m.themodal), { gb: "#gbox_" + a.jgrid.jqid(s), jqm: b[e.p.id].jqmodal, onclose: b[e.p.id].onclose }); return !1 }); h && b[e.p.id].beforeshowform.call(e, a("#" + k)); a.jgrid.viewmodal("#" + a.jgrid.jqid(m.themodal), { gbox: "#gbox_" + a.jgrid.jqid(s), jqm: b[e.p.id].jqmodal, overlay: b[e.p.id].overlay, modal: b[e.p.id].modal }) } w && b[e.p.id].aftershowform.call(e, a("#" + k)); !0 === b[e.p.id].closeonescape && settimeout(function () { a(".ui-jqdialog-titlebar-close", "#" + a.jgrid.jqid(m.modalhead)).focus() }, 0) } }) }, navgrid: function (b, c, e, h, w, t, s) { c = a.extend({ edit: !0, editicon: "ui-icon-pencil", add: !0, addicon: "ui-icon-plus", del: !0, delicon: "ui-icon-trash", search: !0, searchicon: "ui-icon-search", refresh: !0, refreshicon: "ui-icon-refresh", refreshstate: "firstpage", view: !1, viewicon: "ui-icon-document", position: "left", closeonescape: !0, beforerefresh: null, afterrefresh: null, clonetotop: !1, alertwidth: 200, alertheight: "auto", alerttop: null, alertleft: null, alertzindex: null }, a.jgrid.nav, c || {}); return this.each(function () { if (!this.nav) { var r = { themodal: "alertmod_" + this.p.id, modalhead: "alerthd_" + this.p.id, modalcontent: "alertcnt_" + this.p.id }, f = this, k; if (f.grid && "string" === typeof b) { void 0 === a("#" + r.themodal)[0] && (c.alerttop || c.alertleft || (void 0 !== window.innerwidth ? (c.alertleft = window.innerwidth, c.alerttop = window.innerheight) : void 0 !== document.documentelement && void 0 !== document.documentelement.clientwidth && 0 !== document.documentelement.clientwidth ? (c.alertleft = document.documentelement.clientwidth, c.alerttop = document.documentelement.clientheight) : (c.alertleft = 1024, c.alerttop = 768), c.alertleft = c.alertleft / 2 - parseint(c.alertwidth, 10) / 2, c.alerttop = c.alerttop / 2 - 25), a.jgrid.createmodal(r, "
" + c.alerttext + "
", { gbox: "#gbox_" + a.jgrid.jqid(f.p.id), jqmodal: !0, drag: !0, resize: !0, caption: c.alertcap, top: c.alerttop, left: c.alertleft, width: c.alertwidth, height: c.alertheight, closeonescape: c.closeonescape, zindex: c.alertzindex }, "#gview_" + a.jgrid.jqid(f.p.id), a("#gbox_" + a.jgrid.jqid(f.p.id))[0], !0)); var u = 1, x, d = function () { a(this).hasclass("ui-state-disabled") || a(this).addclass("ui-state-hover") }, v = function () { a(this).removeclass("ui-state-hover") }; c.clonetotop && f.p.toppager && (u = 2); for (x = 0; x < u; x++) { var g = a(""), m, p; 0 === x ? (m = b, p = f.p.id, m === f.p.toppager && (p += "_top", u = 1)) : (m = f.p.toppager, p = f.p.id + "_top"); "rtl" === f.p.direction && a(g).attr("dir", "rtl").css("float", "right"); c.add && (h = h || {}, k = a(""), a(k).append("
" + c.addtext + "
"), a("tr", g).append(k), a(k, g).attr({ title: c.addtitle || "", id: h.id || "add_" + p }).click(function () { a(this).hasclass("ui-state-disabled") || (a.isfunction(c.addfunc) ? c.addfunc.call(f) : a(f).jqgrid("editgridrow", "new", h)); return !1 }).hover(d, v), k = null); c.edit && (k = a(""), e = e || {}, a(k).append("
" + c.edittext + "
"), a("tr", g).append(k), a(k, g).attr({ title: c.edittitle || "", id: e.id || "edit_" + p }).click(function () { if (!a(this).hasclass("ui-state-disabled")) { var b = f.p.selrow; b ? a.isfunction(c.editfunc) ? c.editfunc.call(f, b) : a(f).jqgrid("editgridrow", b, e) : (a.jgrid.viewmodal("#" + r.themodal, { gbox: "#gbox_" + a.jgrid.jqid(f.p.id), jqm: !0 }), a("#jqg_alrt").focus()) } return !1 }).hover(d, v), k = null); c.view && (k = a(""), s = s || {}, a(k).append("
" + c.viewtext + "
"), a("tr", g).append(k), a(k, g).attr({ title: c.viewtitle || "", id: s.id || "view_" + p }).click(function () { if (!a(this).hasclass("ui-state-disabled")) { var b = f.p.selrow; b ? a.isfunction(c.viewfunc) ? c.viewfunc.call(f, b) : a(f).jqgrid("viewgridrow", b, s) : (a.jgrid.viewmodal("#" + r.themodal, { gbox: "#gbox_" + a.jgrid.jqid(f.p.id), jqm: !0 }), a("#jqg_alrt").focus()) } return !1 }).hover(d, v), k = null); c.del && (k = a(""), w = w || {}, a(k).append("
" + c.deltext + "
"), a("tr", g).append(k), a(k, g).attr({ title: c.deltitle || "", id: w.id || "del_" + p }).click(function () { if (!a(this).hasclass("ui-state-disabled")) { var b; f.p.multiselect ? (b = f.p.selarrrow, 0 === b.length && (b = null)) : b = f.p.selrow; b ? a.isfunction(c.delfunc) ? c.delfunc.call(f, b) : a(f).jqgrid("delgridrow", b, w) : (a.jgrid.viewmodal("#" + r.themodal, { gbox: "#gbox_" + a.jgrid.jqid(f.p.id), jqm: !0 }), a("#jqg_alrt").focus()) } return !1 }).hover(d, v), k = null); (c.add || c.edit || c.del || c.view) && a("tr", g).append(""); c.search && (k = a(""), t = t || {}, a(k).append("
" + c.searchtext + "
"), a("tr", g).append(k), a(k, g).attr({ title: c.searchtitle || "", id: t.id || "search_" + p }).click(function () { a(this).hasclass("ui-state-disabled") || (a.isfunction(c.searchfunc) ? c.searchfunc.call(f, t) : a(f).jqgrid("searchgrid", t)); return !1 }).hover(d, v), t.showonload && !0 === t.showonload && a(k, g).click(), k = null); c.refresh && (k = a(""), a(k).append("
" + c.refreshtext + "
"), a("tr", g).append(k), a(k, g).attr({ title: c.refreshtitle || "", id: "refresh_" + p }).click(function () { if (!a(this).hasclass("ui-state-disabled")) { a.isfunction(c.beforerefresh) && c.beforerefresh.call(f); f.p.search = !1; f.p.resetsearch = !0; try { var b = f.p.id; f.p.postdata.filters = ""; try { a("#fbox_" + a.jgrid.jqid(b)).jqfilter("resetfilter") } catch (d) { } a.isfunction(f.cleartoolbar) && f.cleartoolbar.call(f, !1) } catch (e) { } switch (c.refreshstate) { case "firstpage": a(f).trigger("reloadgrid", [{ page: 1 }]); break; case "current": a(f).trigger("reloadgrid", [{ current: !0 }]) } a.isfunction(c.afterrefresh) && c.afterrefresh.call(f) } return !1 }).hover(d, v), k = null); k = a(".ui-jqgrid").css("font-size") || "11px"; a("body").append(""); k = a(g).clone().appendto("#testpg2").width(); a("#testpg2").remove(); a(m + "_" + c.position, m).append(g); f.p._nvtd && (k > f.p._nvtd[0] && (a(m + "_" + c.position, m).width(k), f.p._nvtd[0] = k), f.p._nvtd[1] = k); g = k = k = null; this.nav = !0 } } } }) }, navbuttonadd: function (b, c) { c = a.extend({ caption: "newbutton", title: "", buttonicon: "ui-icon-newwin", onclickbutton: null, position: "last", cursor: "pointer" }, c || {}); return this.each(function () { if (this.grid) { "string" === typeof b && 0 !== b.indexof("#") && (b = "#" + a.jgrid.jqid(b)); var e = a(".navtable", b)[0], h = this; if (e && (!c.id || void 0 === a("#" + a.jgrid.jqid(c.id), e)[0])) { var w = a(""); "none" === c.buttonicon.tostring().touppercase() ? a(w).addclass("ui-pg-button ui-corner-all").append("
" + c.caption + "
") : a(w).addclass("ui-pg-button ui-corner-all").append("
" + c.caption + "
"); c.id && a(w).attr("id", c.id); "first" === c.position ? 0 === e.rows[0].cells.length ? a("tr", e).append(w) : a("tr td:eq(0)", e).before(w) : a("tr", e).append(w); a(w, e).attr("title", c.title || "").click(function (b) { a(this).hasclass("ui-state-disabled") || a.isfunction(c.onclickbutton) && c.onclickbutton.call(h, b); return !1 }).hover(function () { a(this).hasclass("ui-state-disabled") || a(this).addclass("ui-state-hover") }, function () { a(this).removeclass("ui-state-hover") }) } } }) }, navseparatoradd: function (b, c) { c = a.extend({ sepclass: "ui-separator", sepcontent: "", position: "last" }, c || {}); return this.each(function () { if (this.grid) { "string" === typeof b && 0 !== b.indexof("#") && (b = "#" + a.jgrid.jqid(b)); var e = a(".navtable", b)[0]; if (e) { var h = "" + c.sepcontent + ""; "first" === c.position ? 0 === e.rows[0].cells.length ? a("tr", e).append(h) : a("tr td:eq(0)", e).before(h) : a("tr", e).append(h) } } }) }, gridtoform: function (b, c) { return this.each(function () { var e = this, h; if (e.grid) { var w = a(e).jqgrid("getrowdata", b); if (w) for (h in w) w.hasownproperty(h) && (a("[name=" + a.jgrid.jqid(h) + "]", c).is("input:radio") || a("[name=" + a.jgrid.jqid(h) + "]", c).is("input:checkbox") ? a("[name=" + a.jgrid.jqid(h) + "]", c).each(function () { if (a(this).val() == w[h]) a(this)[e.p.useprop ? "prop" : "attr"]("checked", !0); else a(this)[e.p.useprop ? "prop" : "attr"]("checked", !1) }) : a("[name=" + a.jgrid.jqid(h) + "]", c).val(w[h])) } }) }, formtogrid: function (b, c, e, h) { return this.each(function () { if (this.grid) { e || (e = "set"); h || (h = "first"); var w = a(c).serializearray(), t = {}; a.each(w, function (a, b) { t[b.name] = b.value }); "add" === e ? a(this).jqgrid("addrowdata", b, t, h) : "set" === e && a(this).jqgrid("setrowdata", b, t) } }) } }) })(jquery); (function (a) { a.fn.jqfilter = function (d) { if ("string" === typeof d) { var q = a.fn.jqfilter[d]; if (!q) throw "jqfilter - no such method: " + d; var x = a.makearray(arguments).slice(1); return q.apply(this, x) } var n = a.extend(!0, { filter: null, columns: [], onchange: null, afterredraw: null, checkvalues: null, error: !1, errmsg: "", errorcheck: !0, showquery: !0, sopt: null, ops: [], operands: null, numopts: "eq ne lt le gt ge nu nn in ni".split(" "), stropts: "eq ne bw bn ew en cn nc nu nn in ni".split(" "), strarr: ["text", "string", "blob"], groupops: [{ op: "and", text: "and" }, { op: "or", text: "or" }], groupbutton: !0, rulebuttons: !0, direction: "ltr" }, a.jgrid.filter, d || {}); return this.each(function () { if (!this.filter) { this.p = n; if (null === this.p.filter || void 0 === this.p.filter) this.p.filter = { groupop: this.p.groupops[0].op, rules: [], groups: [] }; var d, q = this.p.columns.length, f, w = /msie/i.test(navigator.useragent) && !window.opera; this.p.initfilter = a.extend(!0, {}, this.p.filter); if (q) { for (d = 0; d < q; d++) f = this.p.columns[d], f.stype ? f.inputtype = f.stype : f.inputtype || (f.inputtype = "text"), f.sorttype ? f.searchtype = f.sorttype : f.searchtype || (f.searchtype = "string"), void 0 === f.hidden && (f.hidden = !1), f.label || (f.label = f.name), f.index && (f.name = f.index), f.hasownproperty("searchoptions") || (f.searchoptions = {}), f.hasownproperty("searchrules") || (f.searchrules = {}); this.p.showquery && a(this).append("
"); var u = function (g, l) { var b = [!0, ""], c = a("#" + a.jgrid.jqid(n.id))[0] || null; if (a.isfunction(l.searchrules)) b = l.searchrules.call(c, g, l); else if (a.jgrid && a.jgrid.checkvalues) try { b = a.jgrid.checkvalues.call(c, g, -1, l.searchrules, l.label) } catch (m) { } b && b.length && !1 === b[0] && (n.error = !b[0], n.errmsg = b[1]) }; this.onchange = function () { this.p.error = !1; this.p.errmsg = ""; return a.isfunction(this.p.onchange) ? this.p.onchange.call(this, this.p) : !1 }; this.redraw = function () { a("table.group:first", this).remove(); var g = this.createtableforgroup(n.filter, null); a(this).append(g); a.isfunction(this.p.afterredraw) && this.p.afterredraw.call(this, this.p) }; this.createtableforgroup = function (g, l) { var b = this, c, m = a("
"), e = "left"; "rtl" === this.p.direction && (e = "right", m.attr("dir", "rtl")); null === l && m.append(""); var h = a(""); m.append(h); e = a(""); h.append(e); if (!0 === this.p.rulebuttons) { var d = a(""); e.append(d); var h = "", k; for (c = 0; c < n.groupops.length; c++) k = g.groupop === b.p.groupops[c].op ? " selected='selected'" : "", h += ""; d.append(h).bind("change", function () { g.groupop = a(d).val(); b.onchange() }) } h = ""; this.p.groupbutton && (h = a(""), h.bind("click", function () { void 0 === g.groups && (g.groups = []); g.groups.push({ groupop: n.groupops[0].op, rules: [], groups: [] }); b.redraw(); b.onchange(); return !1 })); e.append(h); if (!0 === this.p.rulebuttons) { var h = a(""), f; h.bind("click", function () { void 0 === g.rules && (g.rules = []); for (c = 0; c < b.p.columns.length; c++) { var e = void 0 === b.p.columns[c].search ? !0 : b.p.columns[c].search, l = !0 === b.p.columns[c].hidden; if (!0 === b.p.columns[c].searchoptions.searchhidden && e || e && !l) { f = b.p.columns[c]; break } } e = f.searchoptions.sopt ? f.searchoptions.sopt : b.p.sopt ? b.p.sopt : -1 !== a.inarray(f.searchtype, b.p.strarr) ? b.p.stropts : b.p.numopts; g.rules.push({ field: f.name, op: e[0], data: "" }); b.redraw(); return !1 }); e.append(h) } null !== l && (h = a(""), e.append(h), h.bind("click", function () { for (c = 0; c < l.groups.length; c++) if (l.groups[c] === g) { l.groups.splice(c, 1); break } b.redraw(); b.onchange(); return !1 })); if (void 0 !== g.groups) for (c = 0; c < g.groups.length; c++) e = a(""), m.append(e), h = a(""), e.append(h), h = a(""), h.append(this.createtableforgroup(g.groups[c], g)), e.append(h); void 0 === g.groupop && (g.groupop = b.p.groupops[0].op); if (void 0 !== g.rules) for (c = 0; c < g.rules.length; c++) m.append(this.createtablerowforrule(g.rules[c], g)); return m }; this.createtablerowforrule = function (g, l) { var b = this, c = a("#" + a.jgrid.jqid(n.id))[0] || null, m = a(""), e, h, f, k, d = "", s; m.append(""); var p = a(""); m.append(p); var q = a(""), r, t = []; p.append(q); q.bind("change", function () { g.field = a(q).val(); f = a(this).parents("tr:first"); for (e = 0; e < b.p.columns.length; e++) if (b.p.columns[e].name === g.field) { k = b.p.columns[e]; break } if (k) { k.searchoptions.id = a.jgrid.randid(); w && "text" === k.inputtype && !k.searchoptions.size && (k.searchoptions.size = 10); var d = a.jgrid.createel.call(c, k.inputtype, k.searchoptions, "", !0, b.p.ajaxselectoptions || {}, !0); a(d).addclass("input-elm"); h = k.searchoptions.sopt ? k.searchoptions.sopt : b.p.sopt ? b.p.sopt : -1 !== a.inarray(k.searchtype, b.p.strarr) ? b.p.stropts : b.p.numopts; var l = "", m = 0; t = []; a.each(b.p.ops, function () { t.push(this.oper) }); for (e = 0; e < h.length; e++) r = a.inarray(h[e], t), -1 !== r && (0 === m && (g.op = b.p.ops[r].oper), l += "", m++); a(".selectopts", f).empty().append(l); a(".selectopts", f)[0].selectedindex = 0; a.jgrid.msie && 9 > a.jgrid.msiever() && (l = parseint(a("select.selectopts", f)[0].offsetwidth, 10) + 1, a(".selectopts", f).width(l), a(".selectopts", f).css("width", "auto")); a(".data", f).empty().append(d); a.jgrid.bindev.call(c, d, k.searchoptions); a(".input-elm", f).bind("change", function (e) { e = e.target; g.data = "span" === e.nodename.touppercase() && k.searchoptions && a.isfunction(k.searchoptions.custom_value) ? k.searchoptions.custom_value.call(c, a(e).children(".customelement:first"), "get") : e.value; b.onchange() }); settimeout(function () { g.data = a(d).val(); b.onchange() }, 0) } }); for (e = p = 0; e < b.p.columns.length; e++) { s = void 0 === b.p.columns[e].search ? !0 : b.p.columns[e].search; var u = !0 === b.p.columns[e].hidden; if (!0 === b.p.columns[e].searchoptions.searchhidden && s || s && !u) s = "", g.field === b.p.columns[e].name && (s = " selected='selected'", p = e), d += "" } q.append(d); d = a(""); m.append(d); k = n.columns[p]; k.searchoptions.id = a.jgrid.randid(); w && "text" === k.inputtype && !k.searchoptions.size && (k.searchoptions.size = 10); p = a.jgrid.createel.call(c, k.inputtype, k.searchoptions, g.data, !0, b.p.ajaxselectoptions || {}, !0); if ("nu" === g.op || "nn" === g.op) a(p).attr("readonly", "true"), a(p).attr("disabled", "true"); var v = a(""); d.append(v); v.bind("change", function () { g.op = a(v).val(); f = a(this).parents("tr:first"); var c = a(".input-elm", f)[0]; "nu" === g.op || "nn" === g.op ? (g.data = "", "select" !== c.tagname.touppercase() && (c.value = ""), c.setattribute("readonly", "true"), c.setattribute("disabled", "true")) : ("select" === c.tagname.touppercase() && (g.data = c.value), c.removeattribute("readonly"), c.removeattribute("disabled")); b.onchange() }); h = k.searchoptions.sopt ? k.searchoptions.sopt : b.p.sopt ? b.p.sopt : -1 !== a.inarray(k.searchtype, b.p.strarr) ? b.p.stropts : b.p.numopts; d = ""; a.each(b.p.ops, function () { t.push(this.oper) }); for (e = 0; e < h.length; e++) r = a.inarray(h[e], t), -1 !== r && (s = g.op === b.p.ops[r].oper ? " selected='selected'" : "", d += ""); v.append(d); d = a(""); m.append(d); d.append(p); a.jgrid.bindev.call(c, p, k.searchoptions); a(p).addclass("input-elm").bind("change", function () { g.data = "custom" === k.inputtype ? k.searchoptions.custom_value.call(c, a(this).children(".customelement:first"), "get") : a(this).val(); b.onchange() }); d = a(""); m.append(d); !0 === this.p.rulebuttons && (p = a(""), d.append(p), p.bind("click", function () { for (e = 0; e < l.rules.length; e++) if (l.rules[e] === g) { l.rules.splice(e, 1); break } b.redraw(); b.onchange(); return !1 })); return m }; this.getstringforgroup = function (a) { var d = "(", b; if (void 0 !== a.groups) for (b = 0; b < a.groups.length; b++) { 1 < d.length && (d += " " + a.groupop + " "); try { d += this.getstringforgroup(a.groups[b]) } catch (c) { alert(c) } } if (void 0 !== a.rules) try { for (b = 0; b < a.rules.length; b++) 1 < d.length && (d += " " + a.groupop + " "), d += this.getstringforrule(a.rules[b]) } catch (f) { alert(f) } d += ")"; return "()" === d ? "" : d }; this.getstringforrule = function (d) { var f = "", b = "", c, m; for (c = 0; c < this.p.ops.length; c++) if (this.p.ops[c].oper === d.op) { f = this.p.operands.hasownproperty(d.op) ? this.p.operands[d.op] : ""; b = this.p.ops[c].oper; break } for (c = 0; c < this.p.columns.length; c++) if (this.p.columns[c].name === d.field) { m = this.p.columns[c]; break } if (void 0 == m) return ""; c = d.data; if ("bw" === b || "bn" === b) c += "%"; if ("ew" === b || "en" === b) c = "%" + c; if ("cn" === b || "nc" === b) c = "%" + c + "%"; if ("in" === b || "ni" === b) c = " (" + c + ")"; n.errorcheck && u(d.data, m); return -1 !== a.inarray(m.searchtype, ["int", "integer", "float", "number", "currency"]) || "nn" === b || "nu" === b ? d.field + " " + f + " " + c : d.field + " " + f + ' "' + c + '"' }; this.resetfilter = function () { this.p.filter = a.extend(!0, {}, this.p.initfilter); this.redraw(); this.onchange() }; this.hideerror = function () { a("th.ui-state-error", this).html(""); a("tr.error", this).hide() }; this.showerror = function () { a("th.ui-state-error", this).html(this.p.errmsg); a("tr.error", this).show() }; this.touserfriendlystring = function () { return this.getstringforgroup(n.filter) }; this.tostring = function () { function a(b) { var c = "(", f; if (void 0 !== b.groups) for (f = 0; f < b.groups.length; f++) 1 < c.length && (c = "or" === b.groupop ? c + " || " : c + " && "), c += a(b.groups[f]); if (void 0 !== b.rules) for (f = 0; f < b.rules.length; f++) { 1 < c.length && (c = "or" === b.groupop ? c + " || " : c + " && "); var e = b.rules[f]; if (d.p.errorcheck) { for (var h = void 0, n = void 0, h = 0; h < d.p.columns.length; h++) if (d.p.columns[h].name === e.field) { n = d.p.columns[h]; break } n && u(e.data, n) } c += e.op + "(item." + e.field + ",'" + e.data + "')" } c += ")"; return "()" === c ? "" : c } var d = this; return a(this.p.filter) }; this.redraw(); if (this.p.showquery) this.onchange(); this.filter = !0 } } }) }; a.extend(a.fn.jqfilter, { tosqlstring: function () { var a = ""; this.each(function () { a = this.touserfriendlystring() }); return a }, filterdata: function () { var a; this.each(function () { a = this.p.filter }); return a }, getparameter: function (a) { return void 0 !== a && this.p.hasownproperty(a) ? this.p[a] : this.p }, resetfilter: function () { return this.each(function () { this.resetfilter() }) }, addfilter: function (d) { "string" === typeof d && (d = a.jgrid.parse(d)); this.each(function () { this.p.filter = d; this.redraw(); this.onchange() }) } }) })(jquery); (function (a) { a.jgrid.inlineedit = a.jgrid.inlineedit || {}; a.jgrid.extend({ editrow: function (c, e, b, l, h, n, p, g, f) { var m = {}, d = a.makearray(arguments).slice(1); "object" === a.type(d[0]) ? m = d[0] : (void 0 !== e && (m.keys = e), a.isfunction(b) && (m.oneditfunc = b), a.isfunction(l) && (m.successfunc = l), void 0 !== h && (m.url = h), void 0 !== n && (m.extraparam = n), a.isfunction(p) && (m.aftersavefunc = p), a.isfunction(g) && (m.errorfunc = g), a.isfunction(f) && (m.afterrestorefunc = f)); m = a.extend(!0, { keys: !1, oneditfunc: null, successfunc: null, url: null, extraparam: {}, aftersavefunc: null, errorfunc: null, afterrestorefunc: null, restoreaftererror: !0, mtype: "post" }, a.jgrid.inlineedit, m); return this.each(function () { var d = this, f, e, b, g = 0, h = null, n = {}, l, q; d.grid && (l = a(d).jqgrid("getind", c, !0), !1 !== l && (b = a.isfunction(m.beforeeditrow) ? m.beforeeditrow.call(d, m, c) : void 0, void 0 === b && (b = !0), b && (b = a(l).attr("editable") || "0", "0" !== b || a(l).hasclass("not-editable-row") || (q = d.p.colmodel, a('td[role="gridcell"]', l).each(function (b) { f = q[b].name; var l = !0 === d.p.treegrid && f === d.p.expandcolumn; if (l) e = a("span:first", this).html(); else try { e = a.unformat.call(d, this, { rowid: c, colmodel: q[b] }, b) } catch (m) { e = q[b].edittype && "textarea" === q[b].edittype ? a(this).text() : a(this).html() } if ("cb" !== f && "subgrid" !== f && "rn" !== f && (d.p.autoencode && (e = a.jgrid.htmldecode(e)), n[f] = e, !0 === q[b].editable)) { null === h && (h = b); l ? a("span:first", this).html("") : a(this).html(""); var p = a.extend({}, q[b].editoptions || {}, { id: c + "_" + f, name: f }); q[b].edittype || (q[b].edittype = "text"); if (" " === e || " " === e || 1 === e.length && 160 === e.charcodeat(0)) e = ""; var x = a.jgrid.createel.call(d, q[b].edittype, p, e, !0, a.extend({}, a.jgrid.ajaxoptions, d.p.ajaxselectoptions || {})); a(x).addclass("editable"); l ? a("span:first", this).append(x) : a(this).append(x); a.jgrid.bindev.call(d, x, p); "select" === q[b].edittype && void 0 !== q[b].editoptions && !0 === q[b].editoptions.multiple && void 0 === q[b].editoptions.dataurl && a.jgrid.msie && a(x).width(a(x).width()); g++ } }), 0 < g && (n.id = c, d.p.savedrow.push(n), a(l).attr("editable", "1"), settimeout(function () { a("td:eq(" + h + ") input", l).focus() }, 0), !0 === m.keys && a(l).bind("keydown", function (b) { if (27 === b.keycode) { a(d).jqgrid("restorerow", c, m.afterrestorefunc); if (d.p._inlinenav) try { a(d).jqgrid("showaddeditbuttons") } catch (f) { } return !1 } if (13 === b.keycode) { if ("textarea" === b.target.tagname) return !0; if (a(d).jqgrid("saverow", c, m) && d.p._inlinenav) try { a(d).jqgrid("showaddeditbuttons") } catch (e) { } return !1 } }), a(d).triggerhandler("jqgridinlineeditrow", [c, m]), a.isfunction(m.oneditfunc) && m.oneditfunc.call(d, c)))))) }) }, saverow: function (c, e, b, l, h, n, p) { var g = a.makearray(arguments).slice(1), f = {}; "object" === a.type(g[0]) ? f = g[0] : (a.isfunction(e) && (f.successfunc = e), void 0 !== b && (f.url = b), void 0 !== l && (f.extraparam = l), a.isfunction(h) && (f.aftersavefunc = h), a.isfunction(n) && (f.errorfunc = n), a.isfunction(p) && (f.afterrestorefunc = p)); var f = a.extend(!0, { successfunc: null, url: null, extraparam: {}, aftersavefunc: null, errorfunc: null, afterrestorefunc: null, restoreaftererror: !0, mtype: "post" }, a.jgrid.inlineedit, f), m = !1, d = this[0], r, k = {}, y = {}, v = {}, w, z, u; if (!d.grid) return m; u = a(d).jqgrid("getind", c, !0); if (!1 === u) return m; g = a.isfunction(f.beforesaverow) ? f.beforesaverow.call(d, f, c) : void 0; void 0 === g && (g = !0); if (g) { g = a(u).attr("editable"); f.url = f.url || d.p.editurl; if ("1" === g) { var t; a('td[role="gridcell"]', u).each(function (c) { t = d.p.colmodel[c]; r = t.name; if ("cb" !== r && "subgrid" !== r && !0 === t.editable && "rn" !== r && !a(this).hasclass("not-editable-cell")) { switch (t.edittype) { case "checkbox": var b = ["yes", "no"]; t.editoptions && (b = t.editoptions.value.split(":")); k[r] = a("input", this).is(":checked") ? b[0] : b[1]; break; case "text": case "password": case "textarea": case "button": k[r] = a("input, textarea", this).val(); break; case "select": if (t.editoptions.multiple) { var b = a("select", this), e = []; k[r] = a(b).val(); k[r] = k[r] ? k[r].join(",") : ""; a("select option:selected", this).each(function (d, b) { e[d] = a(b).text() }); y[r] = e.join(",") } else k[r] = a("select option:selected", this).val(), y[r] = a("select option:selected", this).text(); t.formatter && "select" === t.formatter && (y = {}); break; case "custom": try { if (t.editoptions && a.isfunction(t.editoptions.custom_value)) { if (k[r] = t.editoptions.custom_value.call(d, a(".customelement", this), "get"), void 0 === k[r]) throw "e2"; } else throw "e1"; } catch (g) { "e1" === g && a.jgrid.info_dialog(a.jgrid.errors.errcap, "function 'custom_value' " + a.jgrid.edit.msg.nodefined, a.jgrid.edit.bclose), "e2" === g ? a.jgrid.info_dialog(a.jgrid.errors.errcap, "function 'custom_value' " + a.jgrid.edit.msg.novalue, a.jgrid.edit.bclose) : a.jgrid.info_dialog(a.jgrid.errors.errcap, g.message, a.jgrid.edit.bclose) } } z = a.jgrid.checkvalues.call(d, k[r], c); if (!1 === z[0]) return !1; d.p.autoencode && (k[r] = a.jgrid.htmlencode(k[r])); "clientarray" !== f.url && t.editoptions && !0 === t.editoptions.nullifempty && "" === k[r] && (v[r] = "null") } }); if (!1 === z[0]) { try { var q = a(d).jqgrid("getgridrowbyid", c), s = a.jgrid.findpos(q); a.jgrid.info_dialog(a.jgrid.errors.errcap, z[1], a.jgrid.edit.bclose, { left: s[0], top: s[1] + a(q).outerheight() }) } catch (a) { alert(z[1]) } return m } g = d.p.prmnames; q = c; s = !1 === d.p.keyindex ? g.id : d.p.colmodel[d.p.keyindex + (!0 === d.p.rownumbers ? 1 : 0) + (!0 === d.p.multiselect ? 1 : 0) + (!0 === d.p.subgrid ? 1 : 0)].name; k && (k[g.oper] = g.editoper, void 0 === k[s] || "" === k[s] ? k[s] = c : u.id !== d.p.idprefix + k[s] && (g = a.jgrid.strippref(d.p.idprefix, c), void 0 !== d.p._index[g] && (d.p._index[k[s]] = d.p._index[g], delete d.p._index[g]), c = d.p.idprefix + k[s], a(u).attr("id", c), d.p.selrow === q && (d.p.selrow = c), a.isarray(d.p.selarrrow) && (g = a.inarray(q, d.p.selarrrow), 0 <= g && (d.p.selarrrow[g] = c)), d.p.multiselect && (g = "jqg_" + d.p.id + "_" + c, a("input.cbox", u).attr("id", g).attr("name", g))), void 0 === d.p.inlinedata && (d.p.inlinedata = {}), k = a.extend({}, k, d.p.inlinedata, f.extraparam)); if ("clientarray" === f.url) { k = a.extend({}, k, y); d.p.autoencode && a.each(k, function (d, b) { k[d] = a.jgrid.htmldecode(b) }); g = a(d).jqgrid("setrowdata", c, k); a(u).attr("editable", "0"); for (s = 0; s < d.p.savedrow.length; s++) if (string(d.p.savedrow[s].id) === string(q)) { w = s; break } 0 <= w && d.p.savedrow.splice(w, 1); a(d).triggerhandler("jqgridinlineaftersaverow", [c, g, k, f]); a.isfunction(f.aftersavefunc) && f.aftersavefunc.call(d, c, g, f); m = !0; a(u).removeclass("jqgrid-new-row").unbind("keydown") } else a("#lui_" + a.jgrid.jqid(d.p.id)).show(), v = a.extend({}, k, v), v[s] = a.jgrid.strippref(d.p.idprefix, v[s]), a.ajax(a.extend({ url: f.url, data: a.isfunction(d.p.serializerowdata) ? d.p.serializerowdata.call(d, v) : v, type: f.mtype, async: !1, complete: function (b, e) { a("#lui_" + a.jgrid.jqid(d.p.id)).hide(); if ("success" === e) { var g = !0, h; h = a(d).triggerhandler("jqgridinlinesuccesssaverow", [b, c, f]); a.isarray(h) || (h = [!0, k]); h[0] && a.isfunction(f.successfunc) && (h = f.successfunc.call(d, b)); a.isarray(h) ? (g = h[0], k = h[1] || k) : g = h; if (!0 === g) { d.p.autoencode && a.each(k, function (b, d) { k[b] = a.jgrid.htmldecode(d) }); k = a.extend({}, k, y); a(d).jqgrid("setrowdata", c, k); a(u).attr("editable", "0"); for (g = 0; g < d.p.savedrow.length; g++) if (string(d.p.savedrow[g].id) === string(c)) { w = g; break } 0 <= w && d.p.savedrow.splice(w, 1); a(d).triggerhandler("jqgridinlineaftersaverow", [c, b, k, f]); a.isfunction(f.aftersavefunc) && f.aftersavefunc.call(d, c, b); m = !0; a(u).removeclass("jqgrid-new-row").unbind("keydown") } else a(d).triggerhandler("jqgridinlineerrorsaverow", [c, b, e, null, f]), a.isfunction(f.errorfunc) && f.errorfunc.call(d, c, b, e, null), !0 === f.restoreaftererror && a(d).jqgrid("restorerow", c, f.afterrestorefunc) } }, error: function (b, e, g) { a("#lui_" + a.jgrid.jqid(d.p.id)).hide(); a(d).triggerhandler("jqgridinlineerrorsaverow", [c, b, e, g, f]); if (a.isfunction(f.errorfunc)) f.errorfunc.call(d, c, b, e, g); else { b = b.responsetext || b.statustext; try { a.jgrid.info_dialog(a.jgrid.errors.errcap, '
' + b + "
", a.jgrid.edit.bclose, { buttonalign: "right" }) } catch (h) { alert(b) } } !0 === f.restoreaftererror && a(d).jqgrid("restorerow", c, f.afterrestorefunc) } }, a.jgrid.ajaxoptions, d.p.ajaxrowoptions || {})) } return m } }, restorerow: function (c, e) { var b = a.makearray(arguments).slice(1), l = {}; "object" === a.type(b[0]) ? l = b[0] : a.isfunction(e) && (l.afterrestorefunc = e); l = a.extend(!0, {}, a.jgrid.inlineedit, l); return this.each(function () { var b = this, e = -1, p, g = {}, f; if (b.grid && (p = a(b).jqgrid("getind", c, !0), !1 !== p && (f = a.isfunction(l.beforecancelrow) ? l.beforecancelrow.call(b, l, sr) : void 0, void 0 === f && (f = !0), f))) { for (f = 0; f < b.p.savedrow.length; f++) if (string(b.p.savedrow[f].id) === string(c)) { e = f; break } if (0 <= e) { if (a.isfunction(a.fn.datepicker)) try { a("input.hasdatepicker", "#" + a.jgrid.jqid(p.id)).datepicker("hide") } catch (m) { } a.each(b.p.colmodel, function () { !0 === this.editable && b.p.savedrow[e].hasownproperty(this.name) && (g[this.name] = b.p.savedrow[e][this.name]) }); a(b).jqgrid("setrowdata", c, g); a(p).attr("editable", "0").unbind("keydown"); b.p.savedrow.splice(e, 1); a("#" + a.jgrid.jqid(c), "#" + a.jgrid.jqid(b.p.id)).hasclass("jqgrid-new-row") && settimeout(function () { a(b).jqgrid("delrowdata", c); a(b).jqgrid("showaddeditbuttons") }, 0) } a(b).triggerhandler("jqgridinlineafterrestorerow", [c]); a.isfunction(l.afterrestorefunc) && l.afterrestorefunc.call(b, c) } }) }, addrow: function (c) { c = a.extend(!0, { rowid: null, initdata: {}, position: "first", usedefvalues: !0, useformatter: !1, addrowparams: { extraparam: {} } }, c || {}); return this.each(function () { if (this.grid) { var e = this, b = a.isfunction(c.beforeaddrow) ? c.beforeaddrow.call(e, c.addrowparams) : void 0; void 0 === b && (b = !0); b && (c.rowid = a.isfunction(c.rowid) ? c.rowid.call(e, c) : null != c.rowid ? c.rowid : a.jgrid.randid(), !0 === c.usedefvalues && a(e.p.colmodel).each(function () { if (this.editoptions && this.editoptions.defaultvalue) { var b = this.editoptions.defaultvalue, b = a.isfunction(b) ? b.call(e) : b; c.initdata[this.name] = b } }), a(e).jqgrid("addrowdata", c.rowid, c.initdata, c.position), c.rowid = e.p.idprefix + c.rowid, a("#" + a.jgrid.jqid(c.rowid), "#" + a.jgrid.jqid(e.p.id)).addclass("jqgrid-new-row"), c.useformatter ? a("#" + a.jgrid.jqid(c.rowid) + " .ui-inline-edit", "#" + a.jgrid.jqid(e.p.id)).click() : (b = e.p.prmnames, c.addrowparams.extraparam[b.oper] = b.addoper, a(e).jqgrid("editrow", c.rowid, c.addrowparams), a(e).jqgrid("setselection", c.rowid))) } }) }, inlinenav: function (c, e) { e = a.extend(!0, { edit: !0, editicon: "ui-icon-pencil", add: !0, addicon: "ui-icon-plus", save: !0, saveicon: "ui-icon-disk", cancel: !0, cancelicon: "ui-icon-cancel", addparams: { addrowparams: { extraparam: {} } }, editparams: {}, restoreafterselect: !0 }, a.jgrid.nav, e || {}); return this.each(function () { if (this.grid) { var b = this, l, h = a.jgrid.jqid(b.p.id); b.p._inlinenav = !0; if (!0 === e.addparams.useformatter) { var n = b.p.colmodel, p; for (p = 0; p < n.length; p++) if (n[p].formatter && "actions" === n[p].formatter) { n[p].formatoptions && (n = a.extend({ keys: !1, onedit: null, onsuccess: null, aftersave: null, onerror: null, afterrestore: null, extraparam: {}, url: null }, n[p].formatoptions), e.addparams.addrowparams = { keys: n.keys, oneditfunc: n.onedit, successfunc: n.onsuccess, url: n.url, extraparam: n.extraparam, aftersavefunc: n.aftersave, errorfunc: n.onerror, afterrestorefunc: n.afterrestore }); break } } e.add && a(b).jqgrid("navbuttonadd", c, { caption: e.addtext, title: e.addtitle, buttonicon: e.addicon, id: b.p.id + "_iladd", onclickbutton: function () { a(b).jqgrid("addrow", e.addparams); e.addparams.useformatter || (a("#" + h + "_ilsave").removeclass("ui-state-disabled"), a("#" + h + "_ilcancel").removeclass("ui-state-disabled"), a("#" + h + "_iladd").addclass("ui-state-disabled"), a("#" + h + "_iledit").addclass("ui-state-disabled")) } }); e.edit && a(b).jqgrid("navbuttonadd", c, { caption: e.edittext, title: e.edittitle, buttonicon: e.editicon, id: b.p.id + "_iledit", onclickbutton: function () { var c = a(b).jqgrid("getgridparam", "selrow"); c ? (a(b).jqgrid("editrow", c, e.editparams), a("#" + h + "_ilsave").removeclass("ui-state-disabled"), a("#" + h + "_ilcancel").removeclass("ui-state-disabled"), a("#" + h + "_iladd").addclass("ui-state-disabled"), a("#" + h + "_iledit").addclass("ui-state-disabled")) : (a.jgrid.viewmodal("#alertmod", { gbox: "#gbox_" + h, jqm: !0 }), a("#jqg_alrt").focus()) } }); e.save && (a(b).jqgrid("navbuttonadd", c, { caption: e.savetext || "", title: e.savetitle || "save row", buttonicon: e.saveicon, id: b.p.id + "_ilsave", onclickbutton: function () { var c = b.p.savedrow[0].id; if (c) { var f = b.p.prmnames, m = f.oper, d = e.editparams; a("#" + a.jgrid.jqid(c), "#" + h).hasclass("jqgrid-new-row") ? (e.addparams.addrowparams.extraparam[m] = f.addoper, d = e.addparams.addrowparams) : (e.editparams.extraparam || (e.editparams.extraparam = {}), e.editparams.extraparam[m] = f.editoper); a(b).jqgrid("saverow", c, d) && a(b).jqgrid("showaddeditbuttons") } else a.jgrid.viewmodal("#alertmod", { gbox: "#gbox_" + h, jqm: !0 }), a("#jqg_alrt").focus() } }), a("#" + h + "_ilsave").addclass("ui-state-disabled")); e.cancel && (a(b).jqgrid("navbuttonadd", c, { caption: e.canceltext || "", title: e.canceltitle || "cancel row editing", buttonicon: e.cancelicon, id: b.p.id + "_ilcancel", onclickbutton: function () { var c = b.p.savedrow[0].id, f = e.editparams; c ? (a("#" + a.jgrid.jqid(c), "#" + h).hasclass("jqgrid-new-row") && (f = e.addparams.addrowparams), a(b).jqgrid("restorerow", c, f), a(b).jqgrid("showaddeditbuttons")) : (a.jgrid.viewmodal("#alertmod", { gbox: "#gbox_" + h, jqm: !0 }), a("#jqg_alrt").focus()) } }), a("#" + h + "_ilcancel").addclass("ui-state-disabled")); !0 === e.restoreafterselect && (l = a.isfunction(b.p.beforeselectrow) ? b.p.beforeselectrow : !1, b.p.beforeselectrow = function (c, f) { var h = !0; 0 < b.p.savedrow.length && !0 === b.p._inlinenav && c !== b.p.selrow && null !== b.p.selrow && (b.p.selrow === e.addparams.rowid ? a(b).jqgrid("delrowdata", b.p.selrow) : a(b).jqgrid("restorerow", b.p.selrow, e.editparams), a(b).jqgrid("showaddeditbuttons")); l && (h = l.call(b, c, f)); return h }) } }) }, showaddeditbuttons: function () { return this.each(function () { if (this.grid) { var c = a.jgrid.jqid(this.p.id); a("#" + c + "_ilsave").addclass("ui-state-disabled"); a("#" + c + "_ilcancel").addclass("ui-state-disabled"); a("#" + c + "_iladd").removeclass("ui-state-disabled"); a("#" + c + "_iledit").removeclass("ui-state-disabled") } }) } }) })(jquery); (function (b) { b.jgrid.extend({ editcell: function (d, f, a) { return this.each(function () { var c = this, g, e, h, k; if (c.grid && !0 === c.p.celledit) { f = parseint(f, 10); c.p.selrow = c.rows[d].id; c.p.knv || b(c).jqgrid("gridnav"); if (0 < c.p.savedrow.length) { if (!0 === a && d == c.p.irow && f == c.p.icol) return; b(c).jqgrid("savecell", c.p.savedrow[0].id, c.p.savedrow[0].ic) } else window.settimeout(function () { b("#" + b.jgrid.jqid(c.p.knv)).attr("tabindex", "-1").focus() }, 0); k = c.p.colmodel[f]; g = k.name; if ("subgrid" !== g && "cb" !== g && "rn" !== g) { h = b("td:eq(" + f + ")", c.rows[d]); if (!0 !== k.editable || !0 !== a || h.hasclass("not-editable-cell")) 0 <= parseint(c.p.icol, 10) && 0 <= parseint(c.p.irow, 10) && (b("td:eq(" + c.p.icol + ")", c.rows[c.p.irow]).removeclass("edit-cell ui-state-highlight"), b(c.rows[c.p.irow]).removeclass("selected-row ui-state-hover")), h.addclass("edit-cell ui-state-highlight"), b(c.rows[d]).addclass("selected-row ui-state-hover"), e = h.html().replace(/\ \;/ig, ""), b(c).triggerhandler("jqgridselectcell", [c.rows[d].id, g, e, d, f]), b.isfunction(c.p.onselectcell) && c.p.onselectcell.call(c, c.rows[d].id, g, e, d, f); else { 0 <= parseint(c.p.icol, 10) && 0 <= parseint(c.p.irow, 10) && (b("td:eq(" + c.p.icol + ")", c.rows[c.p.irow]).removeclass("edit-cell ui-state-highlight"), b(c.rows[c.p.irow]).removeclass("selected-row ui-state-hover")); b(h).addclass("edit-cell ui-state-highlight"); b(c.rows[d]).addclass("selected-row ui-state-hover"); try { e = b.unformat.call(c, h, { rowid: c.rows[d].id, colmodel: k }, f) } catch (m) { e = k.edittype && "textarea" === k.edittype ? b(h).text() : b(h).html() } c.p.autoencode && (e = b.jgrid.htmldecode(e)); k.edittype || (k.edittype = "text"); c.p.savedrow.push({ id: d, ic: f, name: g, v: e }); if (" " === e || " " === e || 1 === e.length && 160 === e.charcodeat(0)) e = ""; if (b.isfunction(c.p.formatcell)) { var l = c.p.formatcell.call(c, c.rows[d].id, g, e, d, f); void 0 !== l && (e = l) } b(c).triggerhandler("jqgridbeforeeditcell", [c.rows[d].id, g, e, d, f]); b.isfunction(c.p.beforeeditcell) && c.p.beforeeditcell.call(c, c.rows[d].id, g, e, d, f); var l = b.extend({}, k.editoptions || {}, { id: d + "_" + g, name: g }), q = b.jgrid.createel.call(c, k.edittype, l, e, !0, b.extend({}, b.jgrid.ajaxoptions, c.p.ajaxselectoptions || {})); b(h).html("").append(q).attr("tabindex", "0"); b.jgrid.bindev.call(c, q, l); window.settimeout(function () { b(q).focus() }, 0); b("input, select, textarea", h).bind("keydown", function (a) { 27 === a.keycode && (0 < b("input.hasdatepicker", h).length ? b(".ui-datepicker").is(":hidden") ? b(c).jqgrid("restorecell", d, f) : b("input.hasdatepicker", h).datepicker("hide") : b(c).jqgrid("restorecell", d, f)); if (13 === a.keycode) return b(c).jqgrid("savecell", d, f), !1; if (9 === a.keycode) { if (c.grid.hdiv.loading) return !1; a.shiftkey ? b(c).jqgrid("prevcell", d, f) : b(c).jqgrid("nextcell", d, f) } a.stoppropagation() }); b(c).triggerhandler("jqgridaftereditcell", [c.rows[d].id, g, e, d, f]); b.isfunction(c.p.aftereditcell) && c.p.aftereditcell.call(c, c.rows[d].id, g, e, d, f) } c.p.icol = f; c.p.irow = d } } }) }, savecell: function (d, f) { return this.each(function () { var a = this, c; if (a.grid && !0 === a.p.celledit) { c = 1 <= a.p.savedrow.length ? 0 : null; if (null !== c) { var g = b("td:eq(" + f + ")", a.rows[d]), e, h, k = a.p.colmodel[f], m = k.name, l = b.jgrid.jqid(m); switch (k.edittype) { case "select": if (k.editoptions.multiple) { var l = b("#" + d + "_" + l, a.rows[d]), q = []; (e = b(l).val()) ? e.join(",") : e = ""; b("option:selected", l).each(function (a, c) { q[a] = b(c).text() }); h = q.join(",") } else e = b("#" + d + "_" + l + " option:selected", a.rows[d]).val(), h = b("#" + d + "_" + l + " option:selected", a.rows[d]).text(); k.formatter && (h = e); break; case "checkbox": var n = ["yes", "no"]; k.editoptions && (n = k.editoptions.value.split(":")); h = e = b("#" + d + "_" + l, a.rows[d]).is(":checked") ? n[0] : n[1]; break; case "password": case "text": case "textarea": case "button": h = e = b("#" + d + "_" + l, a.rows[d]).val(); break; case "custom": try { if (k.editoptions && b.isfunction(k.editoptions.custom_value)) { e = k.editoptions.custom_value.call(a, b(".customelement", g), "get"); if (void 0 === e) throw "e2"; h = e } else throw "e1"; } catch (r) { "e1" === r && b.jgrid.info_dialog(b.jgrid.errors.errcap, "function 'custom_value' " + b.jgrid.edit.msg.nodefined, b.jgrid.edit.bclose), "e2" === r ? b.jgrid.info_dialog(b.jgrid.errors.errcap, "function 'custom_value' " + b.jgrid.edit.msg.novalue, b.jgrid.edit.bclose) : b.jgrid.info_dialog(b.jgrid.errors.errcap, r.message, b.jgrid.edit.bclose) } } if (h !== a.p.savedrow[c].v) { if (c = b(a).triggerhandler("jqgridbeforesavecell", [a.rows[d].id, m, e, d, f])) h = e = c; b.isfunction(a.p.beforesavecell) && (c = a.p.beforesavecell.call(a, a.rows[d].id, m, e, d, f)) && (h = e = c); var s = b.jgrid.checkvalues.call(a, e, f); if (!0 === s[0]) { c = b(a).triggerhandler("jqgridbeforesubmitcell", [a.rows[d].id, m, e, d, f]) || {}; b.isfunction(a.p.beforesubmitcell) && ((c = a.p.beforesubmitcell.call(a, a.rows[d].id, m, e, d, f)) || (c = {})); 0 < b("input.hasdatepicker", g).length && b("input.hasdatepicker", g).datepicker("hide"); if ("remote" === a.p.cellsubmit) if (a.p.cellurl) { var p = {}; a.p.autoencode && (e = b.jgrid.htmlencode(e)); p[m] = e; n = a.p.prmnames; k = n.id; l = n.oper; p[k] = b.jgrid.strippref(a.p.idprefix, a.rows[d].id); p[l] = n.editoper; p = b.extend(c, p); b("#lui_" + b.jgrid.jqid(a.p.id)).show(); a.grid.hdiv.loading = !0; b.ajax(b.extend({ url: a.p.cellurl, data: b.isfunction(a.p.serializecelldata) ? a.p.serializecelldata.call(a, p) : p, type: "post", complete: function (c, k) { b("#lui_" + a.p.id).hide(); a.grid.hdiv.loading = !1; if ("success" === k) { var l = b(a).triggerhandler("jqgridaftersubmitcell", [a, c, p.id, m, e, d, f]) || [!0, ""]; !0 === l[0] && b.isfunction(a.p.aftersubmitcell) && (l = a.p.aftersubmitcell.call(a, c, p.id, m, e, d, f)); !0 === l[0] ? (b(g).empty(), b(a).jqgrid("setcell", a.rows[d].id, f, h, !1, !1, !0), b(g).addclass("dirty-cell"), b(a.rows[d]).addclass("edited"), b(a).triggerhandler("jqgridaftersavecell", [a.rows[d].id, m, e, d, f]), b.isfunction(a.p.aftersavecell) && a.p.aftersavecell.call(a, a.rows[d].id, m, e, d, f), a.p.savedrow.splice(0, 1)) : (b.jgrid.info_dialog(b.jgrid.errors.errcap, l[1], b.jgrid.edit.bclose), b(a).jqgrid("restorecell", d, f)) } }, error: function (c, e, h) { b("#lui_" + b.jgrid.jqid(a.p.id)).hide(); a.grid.hdiv.loading = !1; b(a).triggerhandler("jqgriderrorcell", [c, e, h]); b.isfunction(a.p.errorcell) ? a.p.errorcell.call(a, c, e, h) : b.jgrid.info_dialog(b.jgrid.errors.errcap, c.status + " : " + c.statustext + "
" + e, b.jgrid.edit.bclose); b(a).jqgrid("restorecell", d, f) } }, b.jgrid.ajaxoptions, a.p.ajaxcelloptions || {})) } else try { b.jgrid.info_dialog(b.jgrid.errors.errcap, b.jgrid.errors.nourl, b.jgrid.edit.bclose), b(a).jqgrid("restorecell", d, f) } catch (t) { } "clientarray" === a.p.cellsubmit && (b(g).empty(), b(a).jqgrid("setcell", a.rows[d].id, f, h, !1, !1, !0), b(g).addclass("dirty-cell"), b(a.rows[d]).addclass("edited"), b(a).triggerhandler("jqgridaftersavecell", [a.rows[d].id, m, e, d, f]), b.isfunction(a.p.aftersavecell) && a.p.aftersavecell.call(a, a.rows[d].id, m, e, d, f), a.p.savedrow.splice(0, 1)) } else try { window.settimeout(function () { b.jgrid.info_dialog(b.jgrid.errors.errcap, e + " " + s[1], b.jgrid.edit.bclose) }, 100), b(a).jqgrid("restorecell", d, f) } catch (u) { } } else b(a).jqgrid("restorecell", d, f) } window.settimeout(function () { b("#" + b.jgrid.jqid(a.p.knv)).attr("tabindex", "-1").focus() }, 0) } }) }, restorecell: function (d, f) { return this.each(function () { var a = this, c; if (a.grid && !0 === a.p.celledit) { c = 1 <= a.p.savedrow.length ? 0 : null; if (null !== c) { var g = b("td:eq(" + f + ")", a.rows[d]); if (b.isfunction(b.fn.datepicker)) try { b("input.hasdatepicker", g).datepicker("hide") } catch (e) { } b(g).empty().attr("tabindex", "-1"); b(a).jqgrid("setcell", a.rows[d].id, f, a.p.savedrow[c].v, !1, !1, !0); b(a).triggerhandler("jqgridafterrestorecell", [a.rows[d].id, a.p.savedrow[c].v, d, f]); b.isfunction(a.p.afterrestorecell) && a.p.afterrestorecell.call(a, a.rows[d].id, a.p.savedrow[c].v, d, f); a.p.savedrow.splice(0, 1) } window.settimeout(function () { b("#" + a.p.knv).attr("tabindex", "-1").focus() }, 0) } }) }, nextcell: function (d, f) { return this.each(function () { var a = !1, c; if (this.grid && !0 === this.p.celledit) { for (c = f + 1; c < this.p.colmodel.length; c++) if (!0 === this.p.colmodel[c].editable) { a = c; break } !1 !== a ? b(this).jqgrid("editcell", d, a, !0) : 0 < this.p.savedrow.length && b(this).jqgrid("savecell", d, f) } }) }, prevcell: function (d, f) { return this.each(function () { var a = !1, c; if (this.grid && !0 === this.p.celledit) { for (c = f - 1; 0 <= c; c--) if (!0 === this.p.colmodel[c].editable) { a = c; break } !1 !== a ? b(this).jqgrid("editcell", d, a, !0) : 0 < this.p.savedrow.length && b(this).jqgrid("savecell", d, f) } }) }, gridnav: function () { return this.each(function () { function d(c, d, e) { if ("v" === e.substr(0, 1)) { var f = b(a.grid.bdiv)[0].clientheight, g = b(a.grid.bdiv)[0].scrolltop, n = a.rows[c].offsettop + a.rows[c].clientheight, r = a.rows[c].offsettop; "vd" === e && n >= f && (b(a.grid.bdiv)[0].scrolltop = b(a.grid.bdiv)[0].scrolltop + a.rows[c].clientheight); "vu" === e && r < g && (b(a.grid.bdiv)[0].scrolltop = b(a.grid.bdiv)[0].scrolltop - a.rows[c].clientheight) } "h" === e && (e = b(a.grid.bdiv)[0].clientwidth, f = b(a.grid.bdiv)[0].scrollleft, g = a.rows[c].cells[d].offsetleft, a.rows[c].cells[d].offsetleft + a.rows[c].cells[d].clientwidth >= e + parseint(f, 10) ? b(a.grid.bdiv)[0].scrollleft = b(a.grid.bdiv)[0].scrollleft + a.rows[c].cells[d].clientwidth : g < f && (b(a.grid.bdiv)[0].scrollleft = b(a.grid.bdiv)[0].scrollleft - a.rows[c].cells[d].clientwidth)) } function f(b, c) { var d, e; if ("lft" === c) for (d = b + 1, e = b; 0 <= e; e--) if (!0 !== a.p.colmodel[e].hidden) { d = e; break } if ("rgt" === c) for (d = b - 1, e = b; e < a.p.colmodel.length; e++) if (!0 !== a.p.colmodel[e].hidden) { d = e; break } return d } var a = this; if (a.grid && !0 === a.p.celledit) { a.p.knv = a.p.id + "_kn"; var c = b("
"), g, e; b(c).insertbefore(a.grid.cdiv); b("#" + a.p.knv).focus().keydown(function (c) { e = c.keycode; "rtl" === a.p.direction && (37 === e ? e = 39 : 39 === e && (e = 37)); switch (e) { case 38: 0 < a.p.irow - 1 && (d(a.p.irow - 1, a.p.icol, "vu"), b(a).jqgrid("editcell", a.p.irow - 1, a.p.icol, !1)); break; case 40: a.p.irow + 1 <= a.rows.length - 1 && (d(a.p.irow + 1, a.p.icol, "vd"), b(a).jqgrid("editcell", a.p.irow + 1, a.p.icol, !1)); break; case 37: 0 <= a.p.icol - 1 && (g = f(a.p.icol - 1, "lft"), d(a.p.irow, g, "h"), b(a).jqgrid("editcell", a.p.irow, g, !1)); break; case 39: a.p.icol + 1 <= a.p.colmodel.length - 1 && (g = f(a.p.icol + 1, "rgt"), d(a.p.irow, g, "h"), b(a).jqgrid("editcell", a.p.irow, g, !1)); break; case 13: 0 <= parseint(a.p.icol, 10) && 0 <= parseint(a.p.irow, 10) && b(a).jqgrid("editcell", a.p.irow, a.p.icol, !0); break; default: return !0 } return !1 }) } }) }, getchangedcells: function (d) { var f = []; d || (d = "all"); this.each(function () { var a = this, c; a.grid && !0 === a.p.celledit && b(a.rows).each(function (g) { var e = {}; b(this).hasclass("edited") && (b("td", this).each(function (f) { c = a.p.colmodel[f].name; if ("cb" !== c && "subgrid" !== c) if ("dirty" === d) { if (b(this).hasclass("dirty-cell")) try { e[c] = b.unformat.call(a, this, { rowid: a.rows[g].id, colmodel: a.p.colmodel[f] }, f) } catch (k) { e[c] = b.jgrid.htmldecode(b(this).html()) } } else try { e[c] = b.unformat.call(a, this, { rowid: a.rows[g].id, colmodel: a.p.colmodel[f] }, f) } catch (m) { e[c] = b.jgrid.htmldecode(b(this).html()) } }), e.id = this.id, f.push(e)) }) }); return f } }) })(jquery); (function (c) { c.fn.jqm = function (a) { var k = { overlay: 50, closeoverlay: !0, overlayclass: "jqmoverlay", closeclass: "jqmclose", trigger: ".jqmodal", ajax: d, ajaxtext: "", target: d, modal: d, totop: d, onshow: d, onhide: d, onload: d }; return this.each(function () { if (this._jqm) return l[this._jqm].c = c.extend({}, l[this._jqm].c, a); n++; this._jqm = n; l[n] = { c: c.extend(k, c.jqm.params, a), a: d, w: c(this).addclass("jqmid" + n), s: n }; k.trigger && c(this).jqmaddtrigger(k.trigger) }) }; c.fn.jqmaddclose = function (a) { return r(this, a, "jqmhide") }; c.fn.jqmaddtrigger = function (a) { return r(this, a, "jqmshow") }; c.fn.jqmshow = function (a) { return this.each(function () { c.jqm.open(this._jqm, a) }) }; c.fn.jqmhide = function (a) { return this.each(function () { c.jqm.close(this._jqm, a) }) }; c.jqm = { hash: {}, open: function (a, k) { var b = l[a], e = b.c, h = "." + e.closeclass, f = parseint(b.w.css("z-index")), f = 0 < f ? f : 3e3, g = c("
").css({ height: "100%", width: "100%", position: "fixed", left: 0, top: 0, "z-index": f - 1, opacity: e.overlay / 100 }); if (b.a) return d; b.t = k; b.a = !0; b.w.css("z-index", f); e.modal ? (m[0] || settimeout(function () { s("bind") }, 1), m.push(a)) : 0 < e.overlay ? e.closeoverlay && b.w.jqmaddclose(g) : g = d; b.o = g ? g.addclass(e.overlayclass).prependto("body") : d; e.ajax ? (f = e.target || b.w, g = e.ajax, f = "string" == typeof f ? c(f, b.w) : c(f), g = "@" == g.substr(0, 1) ? c(k).attr(g.substring(1)) : g, f.html(e.ajaxtext).load(g, function () { e.onload && e.onload.call(this, b); h && b.w.jqmaddclose(c(h, b.w)); p(b) })) : h && b.w.jqmaddclose(c(h, b.w)); e.totop && b.o && b.w.before('').insertafter(b.o); e.onshow ? e.onshow(b) : b.w.show(); p(b); return d }, close: function (a) { a = l[a]; if (!a.a) return d; a.a = d; m[0] && (m.pop(), m[0] || s("unbind")); a.c.totop && a.o && c("#jqmp" + a.w[0]._jqm).after(a.w).remove(); if (a.c.onhide) a.c.onhide(a); else a.w.hide(), a.o && a.o.remove(); return d }, params: {} }; var n = 0, l = c.jqm.hash, m = [], d = !1, p = function (a) { try { c(":input:visible", a.w)[0].focus() } catch (d) { } }, s = function (a) { c(document)[a]("keypress", q)[a]("keydown", q)[a]("mousedown", q) }, q = function (a) { var d = l[m[m.length - 1]], b = !c(a.target).parents(".jqmid" + d.s)[0]; b && (c(".jqmid" + d.s).each(function () { var d = c(this), h = d.offset(); if (h.top <= a.pagey && a.pagey <= h.top + d.height() && h.left <= a.pagex && a.pagex <= h.left + d.width()) return b = !1 }), p(d)); return !b }, r = function (a, k, b) { return a.each(function () { var a = this._jqm; c(k).each(function () { this[b] || (this[b] = [], c(this).click(function () { for (var a in { jqmshow: 1, jqmhide: 1 }) for (var b in this[a]) if (l[this[a][b]]) l[this[a][b]].w[a](this); return d })); this[b].push(a) }) }) } })(jquery); (function (b) { b.fn.jqdrag = function (a) { return h(this, a, "d") }; b.fn.jqresize = function (a, b) { return h(this, a, "r", b) }; b.jqdnr = { dnr: {}, e: 0, drag: function (a) { "d" == d.k ? e.css({ left: d.x + a.pagex - d.px, top: d.y + a.pagey - d.py }) : (e.css({ width: math.max(a.pagex - d.px + d.w, 0), height: math.max(a.pagey - d.py + d.h, 0) }), f && g.css({ width: math.max(a.pagex - f.px + f.w, 0), height: math.max(a.pagey - f.py + f.h, 0) })); return !1 }, stop: function () { b(document).unbind("mousemove", c.drag).unbind("mouseup", c.stop) } }; var c = b.jqdnr, d = c.dnr, e = c.e, g, f, h = function (a, c, h, n) { return a.each(function () { c = c ? b(c, a) : a; c.bind("mousedown", { e: a, k: h }, function (a) { var c = a.data, k = {}; e = c.e; g = n ? b(n) : !1; if ("relative" != e.css("position")) try { e.position(k) } catch (h) { } d = { x: k.left || l("left") || 0, y: k.top || l("top") || 0, w: l("width") || e[0].scrollwidth || 0, h: l("height") || e[0].scrollheight || 0, px: a.pagex, py: a.pagey, k: c.k }; f = g && "d" != c.k ? { x: k.left || m("left") || 0, y: k.top || m("top") || 0, w: g[0].offsetwidth || m("width") || 0, h: g[0].offsetheight || m("height") || 0, px: a.pagex, py: a.pagey, k: c.k } : !1; if (b("input.hasdatepicker", e[0])[0]) try { b("input.hasdatepicker", e[0]).datepicker("hide") } catch (p) { } b(document).mousemove(b.jqdnr.drag).mouseup(b.jqdnr.stop); return !1 }) }) }, l = function (a) { return parseint(e.css(a), 10) || !1 }, m = function (a) { return parseint(g.css(a), 10) || !1 } })(jquery); (function (b) { b.jgrid.extend({ setsubgrid: function () { return this.each(function () { var d, c; this.p.subgridoptions = b.extend({ plusicon: "ui-icon-plus", minusicon: "ui-icon-minus", openicon: "ui-icon-carat-1-sw", expandonload: !1, delayonload: 50, selectonexpand: !1, selectoncollapse: !1, reloadonexpand: !0 }, this.p.subgridoptions || {}); this.p.colnames.unshift(""); this.p.colmodel.unshift({ name: "subgrid", //width: b.jgrid.cell_width ? this.p.subgridwidth + this.p.celllayout : this.p.subgridwidth, width:"25px",//abcabc123! sortable: !1, resizable: !1, hidedlg: !0, search: !1, fixed: !0 }); d = this.p.subgridmodel; if (d[0]) for (d[0].align = b.extend([], d[0].align || []), c = 0; c < d[0].name.length; c++) d[0].align[c] = d[0].align[c] || "left" }) }, addsubgridcell: function (b, c) { var a = "", p, n; this.each(function () { a = this.formatcol(b, c); n = this.p.id; p = this.p.subgridoptions.plusicon }); //return '" //abcabc123! return '
" }, addsubgrid: function (d, c) { return this.each(function () { var a = this; if (a.grid) { var p = function (c, d, h) { d = b("").html(d); b(c).append(d) }, n = function (c, d) { var h, f, e, g = b("
"), k = b(""); for (f = 0; f < a.p.subgridmodel[0].name.length; f++) h = b(""), b(h).html(a.p.subgridmodel[0].name[f]), b(h).width(a.p.subgridmodel[0].width[f]), b(k).append(h); b(g).append(k); c && (e = a.p.xmlreader.subgrid, b(e.root + " " + e.row, c).each(function () { k = b(""); if (!0 === e.repeatitems) b(e.cell, this).each(function (a) { p(k, b(this).text() || " ", a) }); else { var c = a.p.subgridmodel[0].mapping || a.p.subgridmodel[0].name; if (c) for (f = 0; f < c.length; f++) p(k, b(c[f], this).text() || " ", f) } b(g).append(k) })); h = b("table:first", a.grid.bdiv).attr("id") + "_"; b("#" + b.jgrid.jqid(h + d)).append(g); a.grid.hdiv.loading = !1; b("#load_" + b.jgrid.jqid(a.p.id)).hide(); return !1 }, r = function (c, d) { var h, f, e, g, k, m = b("
"), l = b(""); for (f = 0; f < a.p.subgridmodel[0].name.length; f++) h = b(""), b(h).html(a.p.subgridmodel[0].name[f]), b(h).width(a.p.subgridmodel[0].width[f]), b(l).append(h); b(m).append(l); if (c && (g = a.p.jsonreader.subgrid, h = b.jgrid.getaccessor(c, g.root), void 0 !== h)) for (f = 0; f < h.length; f++) { e = h[f]; l = b(""); if (!0 === g.repeatitems) for (g.cell && (e = e[g.cell]), k = 0; k < e.length; k++) p(l, e[k] || " ", k); else { var n = a.p.subgridmodel[0].mapping || a.p.subgridmodel[0].name; if (n.length) for (k = 0; k < n.length; k++) p(l, e[n[k]] || " ", k) } b(m).append(l) } f = b("table:first", a.grid.bdiv).attr("id") + "_"; b("#" + b.jgrid.jqid(f + d)).append(m); a.grid.hdiv.loading = !1; b("#load_" + b.jgrid.jqid(a.p.id)).hide(); return !1 }, v = function (c) { var e, d, f, g; e = b(c).attr("id"); d = { nd_: (new date).gettime() }; d[a.p.prmnames.subgridid] = e; if (!a.p.subgridmodel[0]) return !1; if (a.p.subgridmodel[0].params) for (g = 0; g < a.p.subgridmodel[0].params.length; g++) for (f = 0; f < a.p.colmodel.length; f++) a.p.colmodel[f].name === a.p.subgridmodel[0].params[g] && (d[a.p.colmodel[f].name] = b("td:eq(" + f + ")", c).text().replace(/\ \;/ig, "")); if (!a.grid.hdiv.loading) switch (a.grid.hdiv.loading = !0, b("#load_" + b.jgrid.jqid(a.p.id)).show(), a.p.subgridtype || (a.p.subgridtype = a.p.datatype), b.isfunction(a.p.subgridtype) ? a.p.subgridtype.call(a, d) : a.p.subgridtype = a.p.subgridtype.tolowercase(), a.p.subgridtype) { case "xml": case "json": b.ajax(b.extend({ type: a.p.mtype, url: a.p.subgridurl, datatype: a.p.subgridtype, data: b.isfunction(a.p.serializesubgriddata) ? a.p.serializesubgriddata.call(a, d) : d, complete: function (c) { "xml" === a.p.subgridtype ? n(c.responsexml, e) : r(b.jgrid.parse(c.responsetext), e) } }, b.jgrid.ajaxoptions, a.p.ajaxsubgridoptions || {})) } return !1 }, e, m, s, t = 0, g, l; b.each(a.p.colmodel, function () { !0 !== this.hidden && "rn" !== this.name && "cb" !== this.name || t++ }); var u = a.rows.length, q = 1; void 0 !== c && 0 < c && (q = c, u = c + 1); for (; q < u;) b(a.rows[q]).hasclass("jqgrow") && b(a.rows[q].cells[d]).bind("click", function () { var c = b(this).parent("tr")[0]; l = c.nextsibling; if (b(this).hasclass("sgcollapsed")) { m = a.p.id; e = c.id; if (!0 === a.p.subgridoptions.reloadonexpand || !1 === a.p.subgridoptions.reloadonexpand && !b(l).hasclass("ui-subgrid")) { s = 1 <= d ? " " : ""; g = b(a).triggerhandler("jqgridsubgridbeforeexpand", [m + "_" + e, e]); (g = !1 === g || "stop" === g ? !1 : !0) && b.isfunction(a.p.subgridbeforeexpand) && (g = a.p.subgridbeforeexpand.call(a, m + "_" + e, e)); if (!1 === g) return !1; b(c).after("" + s + "
"); b(a).triggerhandler("jqgridsubgridrowexpanded", [m + "_" + e, e]); b.isfunction(a.p.subgridrowexpanded) ? a.p.subgridrowexpanded.call(a, m + "_" + e, e) : v(c) } else b(l).show(); //b(this).html("").removeclass("sgcollapsed").addclass("sgexpanded"); //abcabc123! b(this).html("
").removeclass("sgcollapsed").addclass("sgexpanded"); a.p.subgridoptions.selectonexpand && b(a).jqgrid("setselection", e) } else if (b(this).hasclass("sgexpanded")) { g = b(a).triggerhandler("jqgridsubgridrowcolapsed", [m + "_" + e, e]); g = !1 === g || "stop" === g ? !1 : !0; e = c.id; g && b.isfunction(a.p.subgridrowcolapsed) && (g = a.p.subgridrowcolapsed.call(a, m + "_" + e, e)); if (!1 === g) return !1; !0 === a.p.subgridoptions.reloadonexpand ? b(l).remove(".ui-subgrid") : b(l).hasclass("ui-subgrid") && b(l).hide(); // b(this).html("").removeclass("sgexpanded").addclass("sgcollapsed"); //abcabc123! b(this).html("
").removeclass("sgexpanded").addclass("sgcollapsed"); a.p.subgridoptions.selectoncollapse && b(a).jqgrid("setselection", e) } return !1 }), q++; !0 === a.p.subgridoptions.expandonload && b(a.rows).filter(".jqgrow").each(function (a, c) { b(c.cells[0]).click() }); a.subgridxml = function (a, b) { n(a, b) }; a.subgridjson = function (a, b) { r(a, b) } } }) }, expandsubgridrow: function (d) { return this.each(function () { if ((this.grid || d) && !0 === this.p.subgrid) { var c = b(this).jqgrid("getind", d, !0); c && (c = b("td.sgcollapsed", c)[0]) && b(c).trigger("click") } }) }, collapsesubgridrow: function (d) { return this.each(function () { if ((this.grid || d) && !0 === this.p.subgrid) { var c = b(this).jqgrid("getind", d, !0); c && (c = b("td.sgexpanded", c)[0]) && b(c).trigger("click") } }) }, togglesubgridrow: function (d) { return this.each(function () { if ((this.grid || d) && !0 === this.p.subgrid) { var c = b(this).jqgrid("getind", d, !0); if (c) { var a = b("td.sgcollapsed", c)[0]; a ? b(a).trigger("click") : (a = b("td.sgexpanded", c)[0]) && b(a).trigger("click") } } }) } }) })(jquery); (function (d) { d.extend(d.jgrid, { template: function (b) { var k = d.makearray(arguments).slice(1), a, c = k.length; null == b && (b = ""); return b.replace(/\{([\w\-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g, function (b, m) { if (!isnan(parseint(m, 10))) return k[parseint(m, 10)]; for (a = 0; a < c; a++) if (d.isarray(k[a])) for (var e = k[a], f = e.length; f--;) if (m === e[f].nm) return e[f].v }) } }); d.jgrid.extend({ groupingsetup: function () { return this.each(function () { var b, k, a = this.p.colmodel, c = this.p.groupingview; if (null === c || "object" !== typeof c && !d.isfunction(c)) this.p.grouping = !1; else if (c.groupfield.length) { void 0 === c.visibiltyonnextgrouping && (c.visibiltyonnextgrouping = []); c.lastvalues = []; c._locgr || (c.groups = []); c.counters = []; for (b = 0; b < c.groupfield.length; b++) c.grouporder[b] || (c.grouporder[b] = "asc"), c.grouptext[b] || (c.grouptext[b] = "{0}"), "boolean" !== typeof c.groupcolumnshow[b] && (c.groupcolumnshow[b] = !0), "boolean" !== typeof c.groupsummary[b] && (c.groupsummary[b] = !1), c.groupsummarypos[b] || (c.groupsummarypos[b] = "footer"), !0 === c.groupcolumnshow[b] ? (c.visibiltyonnextgrouping[b] = !0, d(this).jqgrid("showcol", c.groupfield[b])) : (c.visibiltyonnextgrouping[b] = d("#" + d.jgrid.jqid(this.p.id + "_" + c.groupfield[b])).is(":visible"), d(this).jqgrid("hidecol", c.groupfield[b])); c.summary = []; c.hidefirstgroupcol && (c.formatdisplayfield[0] = function (a) { return a }); b = 0; for (k = a.length; b < k; b++) c.hidefirstgroupcol && !a[b].hidden && c.groupfield[0] === a[b].name && (a[b].formatter = function () { return "" }), a[b].summarytype && (a[b].summarydivider ? c.summary.push({ nm: a[b].name, st: a[b].summarytype, v: "", sd: a[b].summarydivider, vd: "", sr: a[b].summaryround, srt: a[b].summaryroundtype || "round" }) : c.summary.push({ nm: a[b].name, st: a[b].summarytype, v: "", sr: a[b].summaryround, srt: a[b].summaryroundtype || "round" })) } else this.p.grouping = !1 }) }, groupingprepare: function (b, k) { this.each(function () { var a = this.p.groupingview, c = this, g, m = a.groupfield.length, e, f, h, p = 0; for (g = 0; g < m; g++) e = a.groupfield[g], h = a.displayfield[g], f = b[e], h = null == h ? null : b[h], null == h && (h = f), void 0 !== f && (0 === k ? (a.groups.push({ idx: g, dataindex: e, value: f, displayvalue: h, startrow: k, cnt: 1, summary: [] }), a.lastvalues[g] = f, a.counters[g] = { cnt: 1, pos: a.groups.length - 1, summary: d.extend(!0, [], a.summary) }) : "object" === typeof f || (d.isarray(a.isinthesamegroup) && d.isfunction(a.isinthesamegroup[g]) ? a.isinthesamegroup[g].call(c, a.lastvalues[g], f, g, a) : a.lastvalues[g] === f) ? 1 === p ? (a.groups.push({ idx: g, dataindex: e, value: f, displayvalue: h, startrow: k, cnt: 1, summary: [] }), a.lastvalues[g] = f, a.counters[g] = { cnt: 1, pos: a.groups.length - 1, summary: d.extend(!0, [], a.summary) }) : (a.counters[g].cnt += 1, a.groups[a.counters[g].pos].cnt = a.counters[g].cnt) : (a.groups.push({ idx: g, dataindex: e, value: f, displayvalue: h, startrow: k, cnt: 1, summary: [] }), a.lastvalues[g] = f, p = 1, a.counters[g] = { cnt: 1, pos: a.groups.length - 1, summary: d.extend(!0, [], a.summary) }), d.each(a.counters[g].summary, function () { d.isfunction(this.st) ? this.v = this.st.call(c, this.v, this.nm, b) : (this.v = d(c).jqgrid("groupingcalculations.handler", this.st, this.v, this.nm, this.sr, this.srt, b), "avg" === this.st.tolowercase() && this.sd && (this.vd = d(c).jqgrid("groupingcalculations.handler", this.st, this.vd, this.sd, this.sr, this.srt, b))) }), a.groups[a.counters[g].pos].summary = a.counters[g].summary) }); return this }, groupingtoggle: function (b) { this.each(function () { var k = this.p.groupingview, a = b.split("_"), c = parseint(a[a.length - 2], 10); a.splice(a.length - 2, 2); var g = a.join("_"), a = k.minusicon, m = k.plusicon, e = d("#" + d.jgrid.jqid(b)), e = e.length ? e[0].nextsibling : null, f = d("#" + d.jgrid.jqid(b) + " span.tree-wrap-" + this.p.direction), h = function (a) { a = d.map(a.split(" "), function (a) { if (a.substring(0, g.length + 1) === g + "_") return parseint(a.substring(g.length + 1), 10) }); return 0 < a.length ? a[0] : void 0 }, p, r = !1, q = this.p.frozencolumns ? this.p.id + "_frozen" : !1, n = q ? d("#" + d.jgrid.jqid(b), "#" + d.jgrid.jqid(q)) : !1, n = n && n.length ? n[0].nextsibling : null; if (f.hasclass(a)) { if (k.showsummaryonhide) { if (e) for (; e && !(d(e).hasclass("jqfoot") && parseint(d(e).attr("jqfootlevel"), 10) <= c) ;) d(e).hide(), e = e.nextsibling, q && (d(n).hide(), n = n.nextsibling) } else if (e) for (; e;) { k = h(e.classname); if (void 0 !== k && k <= c) break; d(e).hide(); e = e.nextsibling; q && (d(n).hide(), n = n.nextsibling) } f.removeclass(a).addclass(m); r = !0 } else { if (e) for (p = void 0; e;) { k = h(e.classname); void 0 === p && (p = void 0 === k); if (void 0 !== k) { if (k <= c) break; k === c + 1 && (d(e).show().find(">td>span.tree-wrap-" + this.p.direction).removeclass(a).addclass(m), q && d(n).show().find(">td>span.tree-wrap-" + this.p.direction).removeclass(a).addclass(m)) } else p && (d(e).show(), q && d(n).show()); e = e.nextsibling; q && (n = n.nextsibling) } f.removeclass(m).addclass(a) } d(this).triggerhandler("jqgridgroupingclickgroup", [b, r]); d.isfunction(this.p.onclickgroup) && this.p.onclickgroup.call(this, b, r) }); return !1 }, groupingrender: function (b, k, a, c) { return this.each(function () { function g(a, b, c) { var d = !1; if (0 === b) d = c[a]; else { var e = c[a].idx; if (0 === e) d = c[a]; else for (; 0 <= a; a--) if (c[a].idx === e - b) { d = c[a]; break } } return d } function m(a, b, c, f) { var h = g(a, b, c), m = e.p.colmodel, n, q = h.cnt; a = ""; var p; for (p = f; p < k; p++) { var r = " ", t = "{0}"; d.each(h.summary, function () { if (this.nm === m[p].name) { m[p].summarytpl && (t = m[p].summarytpl); "string" === typeof this.st && "avg" === this.st.tolowercase() && (this.sd && this.vd ? this.v /= this.vd : this.v && 0 < q && (this.v /= q)); try { this.groupcount = h.cnt, this.groupindex = h.dataindex, this.groupvalue = h.value, n = e.formatter("", this.v, p, this) } catch (a) { n = this.v } r = "" + d.jgrid.format(t, n) + ""; 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 += "
").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) + ""; 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_\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_") : d + (e + "<" + b + ">" + a.tostring() + "")); 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 += "" } 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);