📄 cache-1236927416-7c522a496d168a80ecd0d532a9b09d62.javascript
字号:
;(function($){
/**
* jqGrid English Translation
* Tony Tomov tony@trirand.com
* http://trirand.com/blog/
* 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.defaults = {
recordtext: "Row(s)",
loadtext: "Loading...",
pgtext : "/"
};
$.jgrid.search = {
caption: "Search...",
Find: "Find",
Reset: "Reset",
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','ends with','contains' ]
};
$.jgrid.edit = {
addCaption: "Add Record",
editCaption: "Edit Record",
bSubmit: "Submit",
bCancel: "Cancel",
bClose: "Close",
processData: "Processing...",
msg: {
required:"Field is required",
number:"Please, enter valid number",
minValue:"value must be greater than or equal to ",
maxValue:"value must be less than or equal to",
email: "is not a valid e-mail",
integer: "Please, enter valid integer value",
date: "Please, enter valid date value"
}
};
$.jgrid.del = {
caption: "Delete",
msg: "Delete selected record(s)?",
bSubmit: "Delete",
bCancel: "Cancel",
processData: "Processing..."
};
$.jgrid.nav = {
edittext: " ",
edittitle: "Edit selected row",
addtext:" ",
addtitle: "Add new row",
deltext: " ",
deltitle: "Delete selected row",
searchtext: " ",
searchtitle: "Find records",
refreshtext: "",
refreshtitle: "Reload Grid",
alertcap: "Warning",
alerttext: "Please, select row"
};
// setcolumns module
$.jgrid.col ={
caption: "Show/Hide Columns",
bSubmit: "Submit",
bCancel: "Cancel"
};
$.jgrid.errors = {
errcap : "Error",
nourl : "No url is set",
norecords: "No records to process",
model : "Length of colNames <> colModel!"
};
$.jgrid.formatter = {
integer : {thousandsSeparator: " ", defaulValue: 0},
number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaulValue: 0},
currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaulValue: 0},
date : {
dayNames: [
"Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat",
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
],
monthNames: [
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
],
AmPm : ["am","pm","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: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: 'show',
addParam : ''
};
// US
// GB
// CA
// AU
})(jQuery);
;(function ($) {
/*
* jqGrid 3.4.3 - jQuery Grid
* Copyright (c) 2008, Tony Tomov, tony@trirand.com
* Dual licensed under the MIT and GPL licenses
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* Date: 2009-03-12 rev 84
*/
$.fn.jqGrid = function( p ) {
p = $.extend(true,{
url: "",
height: 150,
page: 1,
rowNum: 20,
records: 0,
pager: "",
pgbuttons: true,
pginput: true,
colModel: [],
rowList: [],
colNames: [],
sortorder: "asc",
sortname: "",
datatype: "xml",
mtype: "GET",
//imgpath: "",
imgpath: _MISC_DIR + "jqGrid-v3.4.3/themes/steel/images",
sortascimg: "sort_asc.gif",
sortdescimg: "sort_desc.gif",
firstimg: "first.gif",
previmg: "prev.gif",
nextimg: "next.gif",
lastimg: "last.gif",
altRows: true,
selarrrow: [],
savedRow: [],
shrinkToFit: true,
xmlReader: {},
jsonReader: {},
subGrid: false,
subGridModel :[],
lastpage: 0,
lastsort: 0,
selrow: null,
beforeSelectRow: null,
onSelectRow: null,
onSortCol: null,
ondblClickRow: null,
onRightClickRow: null,
onPaging: null,
onSelectAll: null,
loadComplete: null,
gridComplete: null,
loadError: null,
loadBeforeSend: null,
afterInsertRow: null,
beforeRequest: null,
onHeaderClick: null,
viewrecords: false,
loadonce: false,
multiselect: false,
multikey: false,
editurl: null,
search: false,
searchdata: {},
caption: "",
hidegrid: true,
hiddengrid: false,
postData: {},
userData: {},
treeGrid : false,
treeGridModel : 'nested',
treeReader : {},
treeANode : 0,
ExpandColumn: null,
tree_root_level : 0,
prmNames: {page:"page",rows:"rows", sort: "sidx",order: "sord"},
sortclass: "grid_sort",
resizeclass: "grid_resize",
forceFit : false,
gridstate : "visible",
cellEdit: false,
cellsubmit: "remote",
nv:0,
loadui: "enable",
toolbar: [false,""],
scroll: false,
multiboxonly : false,
scrollrows : false,
deselectAfterSort: true
}, $.jgrid.defaults, p || {});
var grid={
headers:[],
cols:[],
dragStart: function(i,x) {
this.resizing = { idx: i, startX: x};
this.hDiv.style.cursor = "e-resize";
},
dragMove: function(x) {
if(this.resizing) {
var diff = x-this.resizing.startX,
h = this.headers[this.resizing.idx],
newWidth = h.width + diff, hn, nWn;
if(newWidth > 25) {
if(p.forceFit===true ){
hn = this.headers[this.resizing.idx+p.nv];
nWn = hn.width - diff;
if(nWn >25) {
h.el.style.width = newWidth+"px";
h.newWidth = newWidth;
this.cols[this.resizing.idx].style.width = newWidth+"px";
hn.el.style.width = nWn +"px";
hn.newWidth = nWn;
this.cols[this.resizing.idx+p.nv].style.width = nWn+"px";
this.newWidth = this.width;
}
} else {
h.el.style.width = newWidth+"px";
h.newWidth = newWidth;
this.cols[this.resizing.idx].style.width = newWidth+"px";
this.newWidth = this.width+diff;
$('table:first',this.bDiv).css("width",this.newWidth +"px");
$('table:first',this.hDiv).css("width",this.newWidth +"px");
this.hDiv.scrollLeft = this.bDiv.scrollLeft;
}
}
}
},
dragEnd: function() {
this.hDiv.style.cursor = "default";
if(this.resizing) {
var idx = this.resizing.idx;
this.headers[idx].width = this.headers[idx].newWidth || this.headers[idx].width;
this.cols[idx].style.width = this.headers[idx].newWidth || this.headers[idx].width;
// here code to set the width in colmodel
if(p.forceFit===true){
this.headers[idx+p.nv].width = this.headers[idx+p.nv].newWidth || this.headers[idx+p.nv].width;
this.cols[idx+p.nv].style.width = this.headers[idx+p.nv].newWidth || this.headers[idx+p.nv].width;
}
if(this.newWidth) {this.width = this.newWidth;}
this.resizing = false;
}
},
scrollGrid: function() {
if(p.scroll === true) {
var scrollTop = this.bDiv.scrollTop;
if (scrollTop != this.scrollTop) {
this.scrollTop = scrollTop;
if ((this.bDiv.scrollHeight-scrollTop-$(this.bDiv).height()) <= 0) {
if(parseInt(p.page,10)+1<=parseInt(p.lastpage,10)) {
p.page = parseInt(p.page,10)+1;
this.populate();
}
}
}
}
this.hDiv.scrollLeft = this.bDiv.scrollLeft;
}
};
$.fn.getGridParam = function(pName) {
var $t = this[0];
if (!$t.grid) {return;}
if (!pName) { return $t.p; }
else {return $t.p[pName] ? $t.p[pName] : null;}
};
$.fn.setGridParam = function (newParams){
return this.each(function(){
if (this.grid && typeof(newParams) === 'object') {$.extend(true,this.p,newParams);}
});
};
$.fn.getDataIDs = function () {
var ids=[];
this.each(function(){
$(this.rows).slice(1).each(function(i){
ids[i]=this.id;
});
});
return ids;
};
$.fn.setSortName = function (newsort) {
return this.each(function(){
var $t = this;
for(var i=0;i< $t.p.colModel.length;i++){
if($t.p.colModel[i].name===newsort || $t.p.colModel[i].index===newsort){
$("tr th:eq("+$t.p.lastsort+") div img",$t.grid.hDiv).remove();
$t.p.lastsort = i;
$t.p.sortname=newsort;
break;
}
}
});
};
$.fn.setSelection = function(selection,onsr,sd) {
return this.each(function(){
var $t = this, stat,pt, ind;
onsr = onsr === false ? false : true;
if(selection===false) {pt = sd;}
else { ind = $($t).getInd($t.rows,selection); pt=$($t.rows[ind]);}
selection = $(pt).attr("id");
if (!pt.html()) {return;}
if($t.p.selrow && $t.p.scrollrows===true) {
var olr = $($t).getInd($t.rows,$t.p.selrow);
var ner = $($t).getInd($t.rows,selection);
if(ner >=0 ){
if(ner > olr ) {
scrGrid(ner,'d');
} else {
scrGrid(ner,'u');
}
}
}
if(!$t.p.multiselect) {
if($(pt).attr("class") !== "subgrid") {
if( $t.p.selrow ) {$("tr#"+$t.p.selrow.replace(".", "\\."),$t.grid.bDiv).removeClass("selected");}
$t.p.selrow = selection;
$(pt).addClass("selected");
if( $t.p.onSelectRow && onsr) { $t.p.onSelectRow($t.p.selrow, true); }
}
} else {
$t.p.selrow = selection;
var ia = $.inArray($t.p.selrow,$t.p.selarrrow);
if ( ia === -1 ){
if($(pt).attr("class") !== "subgrid") { $(pt).addClass("selected");}
stat = true;
$("#jqg_"+$t.p.selrow.replace(".", "\\.") ,$t.rows).attr("checked",stat);
$t.p.selarrrow.push($t.p.selrow);
if( $t.p.onSelectRow && onsr) { $t.p.onSelectRow($t.p.selrow, stat); }
} else {
if($(pt).attr("class") !== "subgrid") { $(pt).removeClass("selected");}
stat = false;
$("#jqg_"+$t.p.selrow.replace(".", "\\.") ,$t.rows).attr("checked",stat);
$t.p.selarrrow.splice(ia,1);
if( $t.p.onSelectRow && onsr) { $t.p.onSelectRow($t.p.selrow, stat); }
var tpsr = $t.p.selarrrow[0];
$t.p.selrow = (tpsr==undefined) ? null : tpsr;
}
}
function scrGrid(iR,tp){
var ch = $($t.grid.bDiv)[0].clientHeight,
st = $($t.grid.bDiv)[0].scrollTop,
nROT = $t.rows[iR].offsetTop+$t.rows[iR].clientHeight,
pROT = $t.rows[iR].offsetTop;
if(tp == 'd') {
if(nROT >= ch) { $($t.grid.bDiv)[0].scrollTop = st + nROT-pROT; }
}
if(tp == 'u'){
if (pROT < st) { $($t.grid.bDiv)[0].scrollTop = st - nROT+pROT; }
}
}
});
};
$.fn.resetSelection = function(){
return this.each(function(){
var t = this, ind;
if(!t.p.multiselect) {
if(t.p.selrow) {
$("tr#"+t.p.selrow.replace(".", "\\."),t.grid.bDiv).removeClass("selected");
t.p.selrow = null;
}
} else {
$(t.p.selarrrow).each(function(i,n){
ind = $(t).getInd(t.rows,n);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -