code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231 values | license stringclasses 13 values | size int64 1 2.01M |
|---|---|---|---|---|---|
/*
* jqModal - Minimalist Modaling with jQuery
* (http://dev.iceburg.net/jquery/jqmodal/)
*
* Copyright (c) 2007,2008 Brice Burgess <bhb@iceburg.net>
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* $Version: 07/06/2008 +r13
*/
(function($) {
$.fn.jqm=function(o){
var p={
overlay: 50,
closeoverlay : true,
overlayClass: 'jqmOverlay',
closeClass: 'jqmClose',
trigger: '.jqModal',
ajax: F,
ajaxText: '',
target: F,
modal: F,
toTop: F,
onShow: F,
onHide: F,
onLoad: F
};
return this.each(function(){if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s;
H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s};
if(p.trigger)$(this).jqmAddTrigger(p.trigger);
});};
$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');};
$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');};
$.fn.jqmShow=function(t){return this.each(function(){$.jqm.open(this._jqm,t);});};
$.fn.jqmHide=function(t){return this.each(function(){$.jqm.close(this._jqm,t)});};
$.jqm = {
hash:{},
open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index')));z=(z>0)?z:3000;var o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);
if(c.modal) {if(!A[0])setTimeout(function(){L('bind');},1);A.push(s);}
else if(c.overlay > 0) {if(c.closeoverlay) h.w.jqmAddClose(o);}
else o=F;
h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;
if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in {Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'");}}
if(c.ajax) {var r=c.target||h.w,u=c.ajax;r=(typeof r == 'string')?$(r,h.w):$(r);u=(u.substr(0,1) == '@')?$(t).attr(u.substring(1)):u;
r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h);});}
else if(cc)h.w.jqmAddClose($(cc,h.w));
if(c.toTop&&h.o)h.w.before('<span id="jqmP'+h.w[0]._jqm+'"></span>').insertAfter(h.o);
(c.onShow)?c.onShow(h):h.w.show();e(h);return F;
},
close:function(s){var h=H[s];if(!h.a)return F;h.a=F;
if(A[0]){A.pop();if(!A[0])L('unbind');}
if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove();
if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove();} return F;
},
params:{}};
var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&($.browser.version == "6.0"),F=false,
e=function(h){var i=$('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0});if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i); f(h);},
f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}},
L=function(t){$(document)[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},
m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return !r;},
hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function() {
if(!this[c]){this[c]=[];$(this).click(function(){for(var i in {jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});};
})(jQuery); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/jqModal.js | JavaScript | art | 3,404 |
(function($){
/**
* jqGrid extension for custom methods
* 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-2.0.html
**/
/*global jQuery, $ */
$.jgrid.extend({
getColProp : function(colname){
var ret ={}, $t = this[0];
if ( !$t.grid ) { return false; }
var cM = $t.p.colModel;
for ( var i =0;i<cM.length;i++ ) {
if ( cM[i].name == colname ) {
ret = cM[i];
break;
}
}
return ret;
},
setColProp : function(colname, obj){
//do not set width will not work
return this.each(function(){
if ( this.grid ) {
if ( obj ) {
var cM = this.p.colModel;
for ( var i =0;i<cM.length;i++ ) {
if ( cM[i].name == colname ) {
$.extend(this.p.colModel[i],obj);
break;
}
}
}
}
});
},
sortGrid : function(colname,reload, sor){
return this.each(function(){
var $t=this,idx=-1;
if ( !$t.grid ) { return;}
if ( !colname ) { colname = $t.p.sortname; }
for ( var i=0;i<$t.p.colModel.length;i++ ) {
if ( $t.p.colModel[i].index == colname || $t.p.colModel[i].name==colname ) {
idx = i;
break;
}
}
if ( idx!=-1 ){
var sort = $t.p.colModel[idx].sortable;
if ( typeof sort !== 'boolean' ) { sort = true; }
if ( typeof reload !=='boolean' ) { reload = false; }
if ( sort ) { $t.sortData("jqgh_"+$t.p.id+"_"+colname, idx, reload, sor); }
}
});
},
GridDestroy : function () {
return this.each(function(){
if ( this.grid ) {
if ( this.p.pager ) { // if not part of grid
$(this.p.pager).remove();
}
var gid = this.id;
try {
$("#gbox_"+gid).remove();
} catch (_) {}
}
});
},
GridUnload : function(){
return this.each(function(){
if ( !this.grid ) {return;}
var defgrid = {id: $(this).attr('id'),cl: $(this).attr('class')};
if (this.p.pager) {
$(this.p.pager).empty().removeClass("ui-state-default ui-jqgrid-pager corner-bottom");
}
var newtable = document.createElement('table');
$(newtable).attr({id:defgrid.id});
newtable.className = defgrid.cl;
var gid = this.id;
$(newtable).removeClass("ui-jqgrid-btable");
if( $(this.p.pager).parents("#gbox_"+gid).length === 1 ) {
$(newtable).insertBefore("#gbox_"+gid).show();
$(this.p.pager).insertBefore("#gbox_"+gid);
} else {
$(newtable).insertBefore("#gbox_"+gid).show();
}
$("#gbox_"+gid).remove();
});
},
setGridState : function(state) {
return this.each(function(){
if ( !this.grid ) {return;}
var $t = this;
if(state == 'hidden'){
$(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv","#gview_"+$t.p.id).slideUp("fast");
if($t.p.pager) {$($t.p.pager).slideUp("fast");}
if($t.p.toppager) {$($t.p.toppager).slideUp("fast");}
if($t.p.toolbar[0]===true) {
if( $t.p.toolbar[1]=='both') {
$($t.grid.ubDiv).slideUp("fast");
}
$($t.grid.uDiv).slideUp("fast");
}
if($t.p.footerrow) { $(".ui-jqgrid-sdiv","#gbox_"+$t.p.id).slideUp("fast"); }
$(".ui-jqgrid-titlebar-close span",$t.grid.cDiv).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");
$t.p.gridstate = 'hidden';
} else if(state=='visible') {
$(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv","#gview_"+$t.p.id).slideDown("fast");
if($t.p.pager) {$($t.p.pager).slideDown("fast");}
if($t.p.toppager) {$($t.p.toppager).slideDown("fast");}
if($t.p.toolbar[0]===true) {
if( $t.p.toolbar[1]=='both') {
$($t.grid.ubDiv).slideDown("fast");
}
$($t.grid.uDiv).slideDown("fast");
}
if($t.p.footerrow) { $(".ui-jqgrid-sdiv","#gbox_"+$t.p.id).slideDown("fast"); }
$(".ui-jqgrid-titlebar-close span",$t.grid.cDiv).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");
$t.p.gridstate = 'visible';
}
});
},
filterToolbar : function(p){
p = $.extend({
autosearch: true,
searchOnEnter : true,
beforeSearch: null,
afterSearch: null,
beforeClear: null,
afterClear: null,
searchurl : '',
stringResult: false,
groupOp: 'AND',
defaultSearch : "bw"
},p || {});
return this.each(function(){
var $t = this;
if(this.ftoolbar) { return; }
var triggerToolbar = function() {
var sdata={}, j=0, v, nm, sopt={},so;
$.each($t.p.colModel,function(i,n){
nm = this.index || this.name;
switch (this.stype) {
case 'select' :
so = (this.searchoptions && this.searchoptions.sopt) ? this.searchoptions.sopt[0] : 'eq';
v = $("#gs_"+$.jgrid.jqID(this.name),$t.grid.hDiv).val();
if(v) {
sdata[nm] = v;
sopt[nm] = so;
j++;
} else {
try {
delete $t.p.postData[nm];
} catch (e) {}
}
break;
case 'text':
so = (this.searchoptions && this.searchoptions.sopt) ? this.searchoptions.sopt[0] : p.defaultSearch;
v = $("#gs_"+$.jgrid.jqID(this.name), $t.grid.hDiv).val();
if(v) {
sdata[nm] = v;
sopt[nm] = so;
j++;
} else {
try {
delete $t.p.postData[nm];
} catch (z) {}
}
break;
}
});
var sd = j>0 ? true : false;
if(p.stringResult === true || $t.p.datatype == "local") {
var ruleGroup = "{\"groupOp\":\"" + p.groupOp + "\",\"rules\":[";
var gi=0;
$.each(sdata,function(i,n){
if (gi > 0) {ruleGroup += ",";}
ruleGroup += "{\"field\":\"" + i + "\",";
ruleGroup += "\"op\":\"" + sopt[i] + "\",";
n+="";
ruleGroup += "\"data\":\"" + n.replace(/\\/g,'\\\\').replace(/\"/g,'\\"') + "\"}";
gi++;
});
ruleGroup += "]}";
$.extend($t.p.postData,{filters:ruleGroup});
$.each(['searchField', 'searchString', 'searchOper'], function(i, n){
if($t.p.postData.hasOwnProperty(n)) { delete $t.p.postData[n];}
});
} else {
$.extend($t.p.postData,sdata);
}
var saveurl;
if($t.p.searchurl) {
saveurl = $t.p.url;
$($t).jqGrid("setGridParam",{url:$t.p.searchurl});
}
var bsr = false;
if($.isFunction(p.beforeSearch)){bsr = p.beforeSearch.call($t);}
if(!bsr) { $($t).jqGrid("setGridParam",{search:sd}).trigger("reloadGrid",[{page:1}]); }
if(saveurl) {$($t).jqGrid("setGridParam",{url:saveurl});}
if($.isFunction(p.afterSearch)){p.afterSearch();}
};
var clearToolbar = function(trigger){
var sdata={}, v, j=0, nm;
trigger = (typeof trigger != 'boolean') ? true : trigger;
$.each($t.p.colModel,function(i,n){
v = (this.searchoptions && this.searchoptions.defaultValue) ? this.searchoptions.defaultValue : "";
nm = this.index || this.name;
switch (this.stype) {
case 'select' :
var v1;
$("#gs_"+$.jgrid.jqID(nm)+" option",$t.grid.hDiv).each(function (i){
if(i===0) { this.selected = true; }
if ($(this).text() == v) {
this.selected = true;
v1 = $(this).val();
return false;
}
});
if (v1) {
// post the key and not the text
sdata[nm] = v1;
j++;
} else {
try {
delete $t.p.postData[nm];
} catch(e) {}
}
break;
case 'text':
$("#gs_"+$.jgrid.jqID(nm),$t.grid.hDiv).val(v);
if(v) {
sdata[nm] = v;
j++;
} else {
try {
delete $t.p.postData[nm];
} catch (y){}
}
break;
}
});
var sd = j>0 ? true : false;
if(p.stringResult === true || $t.p.datatype == "local") {
var ruleGroup = "{\"groupOp\":\"" + p.groupOp + "\",\"rules\":[";
var gi=0;
$.each(sdata,function(i,n){
if (gi > 0) {ruleGroup += ",";}
ruleGroup += "{\"field\":\"" + i + "\",";
ruleGroup += "\"op\":\"" + "eq" + "\",";
n+="";
ruleGroup += "\"data\":\"" + n.replace(/\\/g,'\\\\').replace(/\"/g,'\\"') + "\"}";
gi++;
});
ruleGroup += "]}";
$.extend($t.p.postData,{filters:ruleGroup});
$.each(['searchField', 'searchString', 'searchOper'], function(i, n){
if($t.p.postData.hasOwnProperty(n)) { delete $t.p.postData[n];}
});
} else {
$.extend($t.p.postData,sdata);
}
var saveurl;
if($t.p.searchurl) {
saveurl = $t.p.url;
$($t).jqGrid("setGridParam",{url:$t.p.searchurl});
}
var bcv = false;
if($.isFunction(p.beforeClear)){bcv = p.beforeClear.call($t);}
if(!bcv) {
if(trigger) {
$($t).jqGrid("setGridParam",{search:sd}).trigger("reloadGrid",[{page:1}]);
}
}
if(saveurl) {$($t).jqGrid("setGridParam",{url:saveurl});}
if($.isFunction(p.afterClear)){p.afterClear();}
};
var toggleToolbar = function(){
var trow = $("tr.ui-search-toolbar",$t.grid.hDiv);
if(trow.css("display")=='none') { trow.show(); }
else { trow.hide(); }
};
// create the row
function bindEvents(selector, events) {
var jElem = $(selector);
if (jElem[0]) {
jQuery.each(events, function() {
if (this.data !== undefined) {
jElem.bind(this.type, this.data, this.fn);
} else {
jElem.bind(this.type, this.fn);
}
});
}
}
var tr = $("<tr class='ui-search-toolbar' role='rowheader'></tr>");
var timeoutHnd;
$.each($t.p.colModel,function(i,n){
var cm=this, thd , th, soptions,surl,self;
th = $("<th role='columnheader' class='ui-state-default ui-th-column ui-th-"+$t.p.direction+"'></th>");
thd = $("<div style='width:100%;position:relative;height:100%;padding-right:0.3em;'></div>");
if(this.hidden===true) { $(th).css("display","none");}
this.search = this.search === false ? false : true;
if(typeof this.stype == 'undefined' ) {this.stype='text';}
soptions = $.extend({},this.searchoptions || {});
if(this.search){
switch (this.stype)
{
case "select":
surl = this.surl || soptions.dataUrl;
if(surl) {
// data returned should have already constructed html select
// primitive jQuery load
self = thd;
$.ajax($.extend({
url: surl,
dataType: "html",
complete: function(res,status) {
if(soptions.buildSelect !== undefined) {
var d = soptions.buildSelect(res);
if (d) { $(self).append(d); }
} else {
$(self).append(res.responseText);
}
if(soptions.defaultValue) { $("select",self).val(soptions.defaultValue); }
$("select",self).attr({name:cm.index || cm.name, id: "gs_"+cm.name});
if(soptions.attr) {$("select",self).attr(soptions.attr);}
$("select",self).css({width: "100%"});
// preserve autoserch
if(soptions.dataInit !== undefined) { soptions.dataInit($("select",self)[0]); }
if(soptions.dataEvents !== undefined) { bindEvents($("select",self)[0],soptions.dataEvents); }
if(p.autosearch===true){
$("select",self).change(function(e){
triggerToolbar();
return false;
});
}
res=null;
}
}, $.jgrid.ajaxOptions, $t.p.ajaxSelectOptions || {} ));
} else {
var oSv;
if(cm.searchoptions && cm.searchoptions.value) {
oSv = cm.searchoptions.value;
} else if(cm.editoptions && cm.editoptions.value) {
oSv = cm.editoptions.value;
}
if (oSv) {
var elem = document.createElement("select");
elem.style.width = "100%";
$(elem).attr({name:cm.index || cm.name, id: "gs_"+cm.name});
var so, sv, ov;
if(typeof oSv === "string") {
so = oSv.split(";");
for(var k=0; k<so.length;k++){
sv = so[k].split(":");
ov = document.createElement("option");
ov.value = sv[0]; ov.innerHTML = sv[1];
elem.appendChild(ov);
}
} else if(typeof oSv === "object" ) {
for ( var key in oSv) {
if(oSv.hasOwnProperty(key)) {
ov = document.createElement("option");
ov.value = key; ov.innerHTML = oSv[key];
elem.appendChild(ov);
}
}
}
if(soptions.defaultValue) { $(elem).val(soptions.defaultValue); }
if(soptions.attr) {$(elem).attr(soptions.attr);}
if(soptions.dataInit !== undefined) { soptions.dataInit(elem); }
if(soptions.dataEvents !== undefined) { bindEvents(elem, soptions.dataEvents); }
$(thd).append(elem);
if(p.autosearch===true){
$(elem).change(function(e){
triggerToolbar();
return false;
});
}
}
}
break;
case 'text':
var df = soptions.defaultValue ? soptions.defaultValue: "";
$(thd).append("<input type='text' style='width:95%;padding:0px;' name='"+(cm.index || cm.name)+"' id='gs_"+cm.name+"' value='"+df+"'/>");
if(soptions.attr) {$("input",thd).attr(soptions.attr);}
if(soptions.dataInit !== undefined) { soptions.dataInit($("input",thd)[0]); }
if(soptions.dataEvents !== undefined) { bindEvents($("input",thd)[0], soptions.dataEvents); }
if(p.autosearch===true){
if(p.searchOnEnter) {
$("input",thd).keypress(function(e){
var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
if(key == 13){
triggerToolbar();
return false;
}
return this;
});
} else {
$("input",thd).keydown(function(e){
var key = e.which;
switch (key) {
case 13:
return false;
case 9 :
case 16:
case 37:
case 38:
case 39:
case 40:
case 27:
break;
default :
if(timeoutHnd) { clearTimeout(timeoutHnd); }
timeoutHnd = setTimeout(function(){triggerToolbar();},500);
}
});
}
}
break;
}
}
$(th).append(thd);
$(tr).append(th);
});
$("table thead",$t.grid.hDiv).append(tr);
this.ftoolbar = true;
this.triggerToolbar = triggerToolbar;
this.clearToolbar = clearToolbar;
this.toggleToolbar = toggleToolbar;
});
}
});
})(jQuery); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/grid.custom.js | JavaScript | art | 14,274 |
;(function($){
/*
**
* jqGrid addons using jQuery UI
* Author: Mark Williams
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl-2.0.html
* depends on jQuery UI
**/
if ($.browser.msie && $.browser.version==8) {
$.expr[":"].hidden = function(elem) {
return elem.offsetWidth === 0 || elem.offsetHeight === 0 ||
elem.style.display == "none";
};
}
// requiere load multiselect before grid
$.jgrid._multiselect = false;
if($.ui) {
if ($.ui.multiselect ) {
if($.ui.multiselect.prototype._setSelected) {
var setSelected = $.ui.multiselect.prototype._setSelected;
$.ui.multiselect.prototype._setSelected = function(item,selected) {
var ret = setSelected.call(this,item,selected);
if (selected && this.selectedList) {
var elt = this.element;
this.selectedList.find('li').each(function() {
if ($(this).data('optionLink')) {
$(this).data('optionLink').remove().appendTo(elt);
}
});
}
return ret;
};
}
if($.ui.multiselect.prototype.destroy) {
$.ui.multiselect.prototype.destroy = function() {
this.element.show();
this.container.remove();
if ($.Widget === undefined) {
$.widget.prototype.destroy.apply(this, arguments);
} else {
$.Widget.prototype.destroy.apply(this, arguments);
}
};
}
$.jgrid._multiselect = true;
}
}
$.jgrid.extend({
sortableColumns : function (tblrow)
{
return this.each(function (){
var ts = this, tid= ts.p.id;
function start() {ts.p.disableClick = true;}
var sortable_opts = {
"tolerance" : "pointer",
"axis" : "x",
"scrollSensitivity": "1",
"items": '>th:not(:has(#jqgh_'+tid+'_cb'+',#jqgh_'+tid+'_rn'+',#jqgh_'+tid+'_subgrid),:hidden)',
"placeholder": {
element: function(item) {
var el = $(document.createElement(item[0].nodeName))
.addClass(item[0].className+" ui-sortable-placeholder ui-state-highlight")
.removeClass("ui-sortable-helper")[0];
return el;
},
update: function(self, p) {
p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10));
p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10));
}
},
"update": function(event, ui) {
var p = $(ui.item).parent(),
th = $(">th", p),
colModel = ts.p.colModel,
cmMap = {}, tid= ts.p.id+"_";
$.each(colModel, function(i) { cmMap[this.name]=i; });
var permutation = [];
th.each(function(i) {
var id = $(">div", this).get(0).id.replace(/^jqgh_/, "").replace(tid,"");
if (id in cmMap) {
permutation.push(cmMap[id]);
}
});
$(ts).jqGrid("remapColumns",permutation, true, true);
if ($.isFunction(ts.p.sortable.update)) {
ts.p.sortable.update(permutation);
}
setTimeout(function(){ts.p.disableClick=false;}, 50);
}
};
if (ts.p.sortable.options) {
$.extend(sortable_opts, ts.p.sortable.options);
} else if ($.isFunction(ts.p.sortable)) {
ts.p.sortable = { "update" : ts.p.sortable };
}
if (sortable_opts.start) {
var s = sortable_opts.start;
sortable_opts.start = function(e,ui) {
start();
s.call(this,e,ui);
};
} else {
sortable_opts.start = start;
}
if (ts.p.sortable.exclude) {
sortable_opts.items += ":not("+ts.p.sortable.exclude+")";
}
tblrow.sortable(sortable_opts).data("sortable").floating = true;
});
},
columnChooser : function(opts) {
var self = this;
if($("#colchooser_"+self[0].p.id).length ) { return; }
var selector = $('<div id="colchooser_'+self[0].p.id+'" style="position:relative;overflow:hidden"><div><select multiple="multiple"></select></div></div>');
var select = $('select', selector);
function insert(perm,i,v) {
if(i>=0){
var a = perm.slice();
var b = a.splice(i,Math.max(perm.length-i,i));
if(i>perm.length) { i = perm.length; }
a[i] = v;
return a.concat(b);
}
}
opts = $.extend({
"width" : 420,
"height" : 240,
"classname" : null,
"done" : function(perm) { if (perm) { self.jqGrid("remapColumns", perm, true); } },
/* msel is either the name of a ui widget class that
extends a multiselect, or a function that supports
creating a multiselect object (with no argument,
or when passed an object), and destroying it (when
passed the string "destroy"). */
"msel" : "multiselect",
/* "msel_opts" : {}, */
/* dlog is either the name of a ui widget class that
behaves in a dialog-like way, or a function, that
supports creating a dialog (when passed dlog_opts)
or destroying a dialog (when passed the string
"destroy")
*/
"dlog" : "dialog",
/* dlog_opts is either an option object to be passed
to "dlog", or (more likely) a function that creates
the options object.
The default produces a suitable options object for
ui.dialog */
"dlog_opts" : function(opts) {
var buttons = {};
buttons[opts.bSubmit] = function() {
opts.apply_perm();
opts.cleanup(false);
};
buttons[opts.bCancel] = function() {
opts.cleanup(true);
};
return {
"buttons": buttons,
"close": function() {
opts.cleanup(true);
},
"modal" : opts.modal ? opts.modal : false,
"resizable": opts.resizable ? opts.resizable : true,
"width": opts.width+20
};
},
/* Function to get the permutation array, and pass it to the
"done" function */
"apply_perm" : function() {
$('option',select).each(function(i) {
if (this.selected) {
self.jqGrid("showCol", colModel[this.value].name);
} else {
self.jqGrid("hideCol", colModel[this.value].name);
}
});
var perm = [];
//fixedCols.slice(0);
$('option[selected]',select).each(function() { perm.push(parseInt(this.value,10)); });
$.each(perm, function() { delete colMap[colModel[parseInt(this,10)].name]; });
$.each(colMap, function() {
var ti = parseInt(this,10);
perm = insert(perm,ti,ti);
});
if (opts.done) {
opts.done.call(self, perm);
}
},
/* Function to cleanup the dialog, and select. Also calls the
done function with no permutation (to indicate that the
columnChooser was aborted */
"cleanup" : function(calldone) {
call(opts.dlog, selector, 'destroy');
call(opts.msel, select, 'destroy');
selector.remove();
if (calldone && opts.done) {
opts.done.call(self);
}
},
"msel_opts" : {}
}, $.jgrid.col, opts || {});
if($.ui) {
if ($.ui.multiselect ) {
if(opts.msel == "multiselect") {
if(!$.jgrid._multiselect) {
// should be in language file
alert("Multiselect plugin loaded after jqGrid. Please load the plugin before the jqGrid!");
return;
}
opts.msel_opts = $.extend($.ui.multiselect.defaults,opts.msel_opts);
}
}
}
if (opts.caption) {
selector.attr("title", opts.caption);
}
if (opts.classname) {
selector.addClass(opts.classname);
select.addClass(opts.classname);
}
if (opts.width) {
$(">div",selector).css({"width": opts.width,"margin":"0 auto"});
select.css("width", opts.width);
}
if (opts.height) {
$(">div",selector).css("height", opts.height);
select.css("height", opts.height - 10);
}
var colModel = self.jqGrid("getGridParam", "colModel");
var colNames = self.jqGrid("getGridParam", "colNames");
var colMap = {}, fixedCols = [];
select.empty();
$.each(colModel, function(i) {
colMap[this.name] = i;
if (this.hidedlg) {
if (!this.hidden) {
fixedCols.push(i);
}
return;
}
select.append("<option value='"+i+"' "+
(this.hidden?"":"selected='selected'")+">"+colNames[i]+"</option>");
});
function call(fn, obj) {
if (!fn) { return; }
if (typeof fn == 'string') {
if ($.fn[fn]) {
$.fn[fn].apply(obj, $.makeArray(arguments).slice(2));
}
} else if ($.isFunction(fn)) {
fn.apply(obj, $.makeArray(arguments).slice(2));
}
}
var dopts = $.isFunction(opts.dlog_opts) ? opts.dlog_opts.call(self, opts) : opts.dlog_opts;
call(opts.dlog, selector, dopts);
var mopts = $.isFunction(opts.msel_opts) ? opts.msel_opts.call(self, opts) : opts.msel_opts;
call(opts.msel, select, mopts);
},
sortableRows : function (opts) {
// Can accept all sortable options and events
return this.each(function(){
var $t = this;
if(!$t.grid) { return; }
// Currently we disable a treeGrid sortable
if($t.p.treeGrid) { return; }
if($.fn.sortable) {
opts = $.extend({
"cursor":"move",
"axis" : "y",
"items": ".jqgrow"
},
opts || {});
if(opts.start && $.isFunction(opts.start)) {
opts._start_ = opts.start;
delete opts.start;
} else {opts._start_=false;}
if(opts.update && $.isFunction(opts.update)) {
opts._update_ = opts.update;
delete opts.update;
} else {opts._update_ = false;}
opts.start = function(ev,ui) {
$(ui.item).css("border-width","0px");
$("td",ui.item).each(function(i){
this.style.width = $t.grid.cols[i].style.width;
});
if($t.p.subGrid) {
var subgid = $(ui.item).attr("id");
try {
$($t).jqGrid('collapseSubGridRow',subgid);
} catch (e) {}
}
if(opts._start_) {
opts._start_.apply(this,[ev,ui]);
}
};
opts.update = function (ev,ui) {
$(ui.item).css("border-width","");
if($t.p.rownumbers === true) {
$("td.jqgrid-rownum",$t.rows).each(function(i){
$(this).html(i+1);
});
}
if(opts._update_) {
opts._update_.apply(this,[ev,ui]);
}
};
$("tbody:first",$t).sortable(opts);
$("tbody:first",$t).disableSelection();
}
});
},
gridDnD : function(opts) {
return this.each(function(){
var $t = this;
if(!$t.grid) { return; }
// Currently we disable a treeGrid drag and drop
if($t.p.treeGrid) { return; }
if(!$.fn.draggable || !$.fn.droppable) { return; }
function updateDnD ()
{
var datadnd = $.data($t,"dnd");
$("tr.jqgrow:not(.ui-draggable)",$t).draggable($.isFunction(datadnd.drag) ? datadnd.drag.call($($t),datadnd) : datadnd.drag);
}
var appender = "<table id='jqgrid_dnd' class='ui-jqgrid-dnd'></table>";
if($("#jqgrid_dnd").html() === null) {
$('body').append(appender);
}
if(typeof opts == 'string' && opts == 'updateDnD' && $t.p.jqgdnd===true) {
updateDnD();
return;
}
opts = $.extend({
"drag" : function (opts) {
return $.extend({
start : function (ev, ui) {
// if we are in subgrid mode try to collapse the node
if($t.p.subGrid) {
var subgid = $(ui.helper).attr("id");
try {
$($t).jqGrid('collapseSubGridRow',subgid);
} catch (e) {}
}
// hack
// drag and drop does not insert tr in table, when the table has no rows
// we try to insert new empty row on the target(s)
for (var i=0;i<$.data($t,"dnd").connectWith.length;i++){
if($($.data($t,"dnd").connectWith[i]).jqGrid('getGridParam','reccount') == "0" ){
$($.data($t,"dnd").connectWith[i]).jqGrid('addRowData','jqg_empty_row',{});
}
}
ui.helper.addClass("ui-state-highlight");
$("td",ui.helper).each(function(i) {
this.style.width = $t.grid.headers[i].width+"px";
});
if(opts.onstart && $.isFunction(opts.onstart) ) { opts.onstart.call($($t),ev,ui); }
},
stop :function(ev,ui) {
if(ui.helper.dropped) {
var ids = $(ui.helper).attr("id");
$($t).jqGrid('delRowData',ids );
}
// if we have a empty row inserted from start event try to delete it
for (var i=0;i<$.data($t,"dnd").connectWith.length;i++){
$($.data($t,"dnd").connectWith[i]).jqGrid('delRowData','jqg_empty_row');
}
if(opts.onstop && $.isFunction(opts.onstop) ) { opts.onstop.call($($t),ev,ui); }
}
},opts.drag_opts || {});
},
"drop" : function (opts) {
return $.extend({
accept: function(d) {
if (!$(d).hasClass('jqgrow')) { return d;}
var tid = $(d).closest("table.ui-jqgrid-btable");
if(tid.length > 0 && $.data(tid[0],"dnd") !== undefined) {
var cn = $.data(tid[0],"dnd").connectWith;
return $.inArray('#'+this.id,cn) != -1 ? true : false;
}
return d;
},
drop: function(ev, ui) {
if (!$(ui.draggable).hasClass('jqgrow')) { return; }
var accept = $(ui.draggable).attr("id");
var getdata = ui.draggable.parent().parent().jqGrid('getRowData',accept);
if(!opts.dropbyname) {
var j =0, tmpdata = {}, dropname;
var dropmodel = $("#"+this.id).jqGrid('getGridParam','colModel');
try {
for (var key in getdata) {
if(getdata.hasOwnProperty(key) && dropmodel[j]) {
dropname = dropmodel[j].name;
tmpdata[dropname] = getdata[key];
}
j++;
}
getdata = tmpdata;
} catch (e) {}
}
ui.helper.dropped = true;
if(opts.beforedrop && $.isFunction(opts.beforedrop) ) {
//parameters to this callback - event, element, data to be inserted, sender, reciever
// should return object which will be inserted into the reciever
var datatoinsert = opts.beforedrop.call(this,ev,ui,getdata,$('#'+$t.id),$(this));
if (typeof datatoinsert != "undefined" && datatoinsert !== null && typeof datatoinsert == "object") { getdata = datatoinsert; }
}
if(ui.helper.dropped) {
var grid;
if(opts.autoid) {
if($.isFunction(opts.autoid)) {
grid = opts.autoid.call(this,getdata);
} else {
grid = Math.ceil(Math.random()*1000);
grid = opts.autoidprefix+grid;
}
}
// NULL is interpreted as undefined while null as object
$("#"+this.id).jqGrid('addRowData',grid,getdata,opts.droppos);
}
if(opts.ondrop && $.isFunction(opts.ondrop) ) { opts.ondrop.call(this,ev,ui, getdata); }
}}, opts.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": 5000
},
"dropbyname" : false,
"droppos" : "first",
"autoid" : true,
"autoidprefix" : "dnd_"
}, opts || {});
if(!opts.connectWith) { return; }
opts.connectWith = opts.connectWith.split(",");
opts.connectWith = $.map(opts.connectWith,function(n){return $.trim(n);});
$.data($t,"dnd",opts);
if($t.p.reccount != "0" && !$t.p.jqgdnd) {
updateDnD();
}
$t.p.jqgdnd = true;
for (var i=0;i<opts.connectWith.length;i++){
var cn =opts.connectWith[i];
$(cn).droppable($.isFunction(opts.drop) ? opts.drop.call($($t),opts) : opts.drop);
}
});
},
gridResize : function(opts) {
return this.each(function(){
var $t = this;
if(!$t.grid || !$.fn.resizable) { return; }
opts = $.extend({}, opts || {});
if(opts.alsoResize ) {
opts._alsoResize_ = opts.alsoResize;
delete opts.alsoResize;
} else {
opts._alsoResize_ = false;
}
if(opts.stop && $.isFunction(opts.stop)) {
opts._stop_ = opts.stop;
delete opts.stop;
} else {
opts._stop_ = false;
}
opts.stop = function (ev, ui) {
$($t).jqGrid('setGridParam',{height:$("#gview_"+$t.p.id+" .ui-jqgrid-bdiv").height()});
$($t).jqGrid('setGridWidth',ui.size.width,opts.shrinkToFit);
if(opts._stop_) { opts._stop_.call($t,ev,ui); }
};
if(opts._alsoResize_) {
var optstest = "{\'#gview_"+$t.p.id+" .ui-jqgrid-bdiv\':true,'" +opts._alsoResize_+"':true}";
opts.alsoResize = eval('('+optstest+')'); // the only way that I found to do this
} else {
opts.alsoResize = $(".ui-jqgrid-bdiv","#gview_"+$t.p.id);
}
delete opts._alsoResize_;
$("#gbox_"+$t.p.id).resizable(opts);
});
}
});
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/grid.jqueryui.js | JavaScript | art | 17,493 |
/*
* jQuery UI Multiselect
*
* Authors:
* Michael Aufreiter (quasipartikel.at)
* Yanick Rochon (yanick.rochon[at]gmail[dot]com)
*
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://www.quasipartikel.at/multiselect/
*
*
* Depends:
* ui.core.js
* ui.sortable.js
*
* Optional:
* localization (http://plugins.jquery.com/project/localisation)
* scrollTo (http://plugins.jquery.com/project/ScrollTo)
*
* Todo:
* Make batch actions faster
* Implement dynamic insertion through remote calls
*/
(function($) {
$.widget("ui.multiselect", {
_init: function() {
this.element.hide();
this.id = this.element.attr("id");
this.container = $('<div class="ui-multiselect ui-helper-clearfix ui-widget"></div>').insertAfter(this.element);
this.count = 0; // number of currently selected options
this.selectedContainer = $('<div class="selected"></div>').appendTo(this.container);
this.availableContainer = $('<div class="available"></div>').appendTo(this.container);
this.selectedActions = $('<div class="actions ui-widget-header ui-helper-clearfix"><span class="count">0 '+$.ui.multiselect.locale.itemsCount+'</span><a href="#" class="remove-all">'+$.ui.multiselect.locale.removeAll+'</a></div>').appendTo(this.selectedContainer);
this.availableActions = $('<div class="actions ui-widget-header ui-helper-clearfix"><input type="text" class="search empty ui-widget-content ui-corner-all"/><a href="#" class="add-all">'+$.ui.multiselect.locale.addAll+'</a></div>').appendTo(this.availableContainer);
this.selectedList = $('<ul class="selected connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart', function(){return false;}).appendTo(this.selectedContainer);
this.availableList = $('<ul class="available connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart', function(){return false;}).appendTo(this.availableContainer);
var that = this;
// set dimensions
this.container.width(this.element.width()+1);
this.selectedContainer.width(Math.floor(this.element.width()*this.options.dividerLocation));
this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation)));
// fix list height to match <option> depending on their individual header's heights
this.selectedList.height(Math.max(this.element.height()-this.selectedActions.height(),1));
this.availableList.height(Math.max(this.element.height()-this.availableActions.height(),1));
if ( !this.options.animated ) {
this.options.show = 'show';
this.options.hide = 'hide';
}
// init lists
this._populateLists(this.element.find('option'));
// make selection sortable
if (this.options.sortable) {
$("ul.selected").sortable({
placeholder: 'ui-state-highlight',
axis: 'y',
update: function(event, ui) {
// apply the new sort order to the original selectbox
that.selectedList.find('li').each(function() {
if ($(this).data('optionLink'))
$(this).data('optionLink').remove().appendTo(that.element);
});
},
receive: function(event, ui) {
ui.item.data('optionLink').attr('selected', true);
// increment count
that.count += 1;
that._updateCount();
// workaround, because there's no way to reference
// the new element, see http://dev.jqueryui.com/ticket/4303
that.selectedList.children('.ui-draggable').each(function() {
$(this).removeClass('ui-draggable');
$(this).data('optionLink', ui.item.data('optionLink'));
$(this).data('idx', ui.item.data('idx'));
that._applyItemState($(this), true);
});
// workaround according to http://dev.jqueryui.com/ticket/4088
setTimeout(function() { ui.item.remove(); }, 1);
}
});
}
// set up livesearch
if (this.options.searchable) {
this._registerSearchEvents(this.availableContainer.find('input.search'));
} else {
$('.search').hide();
}
// batch actions
$(".remove-all").click(function() {
that._populateLists(that.element.find('option').removeAttr('selected'));
return false;
});
$(".add-all").click(function() {
that._populateLists(that.element.find('option').attr('selected', 'selected'));
return false;
});
},
destroy: function() {
this.element.show();
this.container.remove();
$.widget.prototype.destroy.apply(this, arguments);
},
_populateLists: function(options) {
this.selectedList.children('.ui-element').remove();
this.availableList.children('.ui-element').remove();
this.count = 0;
var that = this;
var items = $(options.map(function(i) {
var item = that._getOptionNode(this).appendTo(this.selected ? that.selectedList : that.availableList).show();
if (this.selected) that.count += 1;
that._applyItemState(item, this.selected);
item.data('idx', i);
return item[0];
}));
// update count
this._updateCount();
},
_updateCount: function() {
this.selectedContainer.find('span.count').text(this.count+" "+$.ui.multiselect.locale.itemsCount);
},
_getOptionNode: function(option) {
option = $(option);
var node = $('<li class="ui-state-default ui-element" title="'+option.text()+'"><span class="ui-icon"/>'+option.text()+'<a href="#" class="action"><span class="ui-corner-all ui-icon"/></a></li>').hide();
node.data('optionLink', option);
return node;
},
// clones an item with associated data
// didn't find a smarter away around this
_cloneWithData: function(clonee) {
var clone = clonee.clone();
clone.data('optionLink', clonee.data('optionLink'));
clone.data('idx', clonee.data('idx'));
return clone;
},
_setSelected: function(item, selected) {
item.data('optionLink').attr('selected', selected);
if (selected) {
var selectedItem = this._cloneWithData(item);
item[this.options.hide](this.options.animated, function() { $(this).remove(); });
selectedItem.appendTo(this.selectedList).hide()[this.options.show](this.options.animated);
this._applyItemState(selectedItem, true);
return selectedItem;
} else {
// look for successor based on initial option index
var items = this.availableList.find('li'), comparator = this.options.nodeComparator;
var succ = null, i = item.data('idx'), direction = comparator(item, $(items[i]));
// TODO: test needed for dynamic list populating
if ( direction ) {
while (i>=0 && i<items.length) {
direction > 0 ? i++ : i--;
if ( direction != comparator(item, $(items[i])) ) {
// going up, go back one item down, otherwise leave as is
succ = items[direction > 0 ? i : i+1];
break;
}
}
} else {
succ = items[i];
}
var availableItem = this._cloneWithData(item);
succ ? availableItem.insertBefore($(succ)) : availableItem.appendTo(this.availableList);
item[this.options.hide](this.options.animated, function() { $(this).remove(); });
availableItem.hide()[this.options.show](this.options.animated);
this._applyItemState(availableItem, false);
return availableItem;
}
},
_applyItemState: function(item, selected) {
if (selected) {
if (this.options.sortable)
item.children('span').addClass('ui-icon-arrowthick-2-n-s').removeClass('ui-helper-hidden').addClass('ui-icon');
else
item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon');
item.find('a.action span').addClass('ui-icon-minus').removeClass('ui-icon-plus');
this._registerRemoveEvents(item.find('a.action'));
} else {
item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon');
item.find('a.action span').addClass('ui-icon-plus').removeClass('ui-icon-minus');
this._registerAddEvents(item.find('a.action'));
}
this._registerHoverEvents(item);
},
// taken from John Resig's liveUpdate script
_filter: function(list) {
var input = $(this);
var rows = list.children('li'),
cache = rows.map(function(){
return $(this).text().toLowerCase();
});
var term = $.trim(input.val().toLowerCase()), scores = [];
if (!term) {
rows.show();
} else {
rows.hide();
cache.each(function(i) {
if (this.indexOf(term)>-1) { scores.push(i); }
});
$.each(scores, function() {
$(rows[this]).show();
});
}
},
_registerHoverEvents: function(elements) {
elements.removeClass('ui-state-hover');
elements.mouseover(function() {
$(this).addClass('ui-state-hover');
});
elements.mouseout(function() {
$(this).removeClass('ui-state-hover');
});
},
_registerAddEvents: function(elements) {
var that = this;
elements.click(function() {
var item = that._setSelected($(this).parent(), true);
that.count += 1;
that._updateCount();
return false;
})
// make draggable
.each(function() {
$(this).parent().draggable({
connectToSortable: 'ul.selected',
helper: function() {
var selectedItem = that._cloneWithData($(this)).width($(this).width() - 50);
selectedItem.width($(this).width());
return selectedItem;
},
appendTo: '.ui-multiselect',
containment: '.ui-multiselect',
revert: 'invalid'
});
});
},
_registerRemoveEvents: function(elements) {
var that = this;
elements.click(function() {
that._setSelected($(this).parent(), false);
that.count -= 1;
that._updateCount();
return false;
});
},
_registerSearchEvents: function(input) {
var that = this;
input.focus(function() {
$(this).addClass('ui-state-active');
})
.blur(function() {
$(this).removeClass('ui-state-active');
})
.keypress(function(e) {
if (e.keyCode == 13)
return false;
})
.keyup(function() {
that._filter.apply(this, [that.availableList]);
});
}
});
$.extend($.ui.multiselect, {
defaults: {
sortable: true,
searchable: true,
animated: 'fast',
show: 'slideDown',
hide: 'slideUp',
dividerLocation: 0.6,
nodeComparator: function(node1,node2) {
var text1 = node1.text(),
text2 = node2.text();
return text1 == text2 ? 0 : (text1 < text2 ? -1 : 1);
}
},
locale: {
addAll:'Add all',
removeAll:'Remove all',
itemsCount:'items selected'
}
});
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/ui.multiselect.js | JavaScript | art | 10,263 |
/*
**
* formatter for values but most of the values if for jqGrid
* Some of this was inspired and based on how YUI does the table datagrid but in jQuery fashion
* we are trying to keep it as light as possible
* Joshua Burnett josh@9ci.com
* http://www.greenbill.com
*
* Changes from 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-2.0.html
*
**/
;(function($) {
$.fmatter = {};
//opts can be id:row id for the row, rowdata:the data for the row, colmodel:the column model for this column
//example {id:1234,}
$.extend($.fmatter,{
isBoolean : function(o) {
return typeof o === 'boolean';
},
isObject : function(o) {
return (o && (typeof o === 'object' || $.isFunction(o))) || false;
},
isString : function(o) {
return typeof o === 'string';
},
isNumber : function(o) {
return typeof o === 'number' && isFinite(o);
},
isNull : function(o) {
return o === null;
},
isUndefined : function(o) {
return typeof o === 'undefined';
},
isValue : function (o) {
return (this.isObject(o) || this.isString(o) || this.isNumber(o) || this.isBoolean(o));
},
isEmpty : function(o) {
if(!this.isString(o) && this.isValue(o)) {
return false;
}else if (!this.isValue(o)){
return true;
}
o = $.trim(o).replace(/\ \;/ig,'').replace(/\ \;/ig,'');
return o==="";
}
});
$.fn.fmatter = function(formatType, cellval, opts, rwd, act) {
// build main options before element iteration
var v=cellval;
opts = $.extend({}, $.jgrid.formatter, opts);
if ($.fn.fmatter[formatType]){
v = $.fn.fmatter[formatType](cellval, opts, rwd, act);
}
return v;
};
$.fmatter.util = {
// Taken from YAHOO utils
NumberFormat : function(nData,opts) {
if(!$.fmatter.isNumber(nData)) {
nData *= 1;
}
if($.fmatter.isNumber(nData)) {
var bNegative = (nData < 0);
var sOutput = nData + "";
var sDecimalSeparator = (opts.decimalSeparator) ? opts.decimalSeparator : ".";
var nDotIndex;
if($.fmatter.isNumber(opts.decimalPlaces)) {
// Round to the correct decimal place
var nDecimalPlaces = opts.decimalPlaces;
var nDecimal = Math.pow(10, nDecimalPlaces);
sOutput = Math.round(nData*nDecimal)/nDecimal + "";
nDotIndex = sOutput.lastIndexOf(".");
if(nDecimalPlaces > 0) {
// Add the decimal separator
if(nDotIndex < 0) {
sOutput += sDecimalSeparator;
nDotIndex = sOutput.length-1;
}
// Replace the "."
else if(sDecimalSeparator !== "."){
sOutput = sOutput.replace(".",sDecimalSeparator);
}
// Add missing zeros
while((sOutput.length - 1 - nDotIndex) < nDecimalPlaces) {
sOutput += "0";
}
}
}
if(opts.thousandsSeparator) {
var sThousandsSeparator = opts.thousandsSeparator;
nDotIndex = sOutput.lastIndexOf(sDecimalSeparator);
nDotIndex = (nDotIndex > -1) ? nDotIndex : sOutput.length;
var sNewOutput = sOutput.substring(nDotIndex);
var nCount = -1;
for (var i=nDotIndex; i>0; i--) {
nCount++;
if ((nCount%3 === 0) && (i !== nDotIndex) && (!bNegative || (i > 1))) {
sNewOutput = sThousandsSeparator + sNewOutput;
}
sNewOutput = sOutput.charAt(i-1) + sNewOutput;
}
sOutput = sNewOutput;
}
// Prepend prefix
sOutput = (opts.prefix) ? opts.prefix + sOutput : sOutput;
// Append suffix
sOutput = (opts.suffix) ? sOutput + opts.suffix : sOutput;
return sOutput;
} else {
return nData;
}
},
// Tony Tomov
// PHP implementation. Sorry not all options are supported.
// Feel free to add them if you want
DateFormat : function (format, date, newformat, opts) {
var token = /\\.|[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g,
timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
timezoneClip = /[^-+\dA-Z]/g,
msDateRegExp = new RegExp("^\/Date\\((([-+])?[0-9]+)(([-+])([0-9]{2})([0-9]{2}))?\\)\/$"),
msMatch = ((typeof date === 'string') ? date.match(msDateRegExp): null),
pad = function (value, length) {
value = String(value);
length = parseInt(length,10) || 2;
while (value.length < length) { value = '0' + value; }
return value;
},
ts = {m : 1, d : 1, y : 1970, h : 0, i : 0, s : 0, u:0},
timestamp=0, dM, k,hl,
dateFormat=["i18n"];
// Internationalization strings
dateFormat.i18n = {
dayNames: opts.dayNames,
monthNames: opts.monthNames
};
if( format in opts.masks ) { format = opts.masks[format]; }
if(date.constructor === Number) {
//Unix timestamp
if(String(format).toLowerCase() == "u") {
date = date*1000;
}
timestamp = new Date(date);
} else if(date.constructor === Date) {
timestamp = date;
// Microsoft date format support
} else if( msMatch !== null ) {
timestamp = new Date(parseInt(msMatch[1], 10));
if (msMatch[3]) {
var offset = Number(msMatch[5]) * 60 + Number(msMatch[6]);
offset *= ((msMatch[4] == '-') ? 1 : -1);
offset -= timestamp.getTimezoneOffset();
timestamp.setTime(Number(Number(timestamp) + (offset * 60 * 1000)));
}
} else {
date = String(date).split(/[\\\/:_;.,\t\T\s-]/);
format = format.split(/[\\\/:_;.,\t\T\s-]/);
// parsing for month names
for(k=0,hl=format.length;k<hl;k++){
if(format[k] == 'M') {
dM = $.inArray(date[k],dateFormat.i18n.monthNames);
if(dM !== -1 && dM < 12){date[k] = dM+1;}
}
if(format[k] == 'F') {
dM = $.inArray(date[k],dateFormat.i18n.monthNames);
if(dM !== -1 && dM > 11){date[k] = dM+1-12;}
}
if(date[k]) {
ts[format[k].toLowerCase()] = parseInt(date[k],10);
}
}
if(ts.f) {ts.m = ts.f;}
if( ts.m === 0 && ts.y === 0 && ts.d === 0) {
return " " ;
}
ts.m = parseInt(ts.m,10)-1;
var ty = ts.y;
if (ty >= 70 && ty <= 99) {ts.y = 1900+ts.y;}
else if (ty >=0 && ty <=69) {ts.y= 2000+ts.y;}
timestamp = new Date(ts.y, ts.m, ts.d, ts.h, ts.i, ts.s, ts.u);
}
if( newformat in opts.masks ) {
newformat = opts.masks[newformat];
} else if ( !newformat ) {
newformat = 'Y-m-d';
}
var
G = timestamp.getHours(),
i = timestamp.getMinutes(),
j = timestamp.getDate(),
n = timestamp.getMonth() + 1,
o = timestamp.getTimezoneOffset(),
s = timestamp.getSeconds(),
u = timestamp.getMilliseconds(),
w = timestamp.getDay(),
Y = timestamp.getFullYear(),
N = (w + 6) % 7 + 1,
z = (new Date(Y, n - 1, j) - new Date(Y, 0, 1)) / 86400000,
flags = {
// Day
d: pad(j),
D: dateFormat.i18n.dayNames[w],
j: j,
l: dateFormat.i18n.dayNames[w + 7],
N: N,
S: opts.S(j),
//j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th',
w: w,
z: z,
// Week
W: N < 5 ? Math.floor((z + N - 1) / 7) + 1 : Math.floor((z + N - 1) / 7) || ((new Date(Y - 1, 0, 1).getDay() + 6) % 7 < 4 ? 53 : 52),
// Month
F: dateFormat.i18n.monthNames[n - 1 + 12],
m: pad(n),
M: dateFormat.i18n.monthNames[n - 1],
n: n,
t: '?',
// Year
L: '?',
o: '?',
Y: Y,
y: String(Y).substring(2),
// Time
a: G < 12 ? opts.AmPm[0] : opts.AmPm[1],
A: G < 12 ? opts.AmPm[2] : opts.AmPm[3],
B: '?',
g: G % 12 || 12,
G: G,
h: pad(G % 12 || 12),
H: pad(G),
i: pad(i),
s: pad(s),
u: u,
// Timezone
e: '?',
I: '?',
O: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
P: '?',
T: (String(timestamp).match(timezone) || [""]).pop().replace(timezoneClip, ""),
Z: '?',
// Full Date/Time
c: '?',
r: '?',
U: Math.floor(timestamp / 1000)
};
return newformat.replace(token, function ($0) {
return $0 in flags ? flags[$0] : $0.substring(1);
});
}
};
$.fn.fmatter.defaultFormat = function(cellval, opts) {
return ($.fmatter.isValue(cellval) && cellval!=="" ) ? cellval : opts.defaultValue ? opts.defaultValue : " ";
};
$.fn.fmatter.email = function(cellval, opts) {
if(!$.fmatter.isEmpty(cellval)) {
return "<a href=\"mailto:" + cellval + "\">" + cellval + "</a>";
}else {
return $.fn.fmatter.defaultFormat(cellval,opts );
}
};
$.fn.fmatter.checkbox =function(cval, opts) {
var op = $.extend({},opts.checkbox), ds;
if(!$.fmatter.isUndefined(opts.colModel.formatoptions)) {
op = $.extend({},op,opts.colModel.formatoptions);
}
if(op.disabled===true) {ds = "disabled=\"disabled\"";} else {ds="";}
if($.fmatter.isEmpty(cval) || $.fmatter.isUndefined(cval) ) {cval = $.fn.fmatter.defaultFormat(cval,op);}
cval=cval+"";cval=cval.toLowerCase();
var bchk = cval.search(/(false|0|no|off)/i)<0 ? " checked='checked' " : "";
return "<input type=\"checkbox\" " + bchk + " value=\""+ cval+"\" offval=\"no\" "+ds+ "/>";
};
$.fn.fmatter.link = function(cellval, opts) {
var op = {target:opts.target};
var target = "";
if(!$.fmatter.isUndefined(opts.colModel.formatoptions)) {
op = $.extend({},op,opts.colModel.formatoptions);
}
if(op.target) {target = 'target=' + op.target;}
if(!$.fmatter.isEmpty(cellval)) {
return "<a "+target+" href=\"" + cellval + "\">" + cellval + "</a>";
}else {
return $.fn.fmatter.defaultFormat(cellval,opts);
}
};
$.fn.fmatter.showlink = function(cellval, opts) {
var op = {baseLinkUrl: opts.baseLinkUrl,showAction:opts.showAction, addParam: opts.addParam || "", target: opts.target, idName: opts.idName},
target = "", idUrl;
if(!$.fmatter.isUndefined(opts.colModel.formatoptions)) {
op = $.extend({},op,opts.colModel.formatoptions);
}
if(op.target) {target = 'target=' + op.target;}
idUrl = op.baseLinkUrl+op.showAction + '?'+ op.idName+'='+opts.rowId+op.addParam;
if($.fmatter.isString(cellval) || $.fmatter.isNumber(cellval)) { //add this one even if its blank string
return "<a "+target+" href=\"" + idUrl + "\">" + cellval + "</a>";
}else {
return $.fn.fmatter.defaultFormat(cellval,opts);
}
};
$.fn.fmatter.integer = function(cellval, opts) {
var op = $.extend({},opts.integer);
if(!$.fmatter.isUndefined(opts.colModel.formatoptions)) {
op = $.extend({},op,opts.colModel.formatoptions);
}
if($.fmatter.isEmpty(cellval)) {
return op.defaultValue;
}
return $.fmatter.util.NumberFormat(cellval,op);
};
$.fn.fmatter.number = function (cellval, opts) {
var op = $.extend({},opts.number);
if(!$.fmatter.isUndefined(opts.colModel.formatoptions)) {
op = $.extend({},op,opts.colModel.formatoptions);
}
if($.fmatter.isEmpty(cellval)) {
return op.defaultValue;
}
return $.fmatter.util.NumberFormat(cellval,op);
};
$.fn.fmatter.currency = function (cellval, opts) {
var op = $.extend({},opts.currency);
if(!$.fmatter.isUndefined(opts.colModel.formatoptions)) {
op = $.extend({},op,opts.colModel.formatoptions);
}
if($.fmatter.isEmpty(cellval)) {
return op.defaultValue;
}
return $.fmatter.util.NumberFormat(cellval,op);
};
$.fn.fmatter.date = function (cellval, opts, rwd, act) {
var op = $.extend({},opts.date);
if(!$.fmatter.isUndefined(opts.colModel.formatoptions)) {
op = $.extend({},op,opts.colModel.formatoptions);
}
if(!op.reformatAfterEdit && act=='edit'){
return $.fn.fmatter.defaultFormat(cellval, opts);
} else if(!$.fmatter.isEmpty(cellval)) {
return $.fmatter.util.DateFormat(op.srcformat,cellval,op.newformat,op);
} else {
return $.fn.fmatter.defaultFormat(cellval, opts);
}
};
$.fn.fmatter.select = function (cellval,opts, rwd, act) {
// jqGrid specific
cellval = cellval + "";
var oSelect = false, ret=[];
if(!$.fmatter.isUndefined(opts.colModel.formatoptions)){
oSelect= opts.colModel.formatoptions.value;
} else if(!$.fmatter.isUndefined(opts.colModel.editoptions)){
oSelect= opts.colModel.editoptions.value;
}
if (oSelect) {
var msl = opts.colModel.editoptions.multiple === true ? true : false,
scell = [], sv;
if(msl) {scell = cellval.split(",");scell = $.map(scell,function(n){return $.trim(n);});}
if ($.fmatter.isString(oSelect)) {
// mybe here we can use some caching with care ????
var so = oSelect.split(";"), j=0;
for(var i=0; i<so.length;i++){
sv = so[i].split(":");
if(sv.length > 2 ) {
sv[1] = jQuery.map(sv,function(n,i){if(i>0) {return n;}}).join(":");
}
if(msl) {
if(jQuery.inArray(sv[0],scell)>-1) {
ret[j] = sv[1];
j++;
}
} else if($.trim(sv[0])==$.trim(cellval)) {
ret[0] = sv[1];
break;
}
}
} else if($.fmatter.isObject(oSelect)) {
// this is quicker
if(msl) {
ret = jQuery.map(scell, function(n, i){
return oSelect[n];
});
} else {
ret[0] = oSelect[cellval] || "";
}
}
}
cellval = ret.join(", ");
return cellval === "" ? $.fn.fmatter.defaultFormat(cellval,opts) : cellval;
};
$.fn.fmatter.rowactions = function(rid,gid,act,pos) {
var op ={
keys:false,
onEdit : null,
onSuccess: null,
afterSave:null,
onError: null,
afterRestore: null,
extraparam: {oper:'edit'},
url: null,
delOptions: {},
editOptions : {}
};
rid = $.jgrid.jqID( rid );
gid = $.jgrid.jqID( gid );
var cm = $('#'+gid)[0].p.colModel[pos];
if(!$.fmatter.isUndefined(cm.formatoptions)) {
op = $.extend(op,cm.formatoptions);
}
if( !$.fmatter.isUndefined($('#'+gid)[0].p.editOptions) ) {
op.editOptions = $('#'+gid)[0].p.editOptions;
}
if( !$.fmatter.isUndefined($('#'+gid)[0].p.delOptions) ) {
op.delOptions = $('#'+gid)[0].p.delOptions;
}
var saverow = function( rowid) {
if(op.afterSave) op.afterSave(rowid);
$("tr#"+rid+" div.ui-inline-edit, "+"tr#"+rid+" div.ui-inline-del","#"+gid + ".ui-jqgrid-btable:first").show();
$("tr#"+rid+" div.ui-inline-save, "+"tr#"+rid+" div.ui-inline-cancel","#"+gid+ ".ui-jqgrid-btable:first").hide();
},
restorerow = function( rowid) {
if(op.afterRestore) op.afterRestore(rowid);
$("tr#"+rid+" div.ui-inline-edit, "+"tr#"+rid+" div.ui-inline-del","#"+gid+ ".ui-jqgrid-btable:first").show();
$("tr#"+rid+" div.ui-inline-save, "+"tr#"+rid+" div.ui-inline-cancel","#"+gid+ ".ui-jqgrid-btable:first").hide();
};
switch(act)
{
case 'edit':
$('#'+gid).jqGrid('editRow',rid, op.keys, op.onEdit, op.onSuccess, op.url, op.extraparam, saverow, op.onError,restorerow);
$("tr#"+rid+" div.ui-inline-edit, "+"tr#"+rid+" div.ui-inline-del","#"+gid+ ".ui-jqgrid-btable:first").hide();
$("tr#"+rid+" div.ui-inline-save, "+"tr#"+rid+" div.ui-inline-cancel","#"+gid+ ".ui-jqgrid-btable:first").show();
break;
case 'save':
if ( $('#'+gid).jqGrid('saveRow',rid, op.onSuccess,op.url, op.extraparam, saverow, op.onError,restorerow) ) {
$("tr#"+rid+" div.ui-inline-edit, "+"tr#"+rid+" div.ui-inline-del","#"+gid+ ".ui-jqgrid-btable:first").show();
$("tr#"+rid+" div.ui-inline-save, "+"tr#"+rid+" div.ui-inline-cancel","#"+gid+ ".ui-jqgrid-btable:first").hide();
}
break;
case 'cancel' :
$('#'+gid).jqGrid('restoreRow',rid, restorerow);
$("tr#"+rid+" div.ui-inline-edit, "+"tr#"+rid+" div.ui-inline-del","#"+gid+ ".ui-jqgrid-btable:first").show();
$("tr#"+rid+" div.ui-inline-save, "+"tr#"+rid+" div.ui-inline-cancel","#"+gid+ ".ui-jqgrid-btable:first").hide();
break;
case 'del':
$('#'+gid).jqGrid('delGridRow',rid, op.delOptions);
break;
case 'formedit':
$('#'+gid).jqGrid('setSelection',rid);
$('#'+gid).jqGrid('editGridRow',rid, op.editOptions);
break;
}
};
$.fn.fmatter.actions = function(cellval,opts, rwd) {
var op ={keys:false, editbutton:true, delbutton:true, editformbutton: false};
if(!$.fmatter.isUndefined(opts.colModel.formatoptions)) {
op = $.extend(op,opts.colModel.formatoptions);
}
var rowid = opts.rowId, str="",ocl;
if(typeof(rowid) =='undefined' || $.fmatter.isEmpty(rowid)) {return "";}
if(op.editformbutton){
ocl = "onclick=$.fn.fmatter.rowactions('"+rowid+"','"+opts.gid+"','formedit',"+opts.pos+"); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); "
str =str+ "<div title='"+$.jgrid.nav.edittitle+"' style='float:left;cursor:pointer;' class='ui-pg-div ui-inline-edit' "+ocl+"><span class='ui-icon ui-icon-pencil'></span></div>";
} else if(op.editbutton){
ocl = "onclick=$.fn.fmatter.rowactions('"+rowid+"','"+opts.gid+"','edit',"+opts.pos+"); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover') ";
str =str+ "<div title='"+$.jgrid.nav.edittitle+"' style='float:left;cursor:pointer;' class='ui-pg-div ui-inline-edit' "+ocl+"><span class='ui-icon ui-icon-pencil'></span></div>";
}
if(op.delbutton) {
ocl = "onclick=$.fn.fmatter.rowactions('"+rowid+"','"+opts.gid+"','del',"+opts.pos+"); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";
str = str+"<div title='"+$.jgrid.nav.deltitle+"' style='float:left;margin-left:5px;' class='ui-pg-div ui-inline-del' "+ocl+"><span class='ui-icon ui-icon-trash'></span></div>";
}
ocl = "onclick=$.fn.fmatter.rowactions('"+rowid+"','"+opts.gid+"','save',"+opts.pos+"); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";
str = str+"<div title='"+$.jgrid.edit.bSubmit+"' style='float:left;display:none' class='ui-pg-div ui-inline-save' "+ocl+"><span class='ui-icon ui-icon-disk'></span></div>";
ocl = "onclick=$.fn.fmatter.rowactions('"+rowid+"','"+opts.gid+"','cancel',"+opts.pos+"); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";
str = str+"<div title='"+$.jgrid.edit.bCancel+"' style='float:left;display:none;margin-left:5px;' class='ui-pg-div ui-inline-cancel' "+ocl+"><span class='ui-icon ui-icon-cancel'></span></div>";
return "<div style='margin-left:8px;'>" + str + "</div>";
};
$.unformat = function (cellval,options,pos,cnt) {
// specific for jqGrid only
var ret, formatType = options.colModel.formatter,
op =options.colModel.formatoptions || {}, sep,
re = /([\.\*\_\'\(\)\{\}\+\?\\])/g,
unformatFunc = options.colModel.unformat||($.fn.fmatter[formatType] && $.fn.fmatter[formatType].unformat);
if(typeof unformatFunc !== 'undefined' && $.isFunction(unformatFunc) ) {
ret = unformatFunc($(cellval).text(), options, cellval);
} else if(!$.fmatter.isUndefined(formatType) && $.fmatter.isString(formatType) ) {
var opts = $.jgrid.formatter || {}, stripTag;
switch(formatType) {
case 'integer' :
op = $.extend({},opts.integer,op);
sep = op.thousandsSeparator.replace(re,"\\$1");
stripTag = new RegExp(sep, "g");
ret = $(cellval).text().replace(stripTag,'');
break;
case 'number' :
op = $.extend({},opts.number,op);
sep = op.thousandsSeparator.replace(re,"\\$1");
stripTag = new RegExp(sep, "g");
ret = $(cellval).text().replace(stripTag,"").replace(op.decimalSeparator,'.');
break;
case 'currency':
op = $.extend({},opts.currency,op);
sep = op.thousandsSeparator.replace(re,"\\$1");
stripTag = new RegExp(sep, "g");
ret = $(cellval).text().replace(stripTag,'').replace(op.decimalSeparator,'.').replace(op.prefix,'').replace(op.suffix,'');
break;
case 'checkbox':
var cbv = (options.colModel.editoptions) ? options.colModel.editoptions.value.split(":") : ["Yes","No"];
ret = $('input',cellval).attr("checked") ? cbv[0] : cbv[1];
break;
case 'select' :
ret = $.unformat.select(cellval,options,pos,cnt);
break;
case 'actions':
return "";
default:
ret= $(cellval).text();
}
}
return ret !== undefined ? ret : cnt===true ? $(cellval).text() : $.jgrid.htmlDecode($(cellval).html());
};
$.unformat.select = function (cellval,options,pos,cnt) {
// Spacial case when we have local data and perform a sort
// cnt is set to true only in sortDataArray
var ret = [];
var cell = $(cellval).text();
if(cnt===true) {return cell;}
var op = $.extend({},options.colModel.editoptions);
if(op.value){
var oSelect = op.value,
msl = op.multiple === true ? true : false,
scell = [], sv;
if(msl) {scell = cell.split(",");scell = $.map(scell,function(n){return $.trim(n);});}
if ($.fmatter.isString(oSelect)) {
var so = oSelect.split(";"), j=0;
for(var i=0; i<so.length;i++){
sv = so[i].split(":");
if(sv.length > 2 ) {
sv[1] = jQuery.map(sv,function(n,i){if(i>0) {return n;}}).join(":");
}
if(msl) {
if(jQuery.inArray(sv[1],scell)>-1) {
ret[j] = sv[0];
j++;
}
} else if($.trim(sv[1])==$.trim(cell)) {
ret[0] = sv[0];
break;
}
}
} else if($.fmatter.isObject(oSelect) || $.isArray(oSelect) ){
if(!msl) {scell[0] = cell;}
ret = jQuery.map(scell, function(n){
var rv;
$.each(oSelect, function(i,val){
if (val == n) {
rv = i;
return false;
}
});
if( typeof(rv) != 'undefined' ) {return rv;}
});
}
return ret.join(", ");
} else {
return cell || "";
}
};
$.unformat.date = function (cellval, opts) {
var op = $.jgrid.formatter.date || {};
if(!$.fmatter.isUndefined(opts.formatoptions)) {
op = $.extend({},op,opts.formatoptions);
}
if(!$.fmatter.isEmpty(cellval)) {
return $.fmatter.util.DateFormat(op.newformat,cellval,op.srcformat,op);
} else {
return $.fn.fmatter.defaultFormat(cellval, opts);
}
};
})(jQuery); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/jquery.fmatter.js | JavaScript | art | 21,799 |
/*
* jqDnR - Minimalistic Drag'n'Resize for jQuery.
*
* Copyright (c) 2007 Brice Burgess <bhb@iceburg.net>, http://www.iceburg.net
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* $Version: 2007.08.19 +r2
*/
(function($){
$.fn.jqDrag=function(h){return i(this,h,'d');};
$.fn.jqResize=function(h,ar){return i(this,h,'r',ar);};
$.jqDnR={
dnr:{},
e:0,
drag:function(v){
if(M.k == 'd')E.css({left:M.X+v.pageX-M.pX,top:M.Y+v.pageY-M.pY});
else {
E.css({width:Math.max(v.pageX-M.pX+M.W,0),height:Math.max(v.pageY-M.pY+M.H,0)});
if(M1){E1.css({width:Math.max(v.pageX-M1.pX+M1.W,0),height:Math.max(v.pageY-M1.pY+M1.H,0)});}
}
return false;
},
stop:function(){
//E.css('opacity',M.o);
$(document).unbind('mousemove',J.drag).unbind('mouseup',J.stop);
}
};
var J=$.jqDnR,M=J.dnr,E=J.e,E1,
i=function(e,h,k,aR){
return e.each(function(){
h=(h)?$(h,e):e;
h.bind('mousedown',{e:e,k:k},function(v){
var d=v.data,p={};E=d.e;E1 = aR ? $(aR) : false;
// attempt utilization of dimensions plugin to fix IE issues
if(E.css('position') != 'relative'){try{E.position(p);}catch(e){}}
M={
X:p.left||f('left')||0,
Y:p.top||f('top')||0,
W:f('width')||E[0].scrollWidth||0,
H:f('height')||E[0].scrollHeight||0,
pX:v.pageX,
pY:v.pageY,
k:d.k
//o:E.css('opacity')
};
// also resize
if(E1 && d.k != 'd'){
M1={
X:p.left||f1('left')||0,
Y:p.top||f1('top')||0,
W:E1[0].offsetWidth||f1('width')||0,
H:E1[0].offsetHeight||f1('height')||0,
pX:v.pageX,
pY:v.pageY,
k:d.k
};
} else {M1 = false;}
//E.css({opacity:0.8});
if($("input.hasDatepicker",E[0])[0]) {
try {$("input.hasDatepicker",E[0]).datepicker('hide');}catch (dpe){}
}
$(document).mousemove($.jqDnR.drag).mouseup($.jqDnR.stop);
return false;
});
});
},
f=function(k){return parseInt(E.css(k))||false;};
f1=function(k){ return parseInt(E1.css(k))||false;};
})(jQuery); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/jqDnR.js | JavaScript | art | 2,018 |
;(function($){
/**
* jqGrid extension for manipulating Grid Data
* 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-2.0.html
**/
$.jgrid.extend({
//Editing
editRow : function(rowid,keys,oneditfunc,successfunc, url, extraparam, aftersavefunc,errorfunc, afterrestorefunc) {
// Compatible mode old versions
var settings = {
"keys" : keys || false,
"oneditfunc" : oneditfunc || null,
"successfunc" : successfunc || null,
"url" : url || null,
"extraparam" : extraparam || {},
"aftersavefunc" : aftersavefunc || null,
"errorfunc": errorfunc || null,
"afterrestorefunc" : afterrestorefunc|| null,
"restoreAfterErorr" : true
},
args = $.makeArray(arguments).slice(1), o;
if(args[0] && typeof(args[0]) == "object" && !$.isFunction(args[0])) {
o = $.extend(settings,args[0]);
} else {
o = settings;
}
// End compatible
return this.each(function(){
var $t = this, nm, tmp, editable, cnt=0, focus=null, svr={}, ind,cm;
if (!$t.grid ) { return; }
ind = $($t).jqGrid("getInd",rowid,true);
if( ind === false ) {return;}
editable = $(ind).attr("editable") || "0";
if (editable == "0" && !$(ind).hasClass("not-editable-row")) {
cm = $t.p.colModel;
$('td',ind).each( function(i) {
nm = cm[i].name;
var treeg = $t.p.treeGrid===true && nm == $t.p.ExpandColumn;
if(treeg) { tmp = $("span:first",this).html();}
else {
try {
tmp = $.unformat(this,{rowId:rowid, colModel:cm[i]},i);
} catch (_) {
tmp = ( cm[i].edittype && cm[i].edittype == 'textarea' ) ? $(this).text() : $(this).html();
}
}
if ( nm != 'cb' && nm != 'subgrid' && nm != 'rn') {
if($t.p.autoencode) { tmp = $.jgrid.htmlDecode(tmp); }
svr[nm]=tmp;
if(cm[i].editable===true) {
if(focus===null) { focus = i; }
if (treeg) { $("span:first",this).html(""); }
else { $(this).html(""); }
var opt = $.extend({},cm[i].editoptions || {},{id:rowid+"_"+nm,name:nm});
if(!cm[i].edittype) { cm[i].edittype = "text"; }
if(tmp == " " || tmp == " " || (tmp.length==1 && tmp.charCodeAt(0)==160) ) {tmp='';}
var elc = $.jgrid.createEl(cm[i].edittype,opt,tmp,true,$.extend({},$.jgrid.ajaxOptions,$t.p.ajaxSelectOptions || {}));
$(elc).addClass("editable");
if(treeg) { $("span:first",this).append(elc); }
else { $(this).append(elc); }
//Again IE
if(cm[i].edittype == "select" && cm[i].editoptions.multiple===true && $.browser.msie) {
$(elc).width($(elc).width());
}
cnt++;
}
}
});
if(cnt > 0) {
svr.id = rowid; $t.p.savedRow.push(svr);
$(ind).attr("editable","1");
$("td:eq("+focus+") input",ind).focus();
if(o.keys===true) {
$(ind).bind("keydown",function(e) {
if (e.keyCode === 27) {$($t).jqGrid("restoreRow",rowid, afterrestorefunc);}
if (e.keyCode === 13) {
var ta = e.target;
if(ta.tagName == 'TEXTAREA') { return true; }
$($t).jqGrid("saveRow", rowid, o );
return false;
}
e.stopPropagation();
});
}
if( $.isFunction(o.oneditfunc)) { o.oneditfunc.call($t, rowid); }
}
}
});
},
saveRow : function(rowid, successfunc, url, extraparam, aftersavefunc,errorfunc, afterrestorefunc) {
// Compatible mode old versions
var settings = {
"successfunc" : successfunc || null,
"url" : url || null,
"extraparam" : extraparam || {},
"aftersavefunc" : aftersavefunc || null,
"errorfunc": errorfunc || null,
"afterrestorefunc" : afterrestorefunc|| null,
"restoreAfterErorr" : true
},
args = $.makeArray(arguments).slice(1), o;
if(args[0] && typeof(args[0]) == "object" && !$.isFunction(args[0])) {
o = $.extend(settings,args[0]);
} else {
o = settings;
}
// End compatible
var success = false;
var $t = this[0], nm, tmp={}, tmp2={}, tmp3= {}, editable, fr, cv, ind;
if (!$t.grid ) { return success; }
ind = $($t).jqGrid("getInd",rowid,true);
if(ind === false) {return success;}
editable = $(ind).attr("editable");
o.url = o.url ? o.url : $t.p.editurl;
if (editable==="1") {
var cm;
$("td",ind).each(function(i) {
cm = $t.p.colModel[i];
nm = cm.name;
if ( nm != 'cb' && nm != 'subgrid' && cm.editable===true && nm != 'rn' && !$(this).hasClass('not-editable-cell')) {
switch (cm.edittype) {
case "checkbox":
var cbv = ["Yes","No"];
if(cm.editoptions ) {
cbv = cm.editoptions.value.split(":");
}
tmp[nm]= $("input",this).attr("checked") ? cbv[0] : cbv[1];
break;
case 'text':
case 'password':
case 'textarea':
case "button" :
tmp[nm]=$("input, textarea",this).val();
break;
case 'select':
if(!cm.editoptions.multiple) {
tmp[nm] = $("select>option:selected",this).val();
tmp2[nm] = $("select>option:selected", this).text();
} else {
var sel = $("select",this), selectedText = [];
tmp[nm] = $(sel).val();
if(tmp[nm]) { tmp[nm]= tmp[nm].join(","); } else { tmp[nm] =""; }
$("select > option:selected",this).each(
function(i,selected){
selectedText[i] = $(selected).text();
}
);
tmp2[nm] = selectedText.join(",");
}
if(cm.formatter && cm.formatter == 'select') { tmp2={}; }
break;
case 'custom' :
try {
if(cm.editoptions && $.isFunction(cm.editoptions.custom_value)) {
tmp[nm] = cm.editoptions.custom_value.call($t, $(".customelement",this),'get');
if (tmp[nm] === undefined) { throw "e2"; }
} else { throw "e1"; }
} catch (e) {
if (e=="e1") { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+$.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose); }
if (e=="e2") { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+$.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose); }
else { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,e.message,jQuery.jgrid.edit.bClose); }
}
break;
}
cv = $.jgrid.checkValues(tmp[nm],i,$t);
if(cv[0] === false) {
cv[1] = tmp[nm] + " " + cv[1];
return false;
}
if($t.p.autoencode) { tmp[nm] = $.jgrid.htmlEncode(tmp[nm]); }
if(o.url !== 'clientArray' && cm.editoptions && cm.editoptions.NullIfEmpty === true) {
if(tmp[nm] == "") {
tmp3[nm] = 'null';
}
}
}
});
if (cv[0] === false){
try {
var positions = $.jgrid.findPos($("#"+$.jgrid.jqID(rowid), $t.grid.bDiv)[0]);
$.jgrid.info_dialog($.jgrid.errors.errcap,cv[1],$.jgrid.edit.bClose,{left:positions[0],top:positions[1]});
} catch (e) {
alert(cv[1]);
}
return success;
}
if(tmp) {
var idname, opers, oper;
opers = $t.p.prmNames;
oper = opers.oper;
idname = opers.id;
tmp[oper] = opers.editoper;
tmp[idname] = rowid;
if(typeof($t.p.inlineData) == 'undefined') { $t.p.inlineData ={}; }
tmp = $.extend({},tmp,$t.p.inlineData,o.extraparam);
}
if (o.url == 'clientArray') {
tmp = $.extend({},tmp, tmp2);
if($t.p.autoencode) {
$.each(tmp,function(n,v){
tmp[n] = $.jgrid.htmlDecode(v);
});
}
var resp = $($t).jqGrid("setRowData",rowid,tmp);
$(ind).attr("editable","0");
for( var k=0;k<$t.p.savedRow.length;k++) {
if( $t.p.savedRow[k].id == rowid) {fr = k; break;}
}
if(fr >= 0) { $t.p.savedRow.splice(fr,1); }
if( $.isFunction(o.aftersavefunc) ) { o.aftersavefunc.call($t, rowid,resp); }
success = true;
} else {
$("#lui_"+$t.p.id).show();
tmp3 = $.extend({},tmp,tmp3);
$.ajax($.extend({
url:o.url,
data: $.isFunction($t.p.serializeRowData) ? $t.p.serializeRowData.call($t, tmp3) : tmp3,
type: "POST",
async : false, //?!?
complete: function(res,stat){
$("#lui_"+$t.p.id).hide();
if (stat === "success"){
var ret;
if( $.isFunction(o.successfunc)) { ret = o.successfunc.call($t, res);}
else { ret = true; }
if (ret===true) {
if($t.p.autoencode) {
$.each(tmp,function(n,v){
tmp[n] = $.jgrid.htmlDecode(v);
});
}
tmp = $.extend({},tmp, tmp2);
$($t).jqGrid("setRowData",rowid,tmp);
$(ind).attr("editable","0");
for( var k=0;k<$t.p.savedRow.length;k++) {
if( $t.p.savedRow[k].id == rowid) {fr = k; break;}
}
if(fr >= 0) { $t.p.savedRow.splice(fr,1); }
if( $.isFunction(o.aftersavefunc) ) { o.aftersavefunc.call($t, rowid,res); }
success = true;
} else {
if($.isFunction(o.errorfunc) ) {
o.errorfunc.call($t, rowid, res, stat);
}
if(o.restoreAfterError === true) {
$($t).jqGrid("restoreRow",rowid, o.afterrestorefunc);
}
}
}
},
error:function(res,stat){
$("#lui_"+$t.p.id).hide();
if($.isFunction(o.errorfunc) ) {
o.errorfunc.call($t, rowid, res, stat);
} else {
try {
jQuery.jgrid.info_dialog(jQuery.jgrid.errors.errcap,'<div class="ui-state-error">'+ res.responseText +'</div>', jQuery.jgrid.edit.bClose,{buttonalign:'right'});
}
catch(e) {
alert(res.responseText);
}
}
if(o.restoreAfterError === true) {
$($t).jqGrid("restoreRow",rowid, o.afterrestorefunc);
}
}
}, $.jgrid.ajaxOptions, $t.p.ajaxRowOptions || {}));
}
$(ind).unbind("keydown");
}
return success;
},
restoreRow : function(rowid, afterrestorefunc) {
return this.each(function(){
var $t= this, fr, ind, ares={};
if (!$t.grid ) { return; }
ind = $($t).jqGrid("getInd",rowid,true);
if(ind === false) {return;}
for( var k=0;k<$t.p.savedRow.length;k++) {
if( $t.p.savedRow[k].id == rowid) {fr = k; break;}
}
if(fr >= 0) {
if($.isFunction($.fn.datepicker)) {
try {
$("input.hasDatepicker","#"+$.jgrid.jqID(ind.id)).datepicker('hide');
} catch (e) {}
}
$.each($t.p.colModel, function(i,n){
if(this.editable === true && this.name in $t.p.savedRow[fr] && !$(this).hasClass('not-editable-cell')) {
ares[this.name] = $t.p.savedRow[fr][this.name];
}
});
$($t).jqGrid("setRowData",rowid,ares);
$(ind).attr("editable","0").unbind("keydown");
$t.p.savedRow.splice(fr,1);
}
if ($.isFunction(afterrestorefunc))
{
afterrestorefunc.call($t, rowid);
}
});
}
//end inline edit
});
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/grid.inlinedit.js | JavaScript | art | 10,704 |
(function($){
/**
* jqGrid extension for form editing Grid Data
* 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-2.0.html
**/
/*global xmlJsonClass, jQuery, $ */
$.jgrid.extend({
searchGrid : function (p) {
p = $.extend({
recreateFilter: false,
drag: true,
sField:'searchField',
sValue:'searchString',
sOper: 'searchOper',
sFilter: 'filters',
loadDefaults: true, // this options activates loading of default filters from grid's postData for Multipe Search only.
beforeShowSearch: null,
afterShowSearch : null,
onInitializeSearch: null,
afterRedraw : null,
closeAfterSearch : false,
closeAfterReset: false,
closeOnEscape : false,
multipleSearch : false,
multipleGroup : false,
//cloneSearchRowOnAdd: true,
top : 0,
left: 0,
jqModal : true,
modal: false,
resize : false,
width: 450,
height: 'auto',
dataheight: 'auto',
showQuery: false,
errorcheck : true,
// translation
// if you want to change or remove the order change it in sopt
// ['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc'],
sopt: null,
stringResult: undefined,
onClose : null,
onSearch : null,
onReset : null,
toTop : true,
overlay : 10,
columns : [],
tmplNames : null,
tmplFilters : null,
// translations - later in lang file
tmplLabel : ' Template: ',
showOnLoad: false,
layer: null
}, $.jgrid.search, p || {});
return this.each(function() {
var $t = this;
if(!$t.grid) {return;}
var fid = "fbox_"+$t.p.id,
showFrm = true,
IDs = {themodal:'searchmod'+fid,modalhead:'searchhd'+fid,modalcontent:'searchcnt'+fid, scrollelm : fid},
defaultFilters = $t.p.postData[p.sFilter];
if(typeof(defaultFilters) === "string") {
defaultFilters = $.jgrid.parse( defaultFilters );
}
if(p.recreateFilter === true) {
$("#"+IDs.themodal).remove();
}
function showFilter() {
if($.isFunction(p.beforeShowSearch)) {
showFrm = p.beforeShowSearch($("#"+fid));
if(typeof(showFrm) === "undefined") {
showFrm = true;
}
}
if(showFrm) {
$.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+fid,jqm:p.jqModal, modal:p.modal, overlay: p.overlay, toTop: p.toTop});
if($.isFunction(p.afterShowSearch)) {
p.afterShowSearch($("#"+fid));
}
}
}
if ( $("#"+IDs.themodal).html() !== null ) {
showFilter();
} else {
var fil = $("<span><div id='"+fid+"' class='searchFilter' style='overflow:auto'></div></span>").insertBefore("#gview_"+$t.p.id);
if($.isFunction(p.onInitializeSearch) ) {
p.onInitializeSearch($("#"+fid));
}
var columns = $.extend([],$t.p.colModel),
bS ="<a href='javascript:void(0)' id='"+fid+"_search' class='fm-button ui-state-default ui-corner-all fm-button-icon-right ui-reset'><span class='ui-icon ui-icon-search'></span>"+p.Find+"</a>",
bC ="<a href='javascript:void(0)' id='"+fid+"_reset' class='fm-button ui-state-default ui-corner-all fm-button-icon-left ui-search'><span class='ui-icon ui-icon-arrowreturnthick-1-w'></span>"+p.Reset+"</a>",
bQ = "", tmpl="", colnm, found = false, bt, cmi=-1;
if(p.showQuery) {
bQ ="<a href='javascript:void(0)' id='"+fid+"_query' class='fm-button ui-state-default ui-corner-all fm-button-icon-left'><span class='ui-icon ui-icon-comment'></span>Query</a>";
}
if(!p.columns.length) {
$.each(columns, function(i,n){
if(!n.label) {
n.label = $t.p.colNames[i];
}
// find first searchable column and set it if no default filter
if(!found) {
var searchable = (typeof n.search === 'undefined') ? true: n.search ,
hidden = (n.hidden === true),
ignoreHiding = (n.searchoptions && n.searchoptions.searchhidden === true);
if ((ignoreHiding && searchable) || (searchable && !hidden)) {
found = true;
colnm = n.index || n.name;
cmi =i;
}
}
});
} else {
columns = p.columns;
}
// old behaviour
if( (!defaultFilters && colnm) || p.multipleSearch === false ) {
var cmop = "eq";
if(cmi >=0 && columns[cmi].searchoptions && columns[cmi].searchoptions.sopt) {
cmop = columns[cmi].searchoptions.sopt[0];
} else if(p.sopt && p.sopt.length) {
cmop = p.sopt[0];
}
defaultFilters = {"groupOp": "AND",rules:[{"field":colnm,"op":cmop,"data":""}]};
}
found = false;
if(p.tmplNames && p.tmplNames.length) {
found = true;
tmpl = p.tmplLabel;
tmpl += "<select class='ui-template'>";
tmpl += "<option value='default'>Default</option>";
$.each(p.tmplNames, function(i,n){
tmpl += "<option value='"+i+"'>"+n+"</option>";
});
tmpl += "</select>";
}
bt = "<table class='EditTable' style='border:0px none;margin-top:5px' id='"+fid+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr><td class='EditButton' style='text-align:left'>"+bC+tmpl+"</td><td class='EditButton'>"+bQ+bS+"</td></tr></tbody></table>";
$("#"+fid).jqFilter({
columns : columns,
filter: p.loadDefaults ? defaultFilters : null,
showQuery: p.showQuery,
errorcheck : p.errorcheck,
sopt: p.sopt,
groupButton : p.multipleGroup,
ruleButtons : p.multipleSearch,
afterRedraw : p.afterRedraw,
_gridsopt : $.jgrid.search.odata,
onChange : function( sp ) {
if(this.p.showQuery) {
$('.query',this).html(this.toUserFriendlyString());
}
}
});
fil.append( bt );
if(found && p.tmplFilters && p.tmplFilters.length) {
$(".ui-template", fil).bind('change', function(e){
var curtempl = $(this).val();
if(curtempl=="default") {
$("#"+fid).jqFilter('addFilter', defaultFilters);
} else {
$("#"+fid).jqFilter('addFilter', p.tmplFilters[parseInt(curtempl,10)]);
}
return false;
});
}
if(p.multipleGroup === true) p.multipleSearch = true;
if($.isFunction(p.onInitializeSearch) ) {
p.onInitializeSearch($("#"+fid));
}
if (p.layer)
$.jgrid.createModal(IDs ,fil,p,"#gview_"+$t.p.id,$("#gbox_"+$t.p.id)[0], "#"+p.layer, {position: "relative"});
else
$.jgrid.createModal(IDs ,fil,p,"#gview_"+$t.p.id,$("#gbox_"+$t.p.id)[0]);
if(bQ) {
$("#"+fid+"_query").bind('click', function(e){
$(".queryresult", fil).toggle();
return false;
});
}
if (p.stringResult===undefined) {
// to provide backward compatibility, inferring stringResult value from multipleSearch
p.stringResult = p.multipleSearch;
}
$("#"+fid+"_search").bind('click', function(){
var fl = $("#"+fid),
sdata={}, res ,
filters = fl.jqFilter('filterData');
if(p.errorcheck) {
fl[0].hideError();
if(!p.showQuery) { fl.jqFilter('toSQLString'); }
if(fl[0].p.error) {
fl[0].showError();
return false;
}
}
if(p.stringResult) {
try {
// xmlJsonClass or JSON.stringify
res = xmlJsonClass.toJson(filters, '', '', false);
} catch (e) {
try {
res = JSON.stringify(filters);
} catch (e2) { }
}
if(typeof(res)==="string") {
sdata[p.sFilter] = res;
$.each([p.sField,p.sValue, p.sOper], function() { sdata[this] = "";});
}
} else {
if(p.multipleSearch) {
sdata[p.sFilter] = filters;
$.each([p.sField,p.sValue, p.sOper], function() { sdata[this] = "";});
} else {
sdata[p.sField] = filters.rules[0].field;
sdata[p.sValue] = filters.rules[0].data;
sdata[p.sOper] = filters.rules[0].op;
sdata[p.sFilter] = "";
}
}
$t.p.search = true;
$.extend($t.p.postData,sdata);
if($.isFunction(p.onSearch) ) {
p.onSearch();
}
$($t).trigger("reloadGrid",[{page:1}]);
if(p.closeAfterSearch) {
$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+$t.p.id,jqm:p.jqModal,onClose: p.onClose});
}
return false;
});
$("#"+fid+"_reset").bind('click', function(){
var sdata={},
fl = $("#"+fid);
$t.p.search = false;
if(p.multipleSearch===false) {
sdata[p.sField] = sdata[p.sValue] = sdata[p.sOper] = "";
} else {
sdata[p.sFilter] = "";
}
fl[0].resetFilter();
if(found) {
$(".ui-template", fil).val("default");
}
$.extend($t.p.postData,sdata);
if($.isFunction(p.onReset) ) {
p.onReset();
}
$($t).trigger("reloadGrid",[{page:1}]);
return false;
});
showFilter();
$(".fm-button:not(.ui-state-disabled)",fil).hover(
function(){$(this).addClass('ui-state-hover');},
function(){$(this).removeClass('ui-state-hover');}
);
}
});
},
editGridRow : function(rowid, p){
p = $.extend({
top : 0,
left: 0,
width: 300,
height: 'auto',
dataheight: 'auto',
modal: false,
overlay : 10,
drag: true,
resize: true,
url: null,
mtype : "POST",
clearAfterAdd :true,
closeAfterEdit : false,
reloadAfterSubmit : true,
onInitializeForm: null,
beforeInitData: null,
beforeShowForm: null,
afterShowForm: null,
beforeSubmit: null,
afterSubmit: null,
onclickSubmit: null,
afterComplete: null,
onclickPgButtons : null,
afterclickPgButtons: null,
editData : {},
recreateForm : false,
jqModal : true,
closeOnEscape : false,
addedrow : "first",
topinfo : '',
bottominfo: '',
saveicon : [],
closeicon : [],
savekey: [false,13],
navkeys: [false,38,40],
checkOnSubmit : false,
checkOnUpdate : false,
_savedData : {},
processing : false,
onClose : null,
ajaxEditOptions : {},
serializeEditData : null,
viewPagerButtons : true
}, $.jgrid.edit, p || {});
var rp_ge = p;
return this.each(function(){
var $t = this;
if (!$t.grid || !rowid) { return; }
var gID = $t.p.id,
frmgr = "FrmGrid_"+gID,frmtb = "TblGrid_"+gID,
IDs = {themodal:'editmod'+gID,modalhead:'edithd'+gID,modalcontent:'editcnt'+gID, scrollelm : frmgr},
onBeforeShow = $.isFunction(rp_ge.beforeShowForm) ? rp_ge.beforeShowForm : false,
onAfterShow = $.isFunction(rp_ge.afterShowForm) ? rp_ge.afterShowForm : false,
onBeforeInit = $.isFunction(rp_ge.beforeInitData) ? rp_ge.beforeInitData : false,
onInitializeForm = $.isFunction(rp_ge.onInitializeForm) ? rp_ge.onInitializeForm : false,
copydata = null,
showFrm = true,
maxCols = 1, maxRows=0, postdata, extpost, newData, diff;
if (rowid === "new") {
rowid = "_empty";
p.caption=rp_ge.addCaption;
} else {
p.caption=rp_ge.editCaption;
}
if(p.recreateForm===true && $("#"+IDs.themodal).html() !== null) {
$("#"+IDs.themodal).remove();
}
var closeovrl = true;
if(p.checkOnUpdate && p.jqModal && !p.modal) {
closeovrl = false;
}
function getFormData(){
$("#"+frmtb+" > tbody > tr > td > .FormElement").each(function(i) {
var celm = $(".customelement", this);
if (celm.length) {
var elem = celm[0], nm = $(elem).attr('name');
$.each($t.p.colModel, function(i,n){
if(this.name === nm && this.editoptions && $.isFunction(this.editoptions.custom_value)) {
try {
postdata[nm] = this.editoptions.custom_value($("#"+$.jgrid.jqID(nm),"#"+frmtb),'get');
if (postdata[nm] === undefined) { throw "e1"; }
} catch (e) {
if (e==="e1") { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+$.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose);}
else { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,e.message,jQuery.jgrid.edit.bClose); }
}
return true;
}
});
} else {
switch ($(this).get(0).type) {
case "checkbox":
if($(this).attr("checked")) {
postdata[this.name]= $(this).val();
}else {
var ofv = $(this).attr("offval");
postdata[this.name]= ofv;
}
break;
case "select-one":
postdata[this.name]= $("option:selected",this).val();
extpost[this.name]= $("option:selected",this).text();
break;
case "select-multiple":
postdata[this.name]= $(this).val();
if(postdata[this.name]) { postdata[this.name] = postdata[this.name].join(","); }
else { postdata[this.name] =""; }
var selectedText = [];
$("option:selected",this).each(
function(i,selected){
selectedText[i] = $(selected).text();
}
);
extpost[this.name]= selectedText.join(",");
break;
case "password":
case "text":
case "textarea":
case "button":
postdata[this.name] = $(this).val();
break;
}
if($t.p.autoencode) { postdata[this.name] = $.jgrid.htmlEncode(postdata[this.name]); }
}
});
return true;
}
function createData(rowid,obj,tb,maxcols){
var nm, hc,trdata, cnt=0,tmp, dc,elc, retpos=[], ind=false,
tdtmpl = "<td class='CaptionTD'> </td><td class='DataTD'> </td>", tmpl="", i; //*2
for (i =1; i<=maxcols;i++) {
tmpl += tdtmpl;
}
if(rowid != '_empty') {
ind = $(obj).jqGrid("getInd",rowid);
}
$(obj.p.colModel).each( function(i) {
nm = this.name;
// hidden fields are included in the form
if(this.editrules && this.editrules.edithidden === true) {
hc = false;
} else {
hc = this.hidden === true ? true : false;
}
dc = hc ? "style='display:none'" : "";
if ( nm !== 'cb' && nm !== 'subgrid' && this.editable===true && nm !== 'rn') {
if(ind === false) {
tmp = "";
} else {
if(nm == obj.p.ExpandColumn && obj.p.treeGrid === true) {
tmp = $("td:eq("+i+")",obj.rows[ind]).text();
} else {
try {
tmp = $.unformat($("td:eq("+i+")",obj.rows[ind]),{rowId:rowid, colModel:this},i);
} catch (_) {
tmp = (this.edittype && this.edittype == "textarea") ? $("td:eq("+i+")",obj.rows[ind]).text() : $("td:eq("+i+")",obj.rows[ind]).html();
}
if(!tmp || tmp == " " || tmp == " " || (tmp.length==1 && tmp.charCodeAt(0)==160) ) {tmp='';}
}
}
var opt = $.extend({}, this.editoptions || {} ,{id:nm,name:nm}),
frmopt = $.extend({}, {elmprefix:'',elmsuffix:'',rowabove:false,rowcontent:''}, this.formoptions || {}),
rp = parseInt(frmopt.rowpos,10) || cnt+1,
cp = parseInt((parseInt(frmopt.colpos,10) || 1)*2,10);
if(rowid == "_empty" && opt.defaultValue ) {
tmp = $.isFunction(opt.defaultValue) ? opt.defaultValue() : opt.defaultValue;
}
if(!this.edittype) { this.edittype = "text"; }
if($t.p.autoencode) { tmp = $.jgrid.htmlDecode(tmp); }
elc = $.jgrid.createEl(this.edittype,opt,tmp,false,$.extend({},$.jgrid.ajaxOptions,obj.p.ajaxSelectOptions || {}));
if(tmp === "" && this.edittype == "checkbox") {tmp = $(elc).attr("offval");}
if(tmp === "" && this.edittype == "select") {tmp = $("option:eq(0)",elc).text();}
if(rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) { rp_ge._savedData[nm] = tmp; }
$(elc).addClass("FormElement");
if(this.edittype == 'text' || this.edittype == 'textarea') {
$(elc).addClass("ui-widget-content ui-corner-all");
}
trdata = $(tb).find("tr[rowpos="+rp+"]");
if(frmopt.rowabove) {
var newdata = $("<tr><td class='contentinfo' colspan='"+(maxcols*2)+"'>"+frmopt.rowcontent+"</td></tr>");
$(tb).append(newdata);
newdata[0].rp = rp;
}
if ( trdata.length===0 ) {
trdata = $("<tr "+dc+" rowpos='"+rp+"'></tr>").addClass("FormData").attr("id","tr_"+nm);
$(trdata).append(tmpl);
$(tb).append(trdata);
trdata[0].rp = rp;
}
$("td:eq("+(cp-2)+")",trdata[0]).html( typeof frmopt.label === 'undefined' ? obj.p.colNames[i]: frmopt.label);
$("td:eq("+(cp-1)+")",trdata[0]).append(frmopt.elmprefix).append(elc).append(frmopt.elmsuffix);
retpos[cnt] = i;
cnt++;
}
});
if( cnt > 0) {
var idrow = $("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+ (maxcols*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='"+obj.p.id+"_id' value='"+rowid+"'/></td></tr>");
idrow[0].rp = cnt+999;
$(tb).append(idrow);
if(rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) { rp_ge._savedData[obj.p.id+"_id"] = rowid; }
}
return retpos;
}
function fillData(rowid,obj,fmid){
var nm,cnt=0,tmp, fld,opt,vl,vlc;
if(rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) {rp_ge._savedData = {};rp_ge._savedData[obj.p.id+"_id"]=rowid;}
var cm = obj.p.colModel;
if(rowid == '_empty') {
$(cm).each(function(i){
nm = this.name;
opt = $.extend({}, this.editoptions || {} );
fld = $("#"+$.jgrid.jqID(nm),"#"+fmid);
if(fld && fld.length && fld[0] !== null) {
vl = "";
if(opt.defaultValue ) {
vl = $.isFunction(opt.defaultValue) ? opt.defaultValue() : opt.defaultValue;
if(fld[0].type=='checkbox') {
vlc = vl.toLowerCase();
if(vlc.search(/(false|0|no|off|undefined)/i)<0 && vlc!=="") {
fld[0].checked = true;
fld[0].defaultChecked = true;
fld[0].value = vl;
} else {
fld.attr({checked:"",defaultChecked:""});
}
} else {fld.val(vl); }
} else {
if( fld[0].type=='checkbox' ) {
fld[0].checked = false;
fld[0].defaultChecked = false;
vl = $(fld).attr("offval");
} else if (fld[0].type && fld[0].type.substr(0,6)=='select') {
fld[0].selectedIndex = 0;
} else {
fld.val(vl);
}
}
if(rp_ge.checkOnSubmit===true || rp_ge.checkOnUpdate) { rp_ge._savedData[nm] = vl; }
}
});
$("#id_g","#"+fmid).val(rowid);
return;
}
var tre = $(obj).jqGrid("getInd",rowid,true);
if(!tre) { return; }
$('td',tre).each( function(i) {
nm = cm[i].name;
// hidden fields are included in the form
if ( nm !== 'cb' && nm !== 'subgrid' && nm !== 'rn' && cm[i].editable===true) {
if(nm == obj.p.ExpandColumn && obj.p.treeGrid === true) {
tmp = $(this).text();
} else {
try {
tmp = $.unformat($(this),{rowId:rowid, colModel:cm[i]},i);
} catch (_) {
tmp = cm[i].edittype=="textarea" ? $(this).text() : $(this).html();
}
}
if($t.p.autoencode) { tmp = $.jgrid.htmlDecode(tmp); }
if(rp_ge.checkOnSubmit===true || rp_ge.checkOnUpdate) { rp_ge._savedData[nm] = tmp; }
nm = $.jgrid.jqID(nm);
switch (cm[i].edittype) {
case "password":
case "text":
case "button" :
case "image":
case "textarea":
if(tmp == " " || tmp == " " || (tmp.length==1 && tmp.charCodeAt(0)==160) ) {tmp='';}
$("#"+nm,"#"+fmid).val(tmp);
break;
case "select":
var opv = tmp.split(",");
opv = $.map(opv,function(n){return $.trim(n);});
$("#"+nm+" option","#"+fmid).each(function(j){
if (!cm[i].editoptions.multiple && (opv[0] == $.trim($(this).text()) || opv[0] == $.trim($(this).val())) ){
this.selected= true;
} else if (cm[i].editoptions.multiple){
if( $.inArray($.trim($(this).text()), opv ) > -1 || $.inArray($.trim($(this).val()), opv ) > -1 ){
this.selected = true;
}else{
this.selected = false;
}
} else {
this.selected = false;
}
});
break;
case "checkbox":
tmp = tmp+"";
if(cm[i].editoptions && cm[i].editoptions.value) {
var cb = cm[i].editoptions.value.split(":");
if(cb[0] == tmp) {
$("#"+nm,"#"+fmid).attr("checked",true);
$("#"+nm,"#"+fmid).attr("defaultChecked",true); //ie
} else {
$("#"+nm,"#"+fmid).attr("checked",false);
$("#"+nm,"#"+fmid).attr("defaultChecked",""); //ie
}
} else {
tmp = tmp.toLowerCase();
if(tmp.search(/(false|0|no|off|undefined)/i)<0 && tmp!=="") {
$("#"+nm,"#"+fmid).attr("checked",true);
$("#"+nm,"#"+fmid).attr("defaultChecked",true); //ie
} else {
$("#"+nm,"#"+fmid).attr("checked",false);
$("#"+nm,"#"+fmid).attr("defaultChecked",""); //ie
}
}
break;
case 'custom' :
try {
if(cm[i].editoptions && $.isFunction(cm[i].editoptions.custom_value)) {
cm[i].editoptions.custom_value($("#"+nm,"#"+fmid),'set',tmp);
} else { throw "e1"; }
} catch (e) {
if (e=="e1") { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+$.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose);}
else { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,e.message,jQuery.jgrid.edit.bClose); }
}
break;
}
cnt++;
}
});
if(cnt>0) { $("#id_g","#"+frmtb).val(rowid); }
}
function postIt() {
var copydata, ret=[true,"",""], onCS = {}, opers = $t.p.prmNames, idname, oper, key, selr;
if($.isFunction(rp_ge.beforeCheckValues)) {
var retvals = rp_ge.beforeCheckValues(postdata,$("#"+frmgr),postdata[$t.p.id+"_id"] == "_empty" ? opers.addoper : opers.editoper);
if(retvals && typeof(retvals) === 'object') { postdata = retvals; }
}
for( key in postdata ){
if(postdata.hasOwnProperty(key)) {
ret = $.jgrid.checkValues(postdata[key],key,$t);
if(ret[0] === false) { break; }
}
}
if(ret[0]) {
if( $.isFunction( rp_ge.onclickSubmit)) { onCS = rp_ge.onclickSubmit(rp_ge,postdata) || {}; }
if( $.isFunction(rp_ge.beforeSubmit)) { ret = rp_ge.beforeSubmit(postdata,$("#"+frmgr)); }
}
if(ret[0] && !rp_ge.processing) {
rp_ge.processing = true;
$("#sData", "#"+frmtb+"_2").addClass('ui-state-active');
oper = opers.oper;
idname = opers.id;
// we add to pos data array the action - the name is oper
postdata[oper] = ($.trim(postdata[$t.p.id+"_id"]) == "_empty") ? opers.addoper : opers.editoper;
if(postdata[oper] != opers.addoper) {
postdata[idname] = postdata[$t.p.id+"_id"];
} else {
// check to see if we have allredy this field in the form and if yes lieve it
if( postdata[idname] === undefined ) { postdata[idname] = postdata[$t.p.id+"_id"]; }
}
delete postdata[$t.p.id+"_id"];
postdata = $.extend(postdata,rp_ge.editData,onCS);
if($t.p.treeGrid === true) {
if(postdata[oper] == opers.addoper) {
selr = $($t).jqGrid("getGridParam", 'selrow');
var tr_par_id = $t.p.treeGridModel == 'adjacency' ? $t.p.treeReader.parent_id_field : 'parent_id';
postdata[tr_par_id] = selr;
}
for(i in $t.p.treeReader){
var itm = $t.p.treeReader[i];
if(postdata.hasOwnProperty(itm)) {
if(postdata[oper] == opers.addoper && i === 'parent_id_field') { continue; }
delete postdata[itm];
}
}
}
var ajaxOptions = $.extend({
url: rp_ge.url ? rp_ge.url : $($t).jqGrid('getGridParam','editurl'),
type: rp_ge.mtype,
data: $.isFunction(rp_ge.serializeEditData) ? rp_ge.serializeEditData(postdata) : postdata,
complete:function(data,Status){
if(Status != "success") {
ret[0] = false;
if ($.isFunction(rp_ge.errorTextFormat)) {
ret[1] = rp_ge.errorTextFormat(data);
} else {
ret[1] = Status + " Status: '" + data.statusText + "'. Error code: " + data.status;
}
} else {
// data is posted successful
// execute aftersubmit with the returned data from server
if( $.isFunction(rp_ge.afterSubmit) ) {
ret = rp_ge.afterSubmit(data,postdata);
}
}
if(ret[0] === false) {
$("#FormError>td","#"+frmtb).html(ret[1]);
$("#FormError","#"+frmtb).show();
} else {
// remove some values if formattaer select or checkbox
$.each($t.p.colModel, function(i,n){
if(extpost[this.name] && this.formatter && this.formatter=='select') {
try {delete extpost[this.name];} catch (e) {}
}
});
postdata = $.extend(postdata,extpost);
if($t.p.autoencode) {
$.each(postdata,function(n,v){
postdata[n] = $.jgrid.htmlDecode(v);
});
}
rp_ge.reloadAfterSubmit = rp_ge.reloadAfterSubmit && $t.p.datatype != "local";
// the action is add
if(postdata[oper] == opers.addoper ) {
//id processing
// user not set the id ret[2]
if(!ret[2]) { ret[2] = $.jgrid.randId(); }
postdata[idname] = ret[2];
if(rp_ge.closeAfterAdd) {
if(rp_ge.reloadAfterSubmit) { $($t).trigger("reloadGrid"); }
else {
if($t.p.treeGrid === true){
$($t).jqGrid("addChildNode",ret[2],selr,postdata );
} else {
$($t).jqGrid("addRowData",ret[2],postdata,p.addedrow);
$($t).jqGrid("setSelection",ret[2]);
}
}
$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal,onClose: rp_ge.onClose});
} else if (rp_ge.clearAfterAdd) {
if(rp_ge.reloadAfterSubmit) { $($t).trigger("reloadGrid"); }
else {
if($t.p.treeGrid === true){
$($t).jqGrid("addChildNode",ret[2],selr,postdata );
} else {
$($t).jqGrid("addRowData",ret[2],postdata,p.addedrow);
}
}
fillData("_empty",$t,frmgr);
} else {
if(rp_ge.reloadAfterSubmit) { $($t).trigger("reloadGrid"); }
else {
if($t.p.treeGrid === true){
$($t).jqGrid("addChildNode",ret[2],selr,postdata );
} else {
$($t).jqGrid("addRowData",ret[2],postdata,p.addedrow);
}
}
}
} else {
// the action is update
if(rp_ge.reloadAfterSubmit) {
$($t).trigger("reloadGrid");
if( !rp_ge.closeAfterEdit ) { setTimeout(function(){$($t).jqGrid("setSelection",postdata[idname]);},1000); }
} else {
if($t.p.treeGrid === true) {
$($t).jqGrid("setTreeRow",postdata[idname],postdata);
} else {
$($t).jqGrid("setRowData",postdata[idname],postdata);
}
}
if(rp_ge.closeAfterEdit) { $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal,onClose: rp_ge.onClose}); }
}
if($.isFunction(rp_ge.afterComplete)) {
copydata = data;
setTimeout(function(){rp_ge.afterComplete(copydata,postdata,$("#"+frmgr));copydata=null;},500);
}
if(rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) {
$("#"+frmgr).data("disabled",false);
if(rp_ge._savedData[$t.p.id+"_id"] !="_empty"){
for(var key in rp_ge._savedData) {
if(postdata[key]) {
rp_ge._savedData[key] = postdata[key];
}
}
}
}
}
rp_ge.processing=false;
$("#sData", "#"+frmtb+"_2").removeClass('ui-state-active');
try{$(':input:visible',"#"+frmgr)[0].focus();} catch (e){}
}
}, $.jgrid.ajaxOptions, rp_ge.ajaxEditOptions );
if (!ajaxOptions.url && !rp_ge.useDataProxy) {
if ($.isFunction($t.p.dataProxy)) {
rp_ge.useDataProxy = true;
} else {
ret[0]=false; ret[1] += " "+$.jgrid.errors.nourl;
}
}
if (ret[0]) {
if (rp_ge.useDataProxy) { $t.p.dataProxy.call($t, ajaxOptions, "set_"+$t.p.id); }
else { $.ajax(ajaxOptions); }
}
}
if(ret[0] === false) {
$("#FormError>td","#"+frmtb).html(ret[1]);
$("#FormError","#"+frmtb).show();
// return;
}
}
function compareData(nObj, oObj ) {
var ret = false,key;
for (key in nObj) {
if(nObj[key] != oObj[key]) {
ret = true;
break;
}
}
return ret;
}
function setNulls() {
$.each($t.p.colModel, function(i,n){
if(n.editoptions && n.editoptions.NullIfEmpty === true) {
if(postdata.hasOwnProperty(n.name) && postdata[n.name] == "") {
postdata[n.name] = 'null';
}
}
});
}
function checkUpdates () {
var stat = true;
$("#FormError","#"+frmtb).hide();
if(rp_ge.checkOnUpdate) {
postdata = {}; extpost={};
getFormData();
newData = $.extend({},postdata,extpost);
diff = compareData(newData,rp_ge._savedData);
if(diff) {
$("#"+frmgr).data("disabled",true);
$(".confirm","#"+IDs.themodal).show();
stat = false;
} else {
setNulls();
}
}
return stat;
}
function restoreInline()
{
if (rowid !== "_empty" && typeof($t.p.savedRow) !== "undefined" && $t.p.savedRow.length > 0 && $.isFunction($.fn.jqGrid.restoreRow)) {
for (var i=0;i<$t.p.savedRow.length;i++) {
if ($t.p.savedRow[i].id == rowid) {
$($t).jqGrid('restoreRow',rowid);
break;
}
}
}
}
function updateNav(cr,totr){
if (cr===0) { $("#pData","#"+frmtb+"_2").addClass('ui-state-disabled'); } else { $("#pData","#"+frmtb+"_2").removeClass('ui-state-disabled'); }
if (cr==totr) { $("#nData","#"+frmtb+"_2").addClass('ui-state-disabled'); } else { $("#nData","#"+frmtb+"_2").removeClass('ui-state-disabled'); }
}
function getCurrPos() {
var rowsInGrid = $($t).jqGrid("getDataIDs"),
selrow = $("#id_g","#"+frmtb).val(),
pos = $.inArray(selrow,rowsInGrid);
return [pos,rowsInGrid];
}
if ( $("#"+IDs.themodal).html() !== null ) {
if(onBeforeInit) {
showFrm = onBeforeInit($("#"+frmgr));
if(typeof(showFrm) == "undefined") {
showFrm = true;
}
}
if(showFrm === false) { return; }
restoreInline();
$(".ui-jqdialog-title","#"+IDs.modalhead).html(p.caption);
$("#FormError","#"+frmtb).hide();
if(rp_ge.topinfo) {
$(".topinfo","#"+frmtb+"_2").html(rp_ge.topinfo);
$(".tinfo","#"+frmtb+"_2").show();
} else {
$(".tinfo","#"+frmtb+"_2").hide();
}
if(rp_ge.bottominfo) {
$(".bottominfo","#"+frmtb+"_2").html(rp_ge.bottominfo);
$(".binfo","#"+frmtb+"_2").show();
} else {
$(".binfo","#"+frmtb+"_2").hide();
}
// filldata
fillData(rowid,$t,frmgr);
///
if(rowid=="_empty" || !rp_ge.viewPagerButtons) {
$("#pData, #nData","#"+frmtb+"_2").hide();
} else {
$("#pData, #nData","#"+frmtb+"_2").show();
}
if(rp_ge.processing===true) {
rp_ge.processing=false;
$("#sData", "#"+frmtb+"_2").removeClass('ui-state-active');
}
if($("#"+frmgr).data("disabled")===true) {
$(".confirm","#"+IDs.themodal).hide();
$("#"+frmgr).data("disabled",false);
}
if(onBeforeShow) { onBeforeShow($("#"+frmgr)); }
$("#"+IDs.themodal).data("onClose",rp_ge.onClose);
$.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, jqM: false, overlay: p.overlay, modal:p.modal});
if(!closeovrl) {
$(".jqmOverlay").click(function(){
if(!checkUpdates()) { return false; }
$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: rp_ge.onClose});
return false;
});
}
if(onAfterShow) { onAfterShow($("#"+frmgr)); }
} else {
var dh = isNaN(p.dataheight) ? p.dataheight : p.dataheight+"px",
frm = $("<form name='FormPost' id='"+frmgr+"' class='FormGrid' onSubmit='return false;' style='width:100%;overflow:auto;position:relative;height:"+dh+";'></form>").data("disabled",false),
tbl = $("<table id='"+frmtb+"' class='EditTable' cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>");
if(onBeforeInit) {
showFrm = onBeforeInit($("#"+frmgr));
if(typeof(showFrm) == "undefined") {
showFrm = true;
}
}
if(showFrm === false) { return; }
restoreInline();
$($t.p.colModel).each( function(i) {
var fmto = this.formoptions;
maxCols = Math.max(maxCols, fmto ? fmto.colpos || 0 : 0 );
maxRows = Math.max(maxRows, fmto ? fmto.rowpos || 0 : 0 );
});
$(frm).append(tbl);
var flr = $("<tr id='FormError' style='display:none'><td class='ui-state-error' colspan='"+(maxCols*2)+"'></td></tr>");
flr[0].rp = 0;
$(tbl).append(flr);
//topinfo
flr = $("<tr style='display:none' class='tinfo'><td class='topinfo' colspan='"+(maxCols*2)+"'>"+rp_ge.topinfo+"</td></tr>");
flr[0].rp = 0;
$(tbl).append(flr);
// set the id.
// use carefull only to change here colproperties.
// create data
var rtlb = $t.p.direction == "rtl" ? true :false,
bp = rtlb ? "nData" : "pData",
bn = rtlb ? "pData" : "nData";
createData(rowid,$t,tbl,maxCols);
// buttons at footer
var bP = "<a href='javascript:void(0)' id='"+bp+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></a>",
bN = "<a href='javascript:void(0)' id='"+bn+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></a>",
bS ="<a href='javascript:void(0)' id='sData' class='fm-button ui-state-default ui-corner-all'>"+p.bSubmit+"</a>",
bC ="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+p.bCancel+"</a>";
var bt = "<table border='0' cellspacing='0' cellpadding='0' class='EditTable' id='"+frmtb+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr id='Act_Buttons'><td class='navButton'>"+(rtlb ? bN+bP : bP+bN)+"</td><td class='EditButton'>"+bS+bC+"</td></tr>";
bt += "<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>"+rp_ge.bottominfo+"</td></tr>";
bt += "</tbody></table>";
if(maxRows > 0) {
var sd=[];
$.each($(tbl)[0].rows,function(i,r){
sd[i] = r;
});
sd.sort(function(a,b){
if(a.rp > b.rp) {return 1;}
if(a.rp < b.rp) {return -1;}
return 0;
});
$.each(sd, function(index, row) {
$('tbody',tbl).append(row);
});
}
p.gbox = "#gbox_"+gID;
var cle = false;
if(p.closeOnEscape===true){
p.closeOnEscape = false;
cle = true;
}
var tms = $("<span></span>").append(frm).append(bt);
$.jgrid.createModal(IDs,tms,p,"#gview_"+$t.p.id,$("#gbox_"+$t.p.id)[0]);
if(rtlb) {
$("#pData, #nData","#"+frmtb+"_2").css("float","right");
$(".EditButton","#"+frmtb+"_2").css("text-align","left");
}
if(rp_ge.topinfo) { $(".tinfo","#"+frmtb+"_2").show(); }
if(rp_ge.bottominfo) { $(".binfo","#"+frmtb+"_2").show(); }
tms = null; bt=null;
$("#"+IDs.themodal).keydown( function( e ) {
var wkey = e.target;
if ($("#"+frmgr).data("disabled")===true ) { return false; }//??
if(rp_ge.savekey[0] === true && e.which == rp_ge.savekey[1]) { // save
if(wkey.tagName != "TEXTAREA") {
$("#sData", "#"+frmtb+"_2").trigger("click");
return false;
}
}
if(e.which === 27) {
if(!checkUpdates()) { return false; }
if(cle) { $.jgrid.hideModal(this,{gb:p.gbox,jqm:p.jqModal, onClose: rp_ge.onClose}); }
return false;
}
if(rp_ge.navkeys[0]===true) {
if($("#id_g","#"+frmtb).val() == "_empty") { return true; }
if(e.which == rp_ge.navkeys[1]){ //up
$("#pData", "#"+frmtb+"_2").trigger("click");
return false;
}
if(e.which == rp_ge.navkeys[2]){ //down
$("#nData", "#"+frmtb+"_2").trigger("click");
return false;
}
}
});
if(p.checkOnUpdate) {
$("a.ui-jqdialog-titlebar-close span","#"+IDs.themodal).removeClass("jqmClose");
$("a.ui-jqdialog-titlebar-close","#"+IDs.themodal).unbind("click")
.click(function(){
if(!checkUpdates()) { return false; }
$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal,onClose: rp_ge.onClose});
return false;
});
}
p.saveicon = $.extend([true,"left","ui-icon-disk"],p.saveicon);
p.closeicon = $.extend([true,"left","ui-icon-close"],p.closeicon);
// beforeinitdata after creation of the form
if(p.saveicon[0]===true) {
$("#sData","#"+frmtb+"_2").addClass(p.saveicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
.append("<span class='ui-icon "+p.saveicon[2]+"'></span>");
}
if(p.closeicon[0]===true) {
$("#cData","#"+frmtb+"_2").addClass(p.closeicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
.append("<span class='ui-icon "+p.closeicon[2]+"'></span>");
}
if(rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) {
bS ="<a href='javascript:void(0)' id='sNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+p.bYes+"</a>";
bN ="<a href='javascript:void(0)' id='nNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+p.bNo+"</a>";
bC ="<a href='javascript:void(0)' id='cNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+p.bExit+"</a>";
var ii, zI = p.zIndex || 999; zI ++;
if ($.browser.msie && $.browser.version ==6) {
ii = '<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>';
} else { ii="";}
$("<div class='ui-widget-overlay jqgrid-overlay confirm' style='z-index:"+zI+";display:none;'> "+ii+"</div><div class='confirm ui-widget-content ui-jqconfirm' style='z-index:"+(zI+1)+"'>"+p.saveData+"<br/><br/>"+bS+bN+bC+"</div>").insertAfter("#"+frmgr);
$("#sNew","#"+IDs.themodal).click(function(){
postIt();
$("#"+frmgr).data("disabled",false);
$(".confirm","#"+IDs.themodal).hide();
return false;
});
$("#nNew","#"+IDs.themodal).click(function(){
$(".confirm","#"+IDs.themodal).hide();
$("#"+frmgr).data("disabled",false);
setTimeout(function(){$(":input","#"+frmgr)[0].focus();},0);
return false;
});
$("#cNew","#"+IDs.themodal).click(function(){
$(".confirm","#"+IDs.themodal).hide();
$("#"+frmgr).data("disabled",false);
$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal,onClose: rp_ge.onClose});
return false;
});
}
// here initform - only once
if(onInitializeForm) { onInitializeForm($("#"+frmgr)); }
if(rowid=="_empty" || !rp_ge.viewPagerButtons) { $("#pData,#nData","#"+frmtb+"_2").hide(); } else { $("#pData,#nData","#"+frmtb+"_2").show(); }
if(onBeforeShow) { onBeforeShow($("#"+frmgr)); }
$("#"+IDs.themodal).data("onClose",rp_ge.onClose);
$.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, overlay: p.overlay,modal:p.modal});
if(!closeovrl) {
$(".jqmOverlay").click(function(){
if(!checkUpdates()) { return false; }
$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: rp_ge.onClose});
return false;
});
}
if(onAfterShow) { onAfterShow($("#"+frmgr)); }
$(".fm-button","#"+IDs.themodal).hover(
function(){$(this).addClass('ui-state-hover');},
function(){$(this).removeClass('ui-state-hover');}
);
$("#sData", "#"+frmtb+"_2").click(function(e){
postdata = {}; extpost={};
$("#FormError","#"+frmtb).hide();
// all depend on ret array
//ret[0] - succes
//ret[1] - msg if not succes
//ret[2] - the id that will be set if reload after submit false
getFormData();
setNulls();
if(postdata[$t.p.id+"_id"] == "_empty") { postIt(); }
else if(p.checkOnSubmit===true ) {
newData = $.extend({},postdata,extpost);
diff = compareData(newData,rp_ge._savedData);
if(diff) {
$("#"+frmgr).data("disabled",true);
$(".confirm","#"+IDs.themodal).show();
} else {
postIt();
}
} else {
postIt();
}
return false;
});
$("#cData", "#"+frmtb+"_2").click(function(e){
if(!checkUpdates()) { return false; }
$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal,onClose: rp_ge.onClose});
return false;
});
$("#nData", "#"+frmtb+"_2").click(function(e){
if(!checkUpdates()) { return false; }
$("#FormError","#"+frmtb).hide();
var npos = getCurrPos();
npos[0] = parseInt(npos[0],10);
if(npos[0] != -1 && npos[1][npos[0]+1]) {
if($.isFunction(p.onclickPgButtons)) {
p.onclickPgButtons('next',$("#"+frmgr),npos[1][npos[0]]);
}
fillData(npos[1][npos[0]+1],$t,frmgr);
$($t).jqGrid("setSelection",npos[1][npos[0]+1]);
if($.isFunction(p.afterclickPgButtons)) {
p.afterclickPgButtons('next',$("#"+frmgr),npos[1][npos[0]+1]);
}
updateNav(npos[0]+1,npos[1].length-1);
}
return false;
});
$("#pData", "#"+frmtb+"_2").click(function(e){
if(!checkUpdates()) { return false; }
$("#FormError","#"+frmtb).hide();
var ppos = getCurrPos();
if(ppos[0] != -1 && ppos[1][ppos[0]-1]) {
if($.isFunction(p.onclickPgButtons)) {
p.onclickPgButtons('prev',$("#"+frmgr),ppos[1][ppos[0]]);
}
fillData(ppos[1][ppos[0]-1],$t,frmgr);
$($t).jqGrid("setSelection",ppos[1][ppos[0]-1]);
if($.isFunction(p.afterclickPgButtons)) {
p.afterclickPgButtons('prev',$("#"+frmgr),ppos[1][ppos[0]-1]);
}
updateNav(ppos[0]-1,ppos[1].length-1);
}
return false;
});
}
var posInit =getCurrPos();
updateNav(posInit[0],posInit[1].length-1);
});
},
viewGridRow : function(rowid, p){
p = $.extend({
top : 0,
left: 0,
width: 0,
height: 'auto',
dataheight: 'auto',
modal: false,
overlay: 10,
drag: true,
resize: true,
jqModal: true,
closeOnEscape : false,
labelswidth: '30%',
closeicon: [],
navkeys: [false,38,40],
onClose: null,
beforeShowForm : null,
beforeInitData : null,
viewPagerButtons : true
}, $.jgrid.view, p || {});
return this.each(function(){
var $t = this;
if (!$t.grid || !rowid) { return; }
if(!p.imgpath) { p.imgpath= $t.p.imgpath; }
// I hate to rewrite code, but ...
var gID = $t.p.id,
frmgr = "ViewGrid_"+gID , frmtb = "ViewTbl_"+gID,
IDs = {themodal:'viewmod'+gID,modalhead:'viewhd'+gID,modalcontent:'viewcnt'+gID, scrollelm : frmgr},
onBeforeInit = $.isFunction(p.beforeInitData) ? p.beforeInitData : false,
showFrm = true,
maxCols = 1, maxRows=0;
function focusaref(){ //Sfari 3 issues
if(p.closeOnEscape===true || p.navkeys[0]===true) {
setTimeout(function(){$(".ui-jqdialog-titlebar-close","#"+IDs.modalhead).focus();},0);
}
}
function createData(rowid,obj,tb,maxcols){
var nm, hc,trdata, cnt=0,tmp, dc, retpos=[], ind=false,
tdtmpl = "<td class='CaptionTD form-view-label ui-widget-content' width='"+p.labelswidth+"'> </td><td class='DataTD form-view-data ui-helper-reset ui-widget-content'> </td>", tmpl="",
tdtmpl2 = "<td class='CaptionTD form-view-label ui-widget-content'> </td><td class='DataTD form-view-data ui-widget-content'> </td>",
fmtnum = ['integer','number','currency'],max1 =0, max2=0 ,maxw,setme, viewfld;
for (var i =1;i<=maxcols;i++) {
tmpl += i == 1 ? tdtmpl : tdtmpl2;
}
// find max number align rigth with property formatter
$(obj.p.colModel).each( function(i) {
if(this.editrules && this.editrules.edithidden === true) {
hc = false;
} else {
hc = this.hidden === true ? true : false;
}
if(!hc && this.align==='right') {
if(this.formatter && $.inArray(this.formatter,fmtnum) !== -1 ) {
max1 = Math.max(max1,parseInt(this.width,10));
} else {
max2 = Math.max(max2,parseInt(this.width,10));
}
}
});
maxw = max1 !==0 ? max1 : max2 !==0 ? max2 : 0;
ind = $(obj).jqGrid("getInd",rowid);
$(obj.p.colModel).each( function(i) {
nm = this.name;
setme = false;
// hidden fields are included in the form
if(this.editrules && this.editrules.edithidden === true) {
hc = false;
} else {
hc = this.hidden === true ? true : false;
}
dc = hc ? "style='display:none'" : "";
viewfld = (typeof this.viewable != 'boolean') ? true : this.viewable;
if ( nm !== 'cb' && nm !== 'subgrid' && nm !== 'rn' && viewfld) {
if(ind === false) {
tmp = "";
} else {
if(nm == obj.p.ExpandColumn && obj.p.treeGrid === true) {
tmp = $("td:eq("+i+")",obj.rows[ind]).text();
} else {
tmp = $("td:eq("+i+")",obj.rows[ind]).html();
}
}
setme = this.align === 'right' && maxw !==0 ? true : false;
var opt = $.extend({}, this.editoptions || {} ,{id:nm,name:nm}),
frmopt = $.extend({},{rowabove:false,rowcontent:''}, this.formoptions || {}),
rp = parseInt(frmopt.rowpos,10) || cnt+1,
cp = parseInt((parseInt(frmopt.colpos,10) || 1)*2,10);
if(frmopt.rowabove) {
var newdata = $("<tr><td class='contentinfo' colspan='"+(maxcols*2)+"'>"+frmopt.rowcontent+"</td></tr>");
$(tb).append(newdata);
newdata[0].rp = rp;
}
trdata = $(tb).find("tr[rowpos="+rp+"]");
if ( trdata.length===0 ) {
trdata = $("<tr "+dc+" rowpos='"+rp+"'></tr>").addClass("FormData").attr("id","trv_"+nm);
$(trdata).append(tmpl);
$(tb).append(trdata);
trdata[0].rp = rp;
}
$("td:eq("+(cp-2)+")",trdata[0]).html('<b>'+ (typeof frmopt.label === 'undefined' ? obj.p.colNames[i]: frmopt.label)+'</b>');
$("td:eq("+(cp-1)+")",trdata[0]).append("<span>"+tmp+"</span>").attr("id","v_"+nm);
if(setme){
$("td:eq("+(cp-1)+") span",trdata[0]).css({'text-align':'right',width:maxw+"px"});
}
retpos[cnt] = i;
cnt++;
}
});
if( cnt > 0) {
var idrow = $("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+ (maxcols*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='id' value='"+rowid+"'/></td></tr>");
idrow[0].rp = cnt+99;
$(tb).append(idrow);
}
return retpos;
}
function fillData(rowid,obj){
var nm, hc,cnt=0,tmp, opt,trv;
trv = $(obj).jqGrid("getInd",rowid,true);
if(!trv) { return; }
$('td',trv).each( function(i) {
nm = obj.p.colModel[i].name;
// hidden fields are included in the form
if(obj.p.colModel[i].editrules && obj.p.colModel[i].editrules.edithidden === true) {
hc = false;
} else {
hc = obj.p.colModel[i].hidden === true ? true : false;
}
if ( nm !== 'cb' && nm !== 'subgrid' && nm !== 'rn') {
if(nm == obj.p.ExpandColumn && obj.p.treeGrid === true) {
tmp = $(this).text();
} else {
tmp = $(this).html();
}
opt = $.extend({},obj.p.colModel[i].editoptions || {});
nm = $.jgrid.jqID("v_"+nm);
$("#"+nm+" span","#"+frmtb).html(tmp);
if (hc) { $("#"+nm,"#"+frmtb).parents("tr:first").hide(); }
cnt++;
}
});
if(cnt>0) { $("#id_g","#"+frmtb).val(rowid); }
}
function updateNav(cr,totr){
if (cr===0) { $("#pData","#"+frmtb+"_2").addClass('ui-state-disabled'); } else { $("#pData","#"+frmtb+"_2").removeClass('ui-state-disabled'); }
if (cr==totr) { $("#nData","#"+frmtb+"_2").addClass('ui-state-disabled'); } else { $("#nData","#"+frmtb+"_2").removeClass('ui-state-disabled'); }
}
function getCurrPos() {
var rowsInGrid = $($t).jqGrid("getDataIDs"),
selrow = $("#id_g","#"+frmtb).val(),
pos = $.inArray(selrow,rowsInGrid);
return [pos,rowsInGrid];
}
if ( $("#"+IDs.themodal).html() !== null ) {
if(onBeforeInit) {
showFrm = onBeforeInit($("#"+frmgr));
if(typeof(showFrm) == "undefined") {
showFrm = true;
}
}
if(showFrm === false) { return; }
$(".ui-jqdialog-title","#"+IDs.modalhead).html(p.caption);
$("#FormError","#"+frmtb).hide();
fillData(rowid,$t);
if($.isFunction(p.beforeShowForm)) { p.beforeShowForm($("#"+frmgr)); }
$.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, jqM: false, overlay: p.overlay, modal:p.modal});
focusaref();
} else {
var dh = isNaN(p.dataheight) ? p.dataheight : p.dataheight+"px";
var frm = $("<form name='FormPost' id='"+frmgr+"' class='FormGrid' style='width:100%;overflow:auto;position:relative;height:"+dh+";'></form>"),
tbl =$("<table id='"+frmtb+"' class='EditTable' cellspacing='1' cellpadding='2' border='0' style='table-layout:fixed'><tbody></tbody></table>");
if(onBeforeInit) {
showFrm = onBeforeInit($("#"+frmgr));
if(typeof(showFrm) == "undefined") {
showFrm = true;
}
}
if(showFrm === false) { return; }
$($t.p.colModel).each( function(i) {
var fmto = this.formoptions;
maxCols = Math.max(maxCols, fmto ? fmto.colpos || 0 : 0 );
maxRows = Math.max(maxRows, fmto ? fmto.rowpos || 0 : 0 );
});
// set the id.
$(frm).append(tbl);
createData(rowid, $t, tbl, maxCols);
var rtlb = $t.p.direction == "rtl" ? true :false,
bp = rtlb ? "nData" : "pData",
bn = rtlb ? "pData" : "nData",
// buttons at footer
bP = "<a href='javascript:void(0)' id='"+bp+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></a>",
bN = "<a href='javascript:void(0)' id='"+bn+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></a>",
bC ="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+p.bClose+"</a>";
if(maxRows > 0) {
var sd=[];
$.each($(tbl)[0].rows,function(i,r){
sd[i] = r;
});
sd.sort(function(a,b){
if(a.rp > b.rp) {return 1;}
if(a.rp < b.rp) {return -1;}
return 0;
});
$.each(sd, function(index, row) {
$('tbody',tbl).append(row);
});
}
p.gbox = "#gbox_"+gID;
var cle = false;
if(p.closeOnEscape===true){
p.closeOnEscape = false;
cle = true;
}
var bt = $("<span></span>").append(frm).append("<table border='0' class='EditTable' id='"+frmtb+"_2'><tbody><tr id='Act_Buttons'><td class='navButton' width='"+p.labelswidth+"'>"+(rtlb ? bN+bP : bP+bN)+"</td><td class='EditButton'>"+bC+"</td></tr></tbody></table>");
$.jgrid.createModal(IDs,bt,p,"#gview_"+$t.p.id,$("#gview_"+$t.p.id)[0]);
if(rtlb) {
$("#pData, #nData","#"+frmtb+"_2").css("float","right");
$(".EditButton","#"+frmtb+"_2").css("text-align","left");
}
if(!p.viewPagerButtons) { $("#pData, #nData","#"+frmtb+"_2").hide(); }
bt = null;
$("#"+IDs.themodal).keydown( function( e ) {
if(e.which === 27) {
if(cle) { $.jgrid.hideModal(this,{gb:p.gbox,jqm:p.jqModal, onClose: p.onClose}); }
return false;
}
if(p.navkeys[0]===true) {
if(e.which === p.navkeys[1]){ //up
$("#pData", "#"+frmtb+"_2").trigger("click");
return false;
}
if(e.which === p.navkeys[2]){ //down
$("#nData", "#"+frmtb+"_2").trigger("click");
return false;
}
}
});
p.closeicon = $.extend([true,"left","ui-icon-close"],p.closeicon);
if(p.closeicon[0]===true) {
$("#cData","#"+frmtb+"_2").addClass(p.closeicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
.append("<span class='ui-icon "+p.closeicon[2]+"'></span>");
}
if($.isFunction(p.beforeShowForm)) { p.beforeShowForm($("#"+frmgr)); }
$.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, modal:p.modal});
$(".fm-button:not(.ui-state-disabled)","#"+frmtb+"_2").hover(
function(){$(this).addClass('ui-state-hover');},
function(){$(this).removeClass('ui-state-hover');}
);
focusaref();
$("#cData", "#"+frmtb+"_2").click(function(e){
$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: p.onClose});
return false;
});
$("#nData", "#"+frmtb+"_2").click(function(e){
$("#FormError","#"+frmtb).hide();
var npos = getCurrPos();
npos[0] = parseInt(npos[0],10);
if(npos[0] != -1 && npos[1][npos[0]+1]) {
if($.isFunction(p.onclickPgButtons)) {
p.onclickPgButtons('next',$("#"+frmgr),npos[1][npos[0]]);
}
fillData(npos[1][npos[0]+1],$t);
$($t).jqGrid("setSelection",npos[1][npos[0]+1]);
if($.isFunction(p.afterclickPgButtons)) {
p.afterclickPgButtons('next',$("#"+frmgr),npos[1][npos[0]+1]);
}
updateNav(npos[0]+1,npos[1].length-1);
}
focusaref();
return false;
});
$("#pData", "#"+frmtb+"_2").click(function(e){
$("#FormError","#"+frmtb).hide();
var ppos = getCurrPos();
if(ppos[0] != -1 && ppos[1][ppos[0]-1]) {
if($.isFunction(p.onclickPgButtons)) {
p.onclickPgButtons('prev',$("#"+frmgr),ppos[1][ppos[0]]);
}
fillData(ppos[1][ppos[0]-1],$t);
$($t).jqGrid("setSelection",ppos[1][ppos[0]-1]);
if($.isFunction(p.afterclickPgButtons)) {
p.afterclickPgButtons('prev',$("#"+frmgr),ppos[1][ppos[0]-1]);
}
updateNav(ppos[0]-1,ppos[1].length-1);
}
focusaref();
return false;
});
}
var posInit =getCurrPos();
updateNav(posInit[0],posInit[1].length-1);
});
},
delGridRow : function(rowids,p) {
p = $.extend({
top : 0,
left: 0,
width: 240,
height: 'auto',
dataheight : 'auto',
modal: false,
overlay: 10,
drag: true,
resize: true,
url : '',
mtype : "POST",
reloadAfterSubmit: true,
beforeShowForm: null,
beforeInitData : null,
afterShowForm: null,
beforeSubmit: null,
onclickSubmit: null,
afterSubmit: null,
jqModal : true,
closeOnEscape : false,
delData: {},
delicon : [],
cancelicon : [],
onClose : null,
ajaxDelOptions : {},
processing : false,
serializeDelData : null,
useDataProxy : false
}, $.jgrid.del, p ||{});
var rp_ge = p;
return this.each(function(){
var $t = this;
if (!$t.grid ) { return; }
if(!rowids) { return; }
var onBeforeShow = $.isFunction( p.beforeShowForm ),
onAfterShow = $.isFunction( p.afterShowForm ),
onBeforeInit = $.isFunction(p.beforeInitData) ? p.beforeInitData : false,
gID = $t.p.id, onCS = {},
showFrm = true,
dtbl = "DelTbl_"+gID,postd, idname, opers, oper,
IDs = {themodal:'delmod'+gID,modalhead:'delhd'+gID,modalcontent:'delcnt'+gID, scrollelm: dtbl};
if (jQuery.isArray(rowids)) { rowids = rowids.join(); }
if ( $("#"+IDs.themodal).html() !== null ) {
if(onBeforeInit) {
showFrm = onBeforeInit( $("#"+dtbl));
if(typeof(showFrm) == "undefined") {
showFrm = true;
}
}
if(showFrm === false) { return; }
$("#DelData>td","#"+dtbl).text(rowids);
$("#DelError","#"+dtbl).hide();
if( rp_ge.processing === true) {
rp_ge.processing=false;
$("#dData", "#"+dtbl).removeClass('ui-state-active');
}
if(onBeforeShow) { p.beforeShowForm($("#"+dtbl)); }
$.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal,jqM: false, overlay: p.overlay, modal:p.modal});
if(onAfterShow) { p.afterShowForm($("#"+dtbl)); }
} else {
var dh = isNaN(p.dataheight) ? p.dataheight : p.dataheight+"px";
var tbl = "<div id='"+dtbl+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+dh+";'>";
tbl += "<table class='DelTable'><tbody>";
// error data
tbl += "<tr id='DelError' style='display:none'><td class='ui-state-error'></td></tr>";
tbl += "<tr id='DelData' style='display:none'><td >"+rowids+"</td></tr>";
tbl += "<tr><td class=\"delmsg\" style=\"white-space:pre;\">"+p.msg+"</td></tr><tr><td > </td></tr>";
// buttons at footer
tbl += "</tbody></table></div>";
var bS = "<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+p.bSubmit+"</a>",
bC = "<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+p.bCancel+"</a>";
tbl += "<table cellspacing='0' cellpadding='0' border='0' class='EditTable' id='"+dtbl+"_2'><tbody><tr><td><hr class='ui-widget-content' style='margin:1px'/></td></tr></tr><tr><td class='DelButton EditButton'>"+bS+" "+bC+"</td></tr></tbody></table>";
p.gbox = "#gbox_"+gID;
$.jgrid.createModal(IDs,tbl,p,"#gview_"+$t.p.id,$("#gview_"+$t.p.id)[0]);
if(onBeforeInit) {
showFrm = onBeforeInit( $("#"+dtbl) );
if(typeof(showFrm) == "undefined") {
showFrm = true;
}
}
if(showFrm === false) { return; }
$(".fm-button","#"+dtbl+"_2").hover(
function(){$(this).addClass('ui-state-hover');},
function(){$(this).removeClass('ui-state-hover');}
);
p.delicon = $.extend([true,"left","ui-icon-scissors"],p.delicon);
p.cancelicon = $.extend([true,"left","ui-icon-cancel"],p.cancelicon);
if(p.delicon[0]===true) {
$("#dData","#"+dtbl+"_2").addClass(p.delicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
.append("<span class='ui-icon "+p.delicon[2]+"'></span>");
}
if(p.cancelicon[0]===true) {
$("#eData","#"+dtbl+"_2").addClass(p.cancelicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
.append("<span class='ui-icon "+p.cancelicon[2]+"'></span>");
}
$("#dData","#"+dtbl+"_2").click(function(e){
var ret=[true,""]; onCS = {};
var postdata = $("#DelData>td","#"+dtbl).text(); //the pair is name=val1,val2,...
if( $.isFunction( p.onclickSubmit ) ) { onCS = p.onclickSubmit(rp_ge, postdata) || {}; }
if( $.isFunction( p.beforeSubmit ) ) { ret = p.beforeSubmit(postdata); }
if(ret[0] && !rp_ge.processing) {
rp_ge.processing = true;
$(this).addClass('ui-state-active');
opers = $t.p.prmNames;
postd = $.extend({},rp_ge.delData, onCS);
oper = opers.oper;
postd[oper] = opers.deloper;
idname = opers.id;
postd[idname] = postdata;
var ajaxOptions = $.extend({
url: rp_ge.url ? rp_ge.url : $($t).jqGrid('getGridParam','editurl'),
type: p.mtype,
data: $.isFunction(p.serializeDelData) ? p.serializeDelData(postd) : postd,
complete:function(data,Status){
if(Status != "success") {
ret[0] = false;
if ($.isFunction(rp_ge.errorTextFormat)) {
ret[1] = rp_ge.errorTextFormat(data);
} else {
ret[1] = Status + " Status: '" + data.statusText + "'. Error code: " + data.status;
}
} else {
// data is posted successful
// execute aftersubmit with the returned data from server
if( $.isFunction( rp_ge.afterSubmit ) ) {
ret = rp_ge.afterSubmit(data,postd);
}
}
if(ret[0] === false) {
$("#DelError>td","#"+dtbl).html(ret[1]);
$("#DelError","#"+dtbl).show();
} else {
if(rp_ge.reloadAfterSubmit && $t.p.datatype != "local") {
$($t).trigger("reloadGrid");
} else {
var toarr = [];
toarr = postdata.split(",");
if($t.p.treeGrid===true){
try {$($t).jqGrid("delTreeNode",toarr[0]);} catch(e){}
} else {
for(var i=0;i<toarr.length;i++) {
$($t).jqGrid("delRowData",toarr[i]);
}
}
$t.p.selrow = null;
$t.p.selarrrow = [];
}
if($.isFunction(rp_ge.afterComplete)) {
setTimeout(function(){rp_ge.afterComplete(data,postdata);},500);
}
}
rp_ge.processing=false;
$("#dData", "#"+dtbl+"_2").removeClass('ui-state-active');
if(ret[0]) { $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: rp_ge.onClose}); }
}
}, $.jgrid.ajaxOptions, p.ajaxDelOptions);
if (!ajaxOptions.url && !rp_ge.useDataProxy) {
if ($.isFunction($t.p.dataProxy)) {
rp_ge.useDataProxy = true;
} else {
ret[0]=false; ret[1] += " "+$.jgrid.errors.nourl;
}
}
if (ret[0]) {
if (rp_ge.useDataProxy) { $t.p.dataProxy.call($t, ajaxOptions, "del_"+$t.p.id); }
else { $.ajax(ajaxOptions); }
}
}
if(ret[0] === false) {
$("#DelError>td","#"+dtbl).html(ret[1]);
$("#DelError","#"+dtbl).show();
}
return false;
});
$("#eData", "#"+dtbl+"_2").click(function(e){
$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: rp_ge.onClose});
return false;
});
if(onBeforeShow) { p.beforeShowForm($("#"+dtbl)); }
$.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, overlay: p.overlay, modal:p.modal});
if(onAfterShow) { p.afterShowForm($("#"+dtbl)); }
}
if(p.closeOnEscape===true) {
setTimeout(function(){$(".ui-jqdialog-titlebar-close","#"+IDs.modalhead).focus();},0);
}
});
},
navGrid : function (elem, o, pEdit,pAdd,pDel,pSearch, pView) {
o = $.extend({
edit: true,
editicon: "ui-icon-pencil",
add: true,
addicon:"ui-icon-plus",
del: true,
delicon:"ui-icon-trash",
search: true,
searchicon:"ui-icon-search",
refresh: true,
refreshicon:"ui-icon-refresh",
refreshstate: 'firstpage',
view: false,
viewicon : "ui-icon-document",
position : "left",
closeOnEscape : true,
beforeRefresh : null,
afterRefresh : null,
cloneToTop : false
}, $.jgrid.nav, o ||{});
return this.each(function() {
if(this.nav) { return; }
var alertIDs = {themodal:'alertmod',modalhead:'alerthd',modalcontent:'alertcnt'},
$t = this, vwidth, vheight, twd, tdw;
if(!$t.grid || typeof elem != 'string') { return; }
if ($("#"+alertIDs.themodal).html() === null) {
if (typeof window.innerWidth != 'undefined') {
vwidth = window.innerWidth;
vheight = window.innerHeight;
} else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth !== 0) {
vwidth = document.documentElement.clientWidth;
vheight = document.documentElement.clientHeight;
} else {
vwidth=1024;
vheight=768;
}
$.jgrid.createModal(alertIDs,"<div>"+o.alerttext+"</div><span tabindex='0'><span tabindex='-1' id='jqg_alrt'></span></span>",{gbox:"#gbox_"+$t.p.id,jqModal:true,drag:true,resize:true,caption:o.alertcap,top:vheight/2-25,left:vwidth/2-100,width:200,height:'auto',closeOnEscape:o.closeOnEscape},"","",true);
}
var clone = 1;
if(o.cloneToTop && $t.p.toppager) { clone = 2; }
for(var i = 0; i<clone; i++) {
var tbd,
navtbl = $("<table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table navtable' style='float:left;table-layout:auto;'><tbody><tr></tr></tbody></table>"),
sep = "<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>",
pgid, elemids;
if(i===0) {
pgid = elem;
elemids = $t.p.id;
if(pgid == $t.p.toppager) {
elemids += "_top";
clone = 1;
}
} else {
pgid = $t.p.toppager;
elemids = $t.p.id+"_top";
}
if($t.p.direction == "rtl") { $(navtbl).attr("dir","rtl").css("float","right"); }
if (o.add) {
pAdd = pAdd || {};
tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
$(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.addicon+"'></span>"+o.addtext+"</div>");
$("tr",navtbl).append(tbd);
$(tbd,navtbl)
.attr({"title":o.addtitle || "",id : pAdd.id || "add_"+elemids})
.click(function(){
if (!$(this).hasClass('ui-state-disabled')) {
if ($.isFunction( o.addfunc )) {
o.addfunc();
} else {
$($t).jqGrid("editGridRow","new",pAdd);
}
}
return false;
}).hover(
function () {
if (!$(this).hasClass('ui-state-disabled')) {
$(this).addClass("ui-state-hover");
}
},
function () {$(this).removeClass("ui-state-hover");}
);
tbd = null;
}
if (o.edit) {
tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
pEdit = pEdit || {};
$(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.editicon+"'></span>"+o.edittext+"</div>");
$("tr",navtbl).append(tbd);
$(tbd,navtbl)
.attr({"title":o.edittitle || "",id: pEdit.id || "edit_"+elemids})
.click(function(){
if (!$(this).hasClass('ui-state-disabled')) {
var sr = $t.p.selrow;
if (sr) {
if($.isFunction( o.editfunc ) ) {
o.editfunc(sr);
} else {
$($t).jqGrid("editGridRow",sr,pEdit);
}
} else {
$.jgrid.viewModal("#"+alertIDs.themodal,{gbox:"#gbox_"+$t.p.id,jqm:true});
$("#jqg_alrt").focus();
}
}
return false;
}).hover(
function () {
if (!$(this).hasClass('ui-state-disabled')) {
$(this).addClass("ui-state-hover");
}
},
function () {$(this).removeClass("ui-state-hover");}
);
tbd = null;
}
if (o.view) {
tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
pView = pView || {};
$(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.viewicon+"'></span>"+o.viewtext+"</div>");
$("tr",navtbl).append(tbd);
$(tbd,navtbl)
.attr({"title":o.viewtitle || "",id: pView.id || "view_"+elemids})
.click(function(){
if (!$(this).hasClass('ui-state-disabled')) {
var sr = $t.p.selrow;
if (sr) {
if($.isFunction( o.viewfunc ) ) {
o.viewfunc(sr);
} else {
$($t).jqGrid("viewGridRow",sr,pView);
}
} else {
$.jgrid.viewModal("#"+alertIDs.themodal,{gbox:"#gbox_"+$t.p.id,jqm:true});
$("#jqg_alrt").focus();
}
}
return false;
}).hover(
function () {
if (!$(this).hasClass('ui-state-disabled')) {
$(this).addClass("ui-state-hover");
}
},
function () {$(this).removeClass("ui-state-hover");}
);
tbd = null;
}
if (o.del) {
tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
pDel = pDel || {};
$(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.delicon+"'></span>"+o.deltext+"</div>");
$("tr",navtbl).append(tbd);
$(tbd,navtbl)
.attr({"title":o.deltitle || "",id: pDel.id || "del_"+elemids})
.click(function(){
if (!$(this).hasClass('ui-state-disabled')) {
var dr;
if($t.p.multiselect) {
dr = $t.p.selarrrow;
if(dr.length===0) { dr = null; }
} else {
dr = $t.p.selrow;
}
if(dr){
if("function" == typeof o.delfunc){
o.delfunc(dr);
}else{
$($t).jqGrid("delGridRow",dr,pDel);
}
} else {
$.jgrid.viewModal("#"+alertIDs.themodal,{gbox:"#gbox_"+$t.p.id,jqm:true}); $("#jqg_alrt").focus();
}
}
return false;
}).hover(
function () {
if (!$(this).hasClass('ui-state-disabled')) {
$(this).addClass("ui-state-hover");
}
},
function () {$(this).removeClass("ui-state-hover");}
);
tbd = null;
}
if(o.add || o.edit || o.del || o.view) { $("tr",navtbl).append(sep); }
if (o.search) {
tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
pSearch = pSearch || {};
$(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.searchicon+"'></span>"+o.searchtext+"</div>");
$("tr",navtbl).append(tbd);
$(tbd,navtbl)
.attr({"title":o.searchtitle || "",id:pSearch.id || "search_"+elemids})
.click(function(){
if (!$(this).hasClass('ui-state-disabled')) {
$($t).jqGrid("searchGrid",pSearch);
}
return false;
}).hover(
function () {
if (!$(this).hasClass('ui-state-disabled')) {
$(this).addClass("ui-state-hover");
}
},
function () {$(this).removeClass("ui-state-hover");}
);
if (pSearch.showOnLoad && pSearch.showOnLoad === true)
$(tbd,navtbl).click();
tbd = null;
}
if (o.refresh) {
tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
$(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.refreshicon+"'></span>"+o.refreshtext+"</div>");
$("tr",navtbl).append(tbd);
$(tbd,navtbl)
.attr({"title":o.refreshtitle || "",id: "refresh_"+elemids})
.click(function(){
if (!$(this).hasClass('ui-state-disabled')) {
if($.isFunction(o.beforeRefresh)) { o.beforeRefresh(); }
$t.p.search = false;
try {
var gID = $t.p.id;
$t.p.postData.filters ="";
$("#fbox_"+gID).jqFilter('resetFilter');
if($.isFunction($t.clearToolbar)) { $t.clearToolbar(false); }
} catch (e) {}
switch (o.refreshstate) {
case 'firstpage':
$($t).trigger("reloadGrid", [{page:1}]);
break;
case 'current':
$($t).trigger("reloadGrid", [{current:true}]);
break;
}
if($.isFunction(o.afterRefresh)) { o.afterRefresh(); }
}
return false;
}).hover(
function () {
if (!$(this).hasClass('ui-state-disabled')) {
$(this).addClass("ui-state-hover");
}
},
function () {$(this).removeClass("ui-state-hover");}
);
tbd = null;
}
tdw = $(".ui-jqgrid").css("font-size") || "11px";
$('body').append("<div id='testpg2' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+tdw+";visibility:hidden;' ></div>");
twd = $(navtbl).clone().appendTo("#testpg2").width();
$("#testpg2").remove();
$(pgid+"_"+o.position,pgid).append(navtbl);
if($t.p._nvtd) {
if(twd > $t.p._nvtd[0] ) {
$(pgid+"_"+o.position,pgid).width(twd);
$t.p._nvtd[0] = twd;
}
$t.p._nvtd[1] = twd;
}
tdw =null; twd=null; navtbl =null;
this.nav = true;
}
});
},
navButtonAdd : function (elem, p) {
p = $.extend({
caption : "newButton",
title: '',
buttonicon : 'ui-icon-newwin',
onClickButton: null,
position : "last",
cursor : 'pointer'
}, p ||{});
return this.each(function() {
if( !this.grid) { return; }
if( elem.indexOf("#") !== 0) { elem = "#"+elem; }
var findnav = $(".navtable",elem)[0], $t = this;
if (findnav) {
if( p.id && $("#"+p.id, findnav).html() !== null ) { return; }
var tbd = $("<td></td>");
if(p.buttonicon.toString().toUpperCase() == "NONE") {
$(tbd).addClass('ui-pg-button ui-corner-all').append("<div class='ui-pg-div'>"+p.caption+"</div>");
} else {
$(tbd).addClass('ui-pg-button ui-corner-all').append("<div class='ui-pg-div'><span class='ui-icon "+p.buttonicon+"'></span>"+p.caption+"</div>");
}
if(p.id) {$(tbd).attr("id",p.id);}
if(p.position=='first'){
if(findnav.rows[0].cells.length ===0 ) {
$("tr",findnav).append(tbd);
} else {
$("tr td:eq(0)",findnav).before(tbd);
}
} else {
$("tr",findnav).append(tbd);
}
$(tbd,findnav)
.attr("title",p.title || "")
.click(function(e){
if (!$(this).hasClass('ui-state-disabled')) {
if ($.isFunction(p.onClickButton) ) { p.onClickButton.call($t,e); }
}
return false;
})
.hover(
function () {
if (!$(this).hasClass('ui-state-disabled')) {
$(this).addClass('ui-state-hover');
}
},
function () {$(this).removeClass("ui-state-hover");}
);
}
});
},
navSeparatorAdd:function (elem,p) {
p = $.extend({
sepclass : "ui-separator",
sepcontent: ''
}, p ||{});
return this.each(function() {
if( !this.grid) { return; }
if( elem.indexOf("#") !== 0) { elem = "#"+elem; }
var findnav = $(".navtable",elem)[0];
if(findnav) {
var sep = "<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='"+p.sepclass+"'></span>"+p.sepcontent+"</td>";
$("tr",findnav).append(sep);
}
});
},
GridToForm : function( rowid, formid ) {
return this.each(function(){
var $t = this;
if (!$t.grid) { return; }
var rowdata = $($t).jqGrid("getRowData",rowid);
if (rowdata) {
for(var i in rowdata) {
if ( $("[name="+$.jgrid.jqID(i)+"]",formid).is("input:radio") || $("[name="+$.jgrid.jqID(i)+"]",formid).is("input:checkbox")) {
$("[name="+$.jgrid.jqID(i)+"]",formid).each( function() {
if( $(this).val() == rowdata[i] ) {
$(this).attr("checked","checked");
} else {
$(this).attr("checked","");
}
});
} else {
// this is very slow on big table and form.
$("[name="+$.jgrid.jqID(i)+"]",formid).val(rowdata[i]);
}
}
}
});
},
FormToGrid : function(rowid, formid, mode, position){
return this.each(function() {
var $t = this;
if(!$t.grid) { return; }
if(!mode) { mode = 'set'; }
if(!position) { position = 'first'; }
var fields = $(formid).serializeArray();
var griddata = {};
$.each(fields, function(i, field){
griddata[field.name] = field.value;
});
if(mode=='add') { $($t).jqGrid("addRowData",rowid,griddata, position); }
else if(mode=='set') { $($t).jqGrid("setRowData",rowid,griddata); }
});
}
});
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/grid.formedit.js | JavaScript | art | 73,483 |
;(function($){
/**
* jqGrid extension for manipulating columns properties
* Piotr Roznicki roznicki@o2.pl
* http://www.roznicki.prv.pl
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl-2.0.html
**/
$.jgrid.extend({
setColumns : function(p) {
p = $.extend({
top : 0,
left: 0,
width: 200,
height: 'auto',
dataheight: 'auto',
modal: false,
drag: true,
beforeShowForm: null,
afterShowForm: null,
afterSubmitForm: null,
closeOnEscape : true,
ShrinkToFit : false,
jqModal : false,
saveicon: [true,"left","ui-icon-disk"],
closeicon: [true,"left","ui-icon-close"],
onClose : null,
colnameview : true,
closeAfterSubmit : true,
updateAfterCheck : false,
recreateForm : false
}, $.jgrid.col, p ||{});
return this.each(function(){
var $t = this;
if (!$t.grid ) { return; }
var onBeforeShow = typeof p.beforeShowForm === 'function' ? true: false;
var onAfterShow = typeof p.afterShowForm === 'function' ? true: false;
var onAfterSubmit = typeof p.afterSubmitForm === 'function' ? true: false;
var gID = $t.p.id,
dtbl = "ColTbl_"+gID,
IDs = {themodal:'colmod'+gID,modalhead:'colhd'+gID,modalcontent:'colcnt'+gID, scrollelm: dtbl};
if(p.recreateForm===true && $("#"+IDs.themodal).html() != null) {
$("#"+IDs.themodal).remove();
}
if ( $("#"+IDs.themodal).html() != null ) {
if(onBeforeShow) { p.beforeShowForm($("#"+dtbl)); }
viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, jqM:false, modal:p.modal});
if(onAfterShow) { p.afterShowForm($("#"+dtbl)); }
} else {
var dh = isNaN(p.dataheight) ? p.dataheight : p.dataheight+"px";
var formdata = "<div id='"+dtbl+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+dh+";'>";
formdata += "<table class='ColTable' cellspacing='1' cellpading='2' border='0'><tbody>";
for(i=0;i<this.p.colNames.length;i++){
if(!$t.p.colModel[i].hidedlg) { // added from T. Tomov
formdata += "<tr><td style='white-space: pre;'><input type='checkbox' style='margin-right:5px;' id='col_" + this.p.colModel[i].name + "' class='cbox' value='T' " +
((this.p.colModel[i].hidden===false)?"checked":"") + "/>" + "<label for='col_" + this.p.colModel[i].name + "'>" + this.p.colNames[i] + ((p.colnameview) ? " (" + this.p.colModel[i].name + ")" : "" )+ "</label></td></tr>";
}
}
formdata += "</tbody></table></div>"
var bS = !p.updateAfterCheck ? "<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+p.bSubmit+"</a>" : "",
bC ="<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+p.bCancel+"</a>";
formdata += "<table border='0' class='EditTable' id='"+dtbl+"_2'><tbody><tr style='display:block;height:3px;'><td></td></tr><tr><td class='DataTD ui-widget-content'></td></tr><tr><td class='ColButton EditButton'>"+bS+" "+bC+"</td></tr></tbody></table>";
p.gbox = "#gbox_"+gID;
createModal(IDs,formdata,p,"#gview_"+$t.p.id,$("#gview_"+$t.p.id)[0]);
if(p.saveicon[0]==true) {
$("#dData","#"+dtbl+"_2").addClass(p.saveicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
.append("<span class='ui-icon "+p.saveicon[2]+"'></span>");
}
if(p.closeicon[0]==true) {
$("#eData","#"+dtbl+"_2").addClass(p.closeicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
.append("<span class='ui-icon "+p.closeicon[2]+"'></span>");
}
if(!p.updateAfterCheck) {
$("#dData","#"+dtbl+"_2").click(function(e){
for(i=0;i<$t.p.colModel.length;i++){
if(!$t.p.colModel[i].hidedlg) { // added from T. Tomov
var nm = $t.p.colModel[i].name.replace(/\./g, "\\.");
if($("#col_" + nm,"#"+dtbl).attr("checked")) {
$($t).jqGrid("showCol",$t.p.colModel[i].name);
$("#col_" + nm,"#"+dtbl).attr("defaultChecked",true); // Added from T. Tomov IE BUG
} else {
$($t).jqGrid("hideCol",$t.p.colModel[i].name);
$("#col_" + nm,"#"+dtbl).attr("defaultChecked",""); // Added from T. Tomov IE BUG
}
}
}
if(p.ShrinkToFit===true) {
$($t).jqGrid("setGridWidth",$t.grid.width-0.001,true);
}
if(p.closeAfterSubmit) hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: p.onClose});
if (onAfterSubmit) { p.afterSubmitForm($("#"+dtbl)); }
return false;
});
} else {
$(":input","#"+dtbl).click(function(e){
var cn = this.id.substr(4);
if(cn){
if(this.checked) {
$($t).jqGrid("showCol",cn);
} else {
$($t).jqGrid("hideCol",cn);
}
if(p.ShrinkToFit===true) {
$($t).jqGrid("setGridWidth",$t.grid.width-0.001,true);
}
}
return this;
});
}
$("#eData", "#"+dtbl+"_2").click(function(e){
hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: p.onClose});
return false;
});
$("#dData, #eData","#"+dtbl+"_2").hover(
function(){$(this).addClass('ui-state-hover');},
function(){$(this).removeClass('ui-state-hover');}
);
if(onBeforeShow) { p.beforeShowForm($("#"+dtbl)); }
viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, jqM: true, modal:p.modal});
if(onAfterShow) { p.afterShowForm($("#"+dtbl)); }
}
});
}
});
})(jQuery); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/grid.setcolumns.js | JavaScript | art | 5,473 |
;(function($){
/**
* jqGrid extension
* Paul Tiseo ptiseo@wasteconsultants.com
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl-2.0.html
**/
$.jgrid.extend({
getPostData : function(){
var $t = this[0];
if(!$t.grid) { return; }
return $t.p.postData;
},
setPostData : function( newdata ) {
var $t = this[0];
if(!$t.grid) { return; }
// check if newdata is correct type
if ( typeof(newdata) === 'object' ) {
$t.p.postData = newdata;
}
else {
alert("Error: cannot add a non-object postData value. postData unchanged.");
}
},
appendPostData : function( newdata ) {
var $t = this[0];
if(!$t.grid) { return; }
// check if newdata is correct type
if ( typeof(newdata) === 'object' ) {
$.extend($t.p.postData, newdata);
}
else {
alert("Error: cannot append a non-object postData value. postData unchanged.");
}
},
setPostDataItem : function( key, val ) {
var $t = this[0];
if(!$t.grid) { return; }
$t.p.postData[key] = val;
},
getPostDataItem : function( key ) {
var $t = this[0];
if(!$t.grid) { return; }
return $t.p.postData[key];
},
removePostDataItem : function( key ) {
var $t = this[0];
if(!$t.grid) { return; }
delete $t.p.postData[key];
},
getUserData : function(){
var $t = this[0];
if(!$t.grid) { return; }
return $t.p.userData;
},
getUserDataItem : function( key ) {
var $t = this[0];
if(!$t.grid) { return; }
return $t.p.userData[key];
}
});
})(jQuery); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/grid.postext.js | JavaScript | art | 1,545 |
;(function($){
/*
* jqGrid common function
* 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-2.0.html
*/
/*global jQuery, $ */
$.extend($.jgrid,{
// Modal functions
showModal : function(h) {
h.w.show();
},
closeModal : function(h) {
h.w.hide().attr("aria-hidden","true");
if(h.o) {h.o.remove();}
},
hideModal : function (selector,o) {
o = $.extend({jqm : true, gb :''}, o || {});
if(o.onClose) {
var oncret = o.onClose(selector);
if (typeof oncret == 'boolean' && !oncret ) { return; }
}
if ($.fn.jqm && o.jqm === true) {
$(selector).attr("aria-hidden","true").jqmHide();
} else {
if(o.gb !== '') {
try {$(".jqgrid-overlay:first",o.gb).hide();} catch (e){}
}
$(selector).hide().attr("aria-hidden","true");
}
},
//Helper functions
findPos : function(obj) {
var curleft = 0, curtop = 0;
if (obj.offsetParent) {
do {
curleft += obj.offsetLeft;
curtop += obj.offsetTop;
} while (obj = obj.offsetParent);
//do not change obj == obj.offsetParent
}
return [curleft,curtop];
},
createModal : function(aIDs, content, p, insertSelector, posSelector, appendsel, css) {
var mw = document.createElement('div'), rtlsup, self = this;
css = $.extend({}, css || {});
rtlsup = $(p.gbox).attr("dir") == "rtl" ? true : false;
mw.className= "ui-widget ui-widget-content ui-corner-all ui-jqdialog";
mw.id = aIDs.themodal;
var mh = document.createElement('div');
mh.className = "ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix";
mh.id = aIDs.modalhead;
$(mh).append("<span class='ui-jqdialog-title'>"+p.caption+"</span>");
var ahr= $("<a href='javascript:void(0)' class='ui-jqdialog-titlebar-close ui-corner-all'></a>")
.hover(function(){ahr.addClass('ui-state-hover');},
function(){ahr.removeClass('ui-state-hover');})
.append("<span class='ui-icon ui-icon-closethick'></span>");
$(mh).append(ahr);
if(rtlsup) {
mw.dir = "rtl";
$(".ui-jqdialog-title",mh).css("float","right");
$(".ui-jqdialog-titlebar-close",mh).css("left",0.3+"em");
} else {
mw.dir = "ltr";
$(".ui-jqdialog-title",mh).css("float","left");
$(".ui-jqdialog-titlebar-close",mh).css("right",0.3+"em");
}
var mc = document.createElement('div');
$(mc).addClass("ui-jqdialog-content ui-widget-content").attr("id",aIDs.modalcontent);
$(mc).append(content);
mw.appendChild(mc);
$(mw).prepend(mh);
if(appendsel===true) { $('body').append(mw); } //append as first child in body -for alert dialog
else if (typeof appendsel == "string")
$(appendsel).append(mw);
else {$(mw).insertBefore(insertSelector);}
$(mw).css(css);
if(typeof p.jqModal === 'undefined') {p.jqModal = true;} // internal use
var coord = {};
if ( $.fn.jqm && p.jqModal === true) {
if(p.left ===0 && p.top===0 && p.overlay) {
var pos = [];
pos = this.findPos(posSelector);
p.left = pos[0] + 4;
p.top = pos[1] + 4;
}
coord.top = p.top+"px";
coord.left = p.left;
} else if(p.left !==0 || p.top!==0) {
coord.left = p.left;
coord.top = p.top+"px";
}
$("a.ui-jqdialog-titlebar-close",mh).click(function(e){
var oncm = $("#"+aIDs.themodal).data("onClose") || p.onClose;
var gboxclose = $("#"+aIDs.themodal).data("gbox") || p.gbox;
self.hideModal("#"+aIDs.themodal,{gb:gboxclose,jqm:p.jqModal,onClose:oncm});
return false;
});
if (p.width === 0 || !p.width) {p.width = 300;}
if(p.height === 0 || !p.height) {p.height =200;}
if(!p.zIndex) {
var parentZ = $(insertSelector).parents("*[role=dialog]").filter(':first').css("z-index");
if(parentZ) {
p.zIndex = parseInt(parentZ,10)+1;
} else {
p.zIndex = 950;
}
}
var rtlt = 0;
if( rtlsup && coord.left && !appendsel) {
rtlt = $(p.gbox).width()- (!isNaN(p.width) ? parseInt(p.width,10) :0) - 8; // to do
// just in case
coord.left = parseInt(coord.left,10) + parseInt(rtlt,10);
}
if(coord.left) { coord.left += "px"; }
$(mw).css($.extend({
width: isNaN(p.width) ? "auto": p.width+"px",
height:isNaN(p.height) ? "auto" : p.height + "px",
zIndex:p.zIndex,
overflow: 'hidden'
},coord))
.attr({tabIndex: "-1","role":"dialog","aria-labelledby":aIDs.modalhead,"aria-hidden":"true"});
if(typeof p.drag == 'undefined') { p.drag=true;}
if(typeof p.resize == 'undefined') {p.resize=true;}
if (p.drag) {
$(mh).css('cursor','move');
if($.fn.jqDrag) {
$(mw).jqDrag(mh);
} else {
try {
$(mw).draggable({handle: $("#"+mh.id)});
} catch (e) {}
}
}
if(p.resize) {
if($.fn.jqResize) {
$(mw).append("<div class='jqResize ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se ui-icon-grip-diagonal-se'></div>");
$("#"+aIDs.themodal).jqResize(".jqResize",aIDs.scrollelm ? "#"+aIDs.scrollelm : false);
} else {
try {
$(mw).resizable({handles: 'se, sw',alsoResize: aIDs.scrollelm ? "#"+aIDs.scrollelm : false});
} catch (r) {}
}
}
if(p.closeOnEscape === true){
$(mw).keydown( function( e ) {
if( e.which == 27 ) {
var cone = $("#"+aIDs.themodal).data("onClose") || p.onClose;
self.hideModal(this,{gb:p.gbox,jqm:p.jqModal,onClose: cone});
}
});
}
},
viewModal : function (selector,o){
o = $.extend({
toTop: true,
overlay: 10,
modal: false,
onShow: this.showModal,
onHide: this.closeModal,
gbox: '',
jqm : true,
jqM : true
}, o || {});
if ($.fn.jqm && o.jqm === true) {
if(o.jqM) { $(selector).attr("aria-hidden","false").jqm(o).jqmShow(); }
else {$(selector).attr("aria-hidden","false").jqmShow();}
} else {
if(o.gbox !== '') {
$(".jqgrid-overlay:first",o.gbox).show();
$(selector).data("gbox",o.gbox);
}
$(selector).show().attr("aria-hidden","false");
try{$(':input:visible',selector)[0].focus();}catch(_){}
}
},
info_dialog : function(caption, content,c_b, modalopt) {
var mopt = {
width:290,
height:'auto',
dataheight: 'auto',
drag: true,
resize: false,
caption:"<b>"+caption+"</b>",
left:250,
top:170,
zIndex : 1000,
jqModal : true,
modal : false,
closeOnEscape : true,
align: 'center',
buttonalign : 'center',
buttons : []
// {text:'textbutt', id:"buttid", onClick : function(){...}}
// if the id is not provided we set it like info_button_+ the index in the array - i.e info_button_0,info_button_1...
};
$.extend(mopt,modalopt || {});
var jm = mopt.jqModal, self = this;
if($.fn.jqm && !jm) { jm = false; }
// in case there is no jqModal
var buttstr ="";
if(mopt.buttons.length > 0) {
for(var i=0;i<mopt.buttons.length;i++) {
if(typeof mopt.buttons[i].id == "undefined") { mopt.buttons[i].id = "info_button_"+i; }
buttstr += "<a href='javascript:void(0)' id='"+mopt.buttons[i].id+"' class='fm-button ui-state-default ui-corner-all'>"+mopt.buttons[i].text+"</a>";
}
}
var dh = isNaN(mopt.dataheight) ? mopt.dataheight : mopt.dataheight+"px",
cn = "text-align:"+mopt.align+";";
var cnt = "<div id='info_id'>";
cnt += "<div id='infocnt' style='margin:0px;padding-bottom:1em;width:100%;overflow:auto;position:relative;height:"+dh+";"+cn+"'>"+content+"</div>";
cnt += c_b ? "<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+mopt.buttonalign+";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'><a href='javascript:void(0)' id='closedialog' class='fm-button ui-state-default ui-corner-all'>"+c_b+"</a>"+buttstr+"</div>" :
buttstr !== "" ? "<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+mopt.buttonalign+";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'>"+buttstr+"</div>" : "";
cnt += "</div>";
try {
if($("#info_dialog").attr("aria-hidden") == "false") {
this.hideModal("#info_dialog",{jqm:jm});
}
$("#info_dialog").remove();
} catch (e){}
this.createModal({
themodal:'info_dialog',
modalhead:'info_head',
modalcontent:'info_content',
scrollelm: 'infocnt'},
cnt,
mopt,
'','',true
);
// attach onclick after inserting into the dom
if(buttstr) {
$.each(mopt.buttons,function(i){
$("#"+this.id,"#info_id").bind('click',function(){mopt.buttons[i].onClick.call($("#info_dialog")); return false;});
});
}
$("#closedialog", "#info_id").click(function(e){
self.hideModal("#info_dialog",{jqm:jm});
return false;
});
$(".fm-button","#info_dialog").hover(
function(){$(this).addClass('ui-state-hover');},
function(){$(this).removeClass('ui-state-hover');}
);
if($.isFunction(mopt.beforeOpen) ) { mopt.beforeOpen(); }
this.viewModal("#info_dialog",{
onHide: function(h) {
h.w.hide().remove();
if(h.o) { h.o.remove(); }
},
modal :mopt.modal,
jqm:jm
});
if($.isFunction(mopt.afterOpen) ) { mopt.afterOpen(); }
try{ $("#info_dialog").focus();} catch (m){}
},
// Form Functions
createEl : function(eltype,options,vl,autowidth, ajaxso) {
var elem = "";
function bindEv (el, opt) {
if($.isFunction(opt.dataInit)) {
opt.dataInit(el);
}
if(opt.dataEvents) {
$.each(opt.dataEvents, function() {
if (this.data !== undefined) {
$(el).bind(this.type, this.data, this.fn);
} else {
$(el).bind(this.type, this.fn);
}
});
}
return opt;
}
function setAttributes(elm, atr, exl ) {
var exclude = ['dataInit','dataEvents','dataUrl', 'buildSelect','sopt', 'searchhidden', 'defaultValue', 'attr'];
if(typeof(exl) != "undefined" && $.isArray(exl)) {
exclude = $.extend(exclude, exl);
}
$.each(atr, function(key, value){
if($.inArray(key, exclude) === -1) {
$(elm).attr(key,value);
}
});
if(!atr.hasOwnProperty('id')) {
$(elm).attr('id', $.jgrid.randId());
}
}
switch (eltype)
{
case "textarea" :
elem = document.createElement("textarea");
if(autowidth) {
if(!options.cols) { $(elem).css({width:"98%"});}
} else if (!options.cols) { options.cols = 20; }
if(!options.rows) { options.rows = 2; }
if(vl==' ' || vl==' ' || (vl.length==1 && vl.charCodeAt(0)==160)) {vl="";}
elem.value = vl;
setAttributes(elem, options);
options = bindEv(elem,options);
$(elem).attr({"role":"textbox","multiline":"true"});
break;
case "checkbox" : //what code for simple checkbox
elem = document.createElement("input");
elem.type = "checkbox";
if( !options.value ) {
var vl1 = vl.toLowerCase();
if(vl1.search(/(false|0|no|off|undefined)/i)<0 && vl1!=="") {
elem.checked=true;
elem.defaultChecked=true;
elem.value = vl;
} else {
elem.value = "on";
}
$(elem).attr("offval","off");
} else {
var cbval = options.value.split(":");
if(vl === cbval[0]) {
elem.checked=true;
elem.defaultChecked=true;
}
elem.value = cbval[0];
$(elem).attr("offval",cbval[1]);
}
setAttributes(elem, options, ['value']);
options = bindEv(elem,options);
$(elem).attr("role","checkbox");
break;
case "select" :
elem = document.createElement("select");
elem.setAttribute("role","select");
var msl, ovm = [];
if(options.multiple===true) {
msl = true;
elem.multiple="multiple";
$(elem).attr("aria-multiselectable","true");
} else { msl = false; }
if(typeof(options.dataUrl) != "undefined") {
$.ajax($.extend({
url: options.dataUrl,
type : "GET",
dataType: "html",
context: {elem:elem, options:options, vl:vl},
success: function(data,status){
var a, ovm = [], elem = this.elem, vl = this.vl,
options = $.extend({},this.options),
msl = options.multiple===true;
if(typeof(options.buildSelect) != "undefined") {
var b = options.buildSelect(data);
a = $(b).html();
} else {
a = $(data).html();
}
if(a) {
$(elem).append(a);
setAttributes(elem, options);
options = bindEv(elem,options);
if(typeof options.size === 'undefined') { options.size = msl ? 3 : 1;}
if(msl) {
ovm = vl.split(",");
ovm = $.map(ovm,function(n){return $.trim(n);});
} else {
ovm[0] = $.trim(vl);
}
//$(elem).attr(options);
setTimeout(function(){
$("option",elem).each(function(i){
//if(i===0) { this.selected = ""; }
$(this).attr("role","option");
if($.inArray($.trim($(this).text()),ovm) > -1 || $.inArray($.trim($(this).val()),ovm) > -1 ) {
this.selected= "selected";
}
});
},0);
}
}
},ajaxso || {}));
} else if(options.value) {
var i;
if(msl) {
ovm = vl.split(",");
ovm = $.map(ovm,function(n){return $.trim(n);});
if(typeof options.size === 'undefined') {options.size = 3;}
} else {
options.size = 1;
}
if(typeof options.value === 'function') { options.value = options.value(); }
var so,sv, ov;
if(typeof options.value === 'string') {
so = options.value.split(";");
for(i=0; i<so.length;i++){
sv = so[i].split(":");
if(sv.length > 2 ) {
sv[1] = $.map(sv,function(n,i){if(i>0) { return n;} }).join(":");
}
ov = document.createElement("option");
ov.setAttribute("role","option");
ov.value = sv[0]; ov.innerHTML = sv[1];
if (!msl && ($.trim(sv[0]) == $.trim(vl) || $.trim(sv[1]) == $.trim(vl))) { ov.selected ="selected"; }
if (msl && ($.inArray($.trim(sv[1]), ovm)>-1 || $.inArray($.trim(sv[0]), ovm)>-1)) {ov.selected ="selected";}
elem.appendChild(ov);
}
} else if (typeof options.value === 'object') {
var oSv = options.value;
for ( var key in oSv) {
if (oSv.hasOwnProperty(key ) ){
ov = document.createElement("option");
ov.setAttribute("role","option");
ov.value = key; ov.innerHTML = oSv[key];
if (!msl && ( $.trim(key) == $.trim(vl) || $.trim(oSv[key]) == $.trim(vl)) ) { ov.selected ="selected"; }
if (msl && ($.inArray($.trim(oSv[key]),ovm)>-1 || $.inArray($.trim(key),ovm)>-1)) { ov.selected ="selected"; }
elem.appendChild(ov);
}
}
}
setAttributes(elem, options, ['value']);
options = bindEv(elem,options);
}
break;
case "text" :
case "password" :
case "button" :
var role;
if(eltype=="button") { role = "button"; }
else { role = "textbox"; }
elem = document.createElement("input");
elem.type = eltype;
elem.value = vl;
setAttributes(elem, options);
options = bindEv(elem,options);
if(eltype != "button"){
if(autowidth) {
if(!options.size) { $(elem).css({width:"98%"}); }
} else if (!options.size) { options.size = 20; }
}
$(elem).attr("role",role);
break;
case "image" :
case "file" :
elem = document.createElement("input");
elem.type = eltype;
setAttributes(elem, options);
options = bindEv(elem,options);
break;
case "custom" :
elem = document.createElement("span");
try {
if($.isFunction(options.custom_element)) {
var celm = options.custom_element.call(this,vl,options);
if(celm) {
celm = $(celm).addClass("customelement").attr({id:options.id,name:options.name});
$(elem).empty().append(celm);
} else {
throw "e2";
}
} else {
throw "e1";
}
} catch (e) {
if (e=="e1") { this.info_dialog($.jgrid.errors.errcap,"function 'custom_element' "+$.jgrid.edit.msg.nodefined, $.jgrid.edit.bClose);}
if (e=="e2") { this.info_dialog($.jgrid.errors.errcap,"function 'custom_element' "+$.jgrid.edit.msg.novalue,$.jgrid.edit.bClose);}
else { this.info_dialog($.jgrid.errors.errcap,typeof(e)==="string"?e:e.message,$.jgrid.edit.bClose); }
}
break;
}
return elem;
},
// Date Validation Javascript
checkDate : function (format, date) {
var daysInFebruary = function(year){
// February has 29 days in any year evenly divisible by four,
// EXCEPT for centurial years which are not also divisible by 400.
return (((year % 4 === 0) && ( year % 100 !== 0 || (year % 400 === 0))) ? 29 : 28 );
},
DaysArray = function(n) {
for (var i = 1; i <= n; i++) {
this[i] = 31;
if (i==4 || i==6 || i==9 || i==11) {this[i] = 30;}
if (i==2) {this[i] = 29;}
}
return this;
};
var tsp = {}, sep;
format = format.toLowerCase();
//we search for /,-,. for the date separator
if(format.indexOf("/") != -1) {
sep = "/";
} else if(format.indexOf("-") != -1) {
sep = "-";
} else if(format.indexOf(".") != -1) {
sep = ".";
} else {
sep = "/";
}
format = format.split(sep);
date = date.split(sep);
if (date.length != 3) { return false; }
var j=-1,yln, dln=-1, mln=-1;
for(var i=0;i<format.length;i++){
var dv = isNaN(date[i]) ? 0 : parseInt(date[i],10);
tsp[format[i]] = dv;
yln = format[i];
if(yln.indexOf("y") != -1) { j=i; }
if(yln.indexOf("m") != -1) { mln=i; }
if(yln.indexOf("d") != -1) { dln=i; }
}
if (format[j] == "y" || format[j] == "yyyy") {
yln=4;
} else if(format[j] =="yy"){
yln = 2;
} else {
yln = -1;
}
var daysInMonth = DaysArray(12),
strDate;
if (j === -1) {
return false;
} else {
strDate = tsp[format[j]].toString();
if(yln == 2 && strDate.length == 1) {yln = 1;}
if (strDate.length != yln || (tsp[format[j]]===0 && date[j]!="00")){
return false;
}
}
if(mln === -1) {
return false;
} else {
strDate = tsp[format[mln]].toString();
if (strDate.length<1 || tsp[format[mln]]<1 || tsp[format[mln]]>12){
return false;
}
}
if(dln === -1) {
return false;
} else {
strDate = tsp[format[dln]].toString();
if (strDate.length<1 || tsp[format[dln]]<1 || tsp[format[dln]]>31 || (tsp[format[mln]]==2 && tsp[format[dln]]>daysInFebruary(tsp[format[j]])) || tsp[format[dln]] > daysInMonth[tsp[format[mln]]]){
return false;
}
}
return true;
},
isEmpty : function(val)
{
if (val.match(/^\s+$/) || val === "") {
return true;
} else {
return false;
}
},
checkTime : function(time){
// checks only hh:ss (and optional am/pm)
var re = /^(\d{1,2}):(\d{2})([ap]m)?$/,regs;
if(!this.isEmpty(time))
{
regs = time.match(re);
if(regs) {
if(regs[3]) {
if(regs[1] < 1 || regs[1] > 12) { return false; }
} else {
if(regs[1] > 23) { return false; }
}
if(regs[2] > 59) {
return false;
}
} else {
return false;
}
}
return true;
},
checkValues : function(val, valref,g, customobject, nam) {
var edtrul,i, nm, dft, len;
if(typeof(customobject) === "undefined") {
if(typeof(valref)=='string'){
for( i =0, len=g.p.colModel.length;i<len; i++){
if(g.p.colModel[i].name==valref) {
edtrul = g.p.colModel[i].editrules;
valref = i;
try { nm = g.p.colModel[i].formoptions.label; } catch (e) {}
break;
}
}
} else if(valref >=0) {
edtrul = g.p.colModel[valref].editrules;
}
} else {
edtrul = customobject;
nm = nam===undefined ? "_" : nam;
}
if(edtrul) {
if(!nm) { nm = g.p.colNames[valref]; }
if(edtrul.required === true) {
if( this.isEmpty(val) ) { return [false,nm+": "+$.jgrid.edit.msg.required,""]; }
}
// force required
var rqfield = edtrul.required === false ? false : true;
if(edtrul.number === true) {
if( !(rqfield === false && this.isEmpty(val)) ) {
if(isNaN(val)) { return [false,nm+": "+$.jgrid.edit.msg.number,""]; }
}
}
if(typeof edtrul.minValue != 'undefined' && !isNaN(edtrul.minValue)) {
if (parseFloat(val) < parseFloat(edtrul.minValue) ) { return [false,nm+": "+$.jgrid.edit.msg.minValue+" "+edtrul.minValue,""];}
}
if(typeof edtrul.maxValue != 'undefined' && !isNaN(edtrul.maxValue)) {
if (parseFloat(val) > parseFloat(edtrul.maxValue) ) { return [false,nm+": "+$.jgrid.edit.msg.maxValue+" "+edtrul.maxValue,""];}
}
var filter;
if(edtrul.email === true) {
if( !(rqfield === false && this.isEmpty(val)) ) {
// taken from $ Validate plugin
filter = /^((([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;
if(!filter.test(val)) {return [false,nm+": "+$.jgrid.edit.msg.email,""];}
}
}
if(edtrul.integer === true) {
if( !(rqfield === false && this.isEmpty(val)) ) {
if(isNaN(val)) { return [false,nm+": "+$.jgrid.edit.msg.integer,""]; }
if ((val % 1 !== 0) || (val.indexOf('.') != -1)) { return [false,nm+": "+$.jgrid.edit.msg.integer,""];}
}
}
if(edtrul.date === true) {
if( !(rqfield === false && this.isEmpty(val)) ) {
if(g.p.colModel[valref].formatoptions && g.p.colModel[valref].formatoptions.newformat) {
dft = g.p.colModel[valref].formatoptions.newformat;
} else {
dft = g.p.colModel[valref].datefmt || "Y-m-d";
}
if(!this.checkDate (dft, val)) { return [false,nm+": "+$.jgrid.edit.msg.date+" - "+dft,""]; }
}
}
if(edtrul.time === true) {
if( !(rqfield === false && this.isEmpty(val)) ) {
if(!this.checkTime (val)) { return [false,nm+": "+$.jgrid.edit.msg.date+" - hh:mm (am/pm)",""]; }
}
}
if(edtrul.url === true) {
if( !(rqfield === false && this.isEmpty(val)) ) {
filter = /^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
if(!filter.test(val)) {return [false,nm+": "+$.jgrid.edit.msg.url,""];}
}
}
if(edtrul.custom === true) {
if( !(rqfield === false && this.isEmpty(val)) ) {
if($.isFunction(edtrul.custom_func)) {
var ret = edtrul.custom_func.call(g,val,nm);
if($.isArray(ret)) {
return ret;
} else {
return [false,$.jgrid.edit.msg.customarray,""];
}
} else {
return [false,$.jgrid.edit.msg.customfcheck,""];
}
}
}
}
return [true,"",""];
}
});
})(jQuery); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/grid.common.js | JavaScript | art | 22,924 |
;(function($){
/*
* jqGrid extension for constructing Grid Data from external file
* 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-2.0.html
**/
$.jgrid.extend({
jqGridImport : function(o) {
o = $.extend({
imptype : "xml", // xml, json, xmlstring, jsonstring
impstring: "",
impurl: "",
mtype: "GET",
impData : {},
xmlGrid :{
config : "roots>grid",
data: "roots>rows"
},
jsonGrid :{
config : "grid",
data: "data"
},
ajaxOptions :{}
}, o || {});
return this.each(function(){
var $t = this;
var XmlConvert = function (xml,o) {
var cnfg = $(o.xmlGrid.config,xml)[0];
var xmldata = $(o.xmlGrid.data,xml)[0], jstr, jstr1;
if(xmlJsonClass.xml2json && $.jgrid.parse) {
jstr = xmlJsonClass.xml2json(cnfg," ");
jstr = $.jgrid.parse(jstr);
for(var key in jstr) {
if(jstr.hasOwnProperty(key)) {
jstr1=jstr[key];
}
}
if(xmldata) {
// save the datatype
var svdatatype = jstr.grid.datatype;
jstr.grid.datatype = 'xmlstring';
jstr.grid.datastr = xml;
$($t).jqGrid( jstr1 ).jqGrid("setGridParam",{datatype:svdatatype});
} else {
$($t).jqGrid( jstr1 );
}
jstr = null;jstr1=null;
} else {
alert("xml2json or parse are not present");
}
};
var JsonConvert = function (jsonstr,o){
if (jsonstr && typeof jsonstr == 'string') {
var json = $.jgrid.parse(jsonstr);
var gprm = json[o.jsonGrid.config];
var jdata = json[o.jsonGrid.data];
if(jdata) {
var svdatatype = gprm.datatype;
gprm.datatype = 'jsonstring';
gprm.datastr = jdata;
$($t).jqGrid( gprm ).jqGrid("setGridParam",{datatype:svdatatype});
} else {
$($t).jqGrid( gprm );
}
}
};
switch (o.imptype){
case 'xml':
$.ajax($.extend({
url:o.impurl,
type:o.mtype,
data: o.impData,
dataType:"xml",
complete: function(xml,stat) {
if(stat == 'success') {
XmlConvert(xml.responseXML,o);
if($.isFunction(o.importComplete)) {
o.importComplete(xml);
}
}
xml=null;
}
}, o.ajaxOptions));
break;
case 'xmlstring' :
// we need to make just the conversion and use the same code as xml
if(o.impstring && typeof o.impstring == 'string') {
var xmld = $.jgrid.stringToDoc(o.impstring);
if(xmld) {
XmlConvert(xmld,o);
if($.isFunction(o.importComplete)) {
o.importComplete(xmld);
}
o.impstring = null;
}
xmld = null;
}
break;
case 'json':
$.ajax($.extend({
url:o.impurl,
type:o.mtype,
data: o.impData,
dataType:"json",
complete: function(json,stat) {
if(stat == 'success') {
JsonConvert(json.responseText,o );
if($.isFunction(o.importComplete)) {
o.importComplete(json);
}
}
json=null;
}
}, o.ajaxOptions ));
break;
case 'jsonstring' :
if(o.impstring && typeof o.impstring == 'string') {
JsonConvert(o.impstring,o );
if($.isFunction(o.importComplete)) {
o.importComplete(o.impstring);
}
o.impstring = null;
}
break;
}
});
},
jqGridExport : function(o) {
o = $.extend({
exptype : "xmlstring",
root: "grid",
ident: "\t"
}, o || {});
var ret = null;
this.each(function () {
if(!this.grid) { return;}
var gprm = $.extend({},$(this).jqGrid("getGridParam"));
// we need to check for:
// 1.multiselect, 2.subgrid 3. treegrid and remove the unneded columns from colNames
if(gprm.rownumbers) {
gprm.colNames.splice(0,1);
gprm.colModel.splice(0,1);
}
if(gprm.multiselect) {
gprm.colNames.splice(0,1);
gprm.colModel.splice(0,1);
}
if(gprm.subGrid) {
gprm.colNames.splice(0,1);
gprm.colModel.splice(0,1);
}
gprm.knv = null;
if(gprm.treeGrid) {
for (var key in gprm.treeReader) {
if(gprm.treeReader.hasOwnProperty(key)) {
gprm.colNames.splice(gprm.colNames.length-1);
gprm.colModel.splice(gprm.colModel.length-1);
}
}
}
switch (o.exptype) {
case 'xmlstring' :
ret = "<"+o.root+">"+xmlJsonClass.json2xml(gprm,o.ident)+"</"+o.root+">";
break;
case 'jsonstring' :
ret = "{"+ xmlJsonClass.toJson(gprm,o.root,o.ident,false)+"}";
if(gprm.postData.filters !== undefined) {
ret=ret.replace(/filters":"/,'filters":');
ret=ret.replace(/}]}"/,'}]}');
}
break;
}
});
return ret;
},
excelExport : function(o) {
o = $.extend({
exptype : "remote",
url : null,
oper: "oper",
tag: "excel",
exportOptions : {}
}, o || {});
return this.each(function(){
if(!this.grid) { return;}
var url;
if(o.exptype == "remote") {
var pdata = $.extend({},this.p.postData);
pdata[o.oper] = o.tag;
var params = jQuery.param(pdata);
if(o.url.indexOf("?") != -1) { url = o.url+"&"+params; }
else { url = o.url+"?"+params; }
window.location = url;
}
});
}
});
})(jQuery); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/grid.import.js | JavaScript | art | 8,538 |
;(function($){
/**
* jqGrid Ukrainian Translation v1.0 02.07.2009
* Sergey Dyagovchenko
* http://d.sumy.ua
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Перегляд {0} - {1} з {2}",
emptyrecords: "Немає записів для перегляду",
loadtext: "Завантаження...",
pgtext : "Стор. {0} з {1}"
},
search : {
caption: "Пошук...",
Find: "Знайти",
Reset: "Скидання",
odata : ['рівно', 'не рівно', 'менше', 'менше або рівне','більше','більше або рівне', 'починається з','не починається з','знаходиться в','не знаходиться в','закінчується на','не закінчується на','містить','не містить'],
groupOps: [ { op: "AND", text: "все" }, { op: "OR", text: "будь-який" } ],
matchText: " збігається",
rulesText: " правила"
},
edit : {
addCaption: "Додати запис",
editCaption: "Змінити запис",
bSubmit: "Зберегти",
bCancel: "Відміна",
bClose: "Закрити",
saveData: "До данних були внесені зміни! Зберегти зміни?",
bYes : "Так",
bNo : "Ні",
bExit : "Відміна",
msg: {
required:"Поле є обов'язковим",
number:"Будь ласка, введіть правильне число",
minValue:"значення повинне бути більше або дорівнює",
maxValue:"значення повинно бути менше або дорівнює",
email: "некоректна адреса електронної пошти",
integer: "Будь ласка, введення дійсне ціле значення",
date: "Будь ласка, введення дійсне значення дати",
url: "не дійсний URL. Необхідна приставка ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
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 : "Число полів не відповідає числу стовпців таблиці!"
},
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","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",
MonthDay: "F d",
ShortTime: "G:i",
LongTime: "G:i:s",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-ua.js | JavaScript | art | 5,343 |
;(function($){
/**
* jqGrid Montenegrian Translation
* Bild Studio info@bild-studio.net
* http://www.bild-studio.com
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Pregled {0} - {1} od {2}",
emptyrecords: "Ne postoji nijedan zapis",
loadtext: "Učitivanje...",
pgtext : "Strana {0} od {1}"
},
search : {
caption: "Traženje...",
Find: "Traži",
Reset: "Resetuj",
odata : ['jednako', 'nije jednako', 'manje', 'manje ili jednako','veće','veće ili jednako', 'počinje sa','ne počinje sa','je u','nije u','završava sa','ne završava sa','sadrži','ne sadrži'],
groupOps: [ { op: "AND", text: "sva" }, { op: "OR", text: "bilo koje" } ],
matchText: " primjeni",
rulesText: " pravila"
},
edit : {
addCaption: "Dodaj zapis",
editCaption: "Izmjeni zapis",
bSubmit: "Pošalji",
bCancel: "Odustani",
bClose: "Zatvori",
saveData: "Podatak je izmjenjen! Sačuvaj izmjene?",
bYes : "Da",
bNo : "Ne",
bExit : "Odustani",
msg: {
required:"Polje je obavezno",
number:"Unesite ispravan broj",
minValue:"vrijednost mora biti veća od ili jednaka sa ",
maxValue:"vrijednost mora biti manja ili jednaka sa",
email: "nije ispravna email adresa, nije valjda da ne umiješ ukucati mail!?",
integer: "Ne zajebaji se unesi cjelobrojnu vrijednost ",
date: "Unesite ispravan datum",
url: "nije ispravan URL. Potreban je prefiks ('http://' or 'https://')",
nodefined : " nije definisan!",
novalue : " zahtjevana je povratna vrijednost!",
customarray : "Prilagođena funkcija treba da vrati niz!",
customfcheck : "Prilagođena funkcija treba da bude prisutana u slučaju prilagođene provjere!"
}
},
view : {
caption: "Pogledaj zapis",
bClose: "Zatvori"
},
del : {
caption: "Izbrisi",
msg: "Izbrisi izabran(e) zapise(e)?",
bSubmit: "Izbriši",
bCancel: "Odbaci"
},
nav : {
edittext: "",
edittitle: "Izmjeni izabrani red",
addtext:"",
addtitle: "Dodaj novi red",
deltext: "",
deltitle: "Izbriši izabran red",
searchtext: "",
searchtitle: "Nađi zapise",
refreshtext: "",
refreshtitle: "Ponovo učitaj podatke",
alertcap: "Upozorenje",
alerttext: "Izaberite red",
viewtext: "",
viewtitle: "Pogledaj izabrani red"
},
col : {
caption: "Izaberi kolone",
bSubmit: "OK",
bCancel: "Odbaci"
},
errors : {
errcap : "Greška",
nourl : "Nije postavljen URL",
norecords: "Nema zapisa za obradu",
model : "Dužina modela 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: [
"Ned", "Pon", "Uto", "Sre", "Čet", "Pet", "Sub",
"Nedelja", "Ponedeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota"
],
monthNames: [
"Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Avg", "Sep", "Okt", "Nov", "Dec",
"Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"
],
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-mne.js | JavaScript | art | 4,110 |
;(function($){
/**
* jqGrid Catalan Translation
* Traducció jqGrid en Catatà per Faserline, S.L.
* http://www.faserline.com
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Mostrant {0} - {1} de {2}",
emptyrecords: "Sense registres que mostrar",
loadtext: "Carregant...",
pgtext : "Pàgina {0} de {1}"
},
search : {
caption: "Cerca...",
Find: "Cercar",
Reset: "Buidar",
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
groupOps: [ { op: "AND", text: "tot" }, { op: "OR", text: "qualsevol" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "Afegir registre",
editCaption: "Modificar registre",
bSubmit: "Guardar",
bCancel: "Cancelar",
bClose: "Tancar",
saveData: "Les dades han canviat. Guardar canvis?",
bYes : "Yes",
bNo : "No",
bExit : "Cancel",
msg: {
required:"Camp obligatori",
number:"Introdueixi un nombre",
minValue:"El valor ha de ser major o igual que ",
maxValue:"El valor ha de ser menor o igual a ",
email: "no és una direcció de correu vàlida",
integer: "Introdueixi un valor enter",
date: "Introdueixi una data correcta ",
url: "no és una URL vàlida. Prefix requerit ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "Veure registre",
bClose: "Tancar"
},
del : {
caption: "Eliminar",
msg: "¿Desitja eliminar els registres seleccionats?",
bSubmit: "Eliminar",
bCancel: "Cancelar"
},
nav : {
edittext: " ",
edittitle: "Modificar fila seleccionada",
addtext:" ",
addtitle: "Agregar nova fila",
deltext: " ",
deltitle: "Eliminar fila seleccionada",
searchtext: " ",
searchtitle: "Cercar informació",
refreshtext: "",
refreshtitle: "Refrescar taula",
alertcap: "Avís",
alerttext: "Seleccioni una fila",
viewtext: " ",
viewtitle: "Veure fila seleccionada"
},
// setcolumns module
col : {
caption: "Mostrar/ocultar columnes",
bSubmit: "Enviar",
bCancel: "Cancelar"
},
errors : {
errcap : "Error",
nourl : "No s'ha especificat una URL",
norecords: "No hi ha dades per processar",
model : "Les columnes de noms són diferents de les columnes del model"
},
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: [
"Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds",
"Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"
],
monthNames: [
"Gen", "Febr", "Març", "Abr", "Maig", "Juny", "Jul", "Ag", "Set", "Oct", "Nov", "Des",
"Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"
],
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',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-cat.js | JavaScript | art | 4,132 |
;(function($){
/**
* jqGrid Hebrew Translation
* Shuki Shukrun shukrun.shuki@gmail.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 = {
defaults : {
recordtext: "מציג {0} - {1} מתוך {2}",
emptyrecords: "אין רשומות להציג",
loadtext: "טוען...",
pgtext : "דף {0} מתוך {1}"
},
search : {
caption: "מחפש...",
Find: "חפש",
Reset: "התחל",
odata : ['שווה', 'לא שווה', 'קטן', 'קטן או שווה','גדול','גדול או שווה', 'מתחיל ב','לא מתחיל ב','נמצא ב','לא נמצא ב','מסתיים ב','לא מסתיים ב','מכיל','לא מכיל'],
groupOps: [ { op: "AND", text: "הכל" }, { op: "OR", text: "אחד מ" } ],
matchText: " תואם",
rulesText: " חוקים"
},
edit : {
addCaption: "הוסף רשומה",
editCaption: "ערוך רשומה",
bSubmit: "שלח",
bCancel: "בטל",
bClose: "סגור",
saveData: "נתונים השתנו! לשמור?",
bYes : "כן",
bNo : "לא",
bExit : "בטל",
msg: {
required:"שדה חובה",
number:"אנא, הכנס מספר תקין",
minValue:"ערך צריך להיות גדול או שווה ל ",
maxValue:"ערך צריך להיות קטן או שווה ל ",
email: "היא לא כתובת איימל תקינה",
integer: "אנא, הכנס מספר שלם",
date: "אנא, הכנס תאריך תקין",
url: "הכתובת אינה תקינה. דרושה תחילית ('http://' או 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
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 : ["לפני הצהרים","אחר הצהרים","לפני הצהרים","אחר הצהרים"],
S: function (j) {return j < 11 || j > 13 ? ['', '', '', ''][Math.min((j - 1) % 10, 3)] : ''},
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-he.js | JavaScript | art | 4,328 |
;(function($){
/**
* jqGrid Spanish Translation
* Traduccion jqGrid en Español por Yamil Bracho
* Traduccion corregida y ampliada por Faserline, S.L.
* http://www.faserline.com
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Mostrando {0} - {1} de {2}",
emptyrecords: "Sin registros que mostrar",
loadtext: "Cargando...",
pgtext : "Página {0} de {1}"
},
search : {
caption: "Búsqueda...",
Find: "Buscar",
Reset: "Limpiar",
odata : ['igual ', 'no igual a', 'menor que', 'menor o igual que','mayor que','mayor o igual a', 'empiece por','no empiece por','está en','no está en','termina por','no termina por','contiene','no contiene'],
groupOps: [ { op: "AND", text: "todo" }, { op: "OR", text: "cualquier" } ],
matchText: " match",
rulesText: " reglas"
},
edit : {
addCaption: "Agregar registro",
editCaption: "Modificar registro",
bSubmit: "Guardar",
bCancel: "Cancelar",
bClose: "Cerrar",
saveData: "Se han modificado los datos, ¿guardar cambios?",
bYes : "Si",
bNo : "No",
bExit : "Cancelar",
msg: {
required:"Campo obligatorio",
number:"Introduzca un número",
minValue:"El valor debe ser mayor o igual a ",
maxValue:"El valor debe ser menor o igual a ",
email: "no es una dirección de correo válida",
integer: "Introduzca un valor entero",
date: "Introduza una fecha correcta ",
url: "no es una URL válida. Prefijo requerido ('http://' or 'https://')",
nodefined : " no está definido.",
novalue : " valor de retorno es requerido.",
customarray : "La función personalizada debe devolver un array.",
customfcheck : "La función personalizada debe estar presente en el caso de validación personalizada."
}
},
view : {
caption: "Consultar registro",
bClose: "Cerrar"
},
del : {
caption: "Eliminar",
msg: "¿Desea eliminar los registros seleccionados?",
bSubmit: "Eliminar",
bCancel: "Cancelar"
},
nav : {
edittext: " ",
edittitle: "Modificar fila seleccionada",
addtext:" ",
addtitle: "Agregar nueva fila",
deltext: " ",
deltitle: "Eliminar fila seleccionada",
searchtext: " ",
searchtitle: "Buscar información",
refreshtext: "",
refreshtitle: "Recargar datos",
alertcap: "Aviso",
alerttext: "Seleccione una fila",
viewtext: "",
viewtitle: "Ver fila seleccionada"
},
col : {
caption: "Mostrar/ocultar columnas",
bSubmit: "Enviar",
bCancel: "Cancelar"
},
errors : {
errcap : "Error",
nourl : "No se ha especificado una URL",
norecords: "No hay datos para procesar",
model : "Las columnas de nombres son diferentes de las columnas de modelo"
},
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: [
"Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa",
"Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado"
],
monthNames: [
"Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic",
"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"
],
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-es.js | JavaScript | art | 4,367 |
;(function($){
/**
* jqGrid Polish Translation
* Łukasz Schab
* http://FreeTree.pl
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Pokaż {0} - {1} z {2}",
emptyrecords: "Brak rekordów do pokazania",
loadtext: "\u0142adowanie...",
pgtext : "Strona {0} z {1}"
},
search : {
caption: "Wyszukiwanie...",
Find: "Szukaj",
Reset: "Czyść",
odata : ['dok\u0142adnie', 'różne od', 'mniejsze od', 'mniejsze lub równe','większe od','większe lub równe', 'zaczyna się od','nie zaczyna się od','zawiera','nie zawiera','kończy się na','nie kończy się na','zawiera','nie zawiera'],
groupOps: [ { op: "ORAZ", text: "wszystkie" }, { op: "LUB", text: "każdy" } ],
matchText: " pasuje",
rulesText: " regu\u0142y"
},
edit : {
addCaption: "Dodaj rekord",
editCaption: "Edytuj rekord",
bSubmit: "Zapisz",
bCancel: "Anuluj",
bClose: "Zamknij",
saveData: "Dane zosta\u0142y zmienione! Zapisać zmiany?",
bYes : "Tak",
bNo : "Nie",
bExit : "Anuluj",
msg: {
required:"Pole jest wymagane",
number:"Proszę wpisać poprawną liczbę",
minValue:"wartość musi być większa lub równa",
maxValue:"wartość musi być mniejsza od",
email: "nie jest adresem e-mail",
integer: "Proszę wpisać poprawną liczbę",
date: "Proszę podaj poprawną datę",
url: "jest niew\u0142aściwym adresem URL. Pamiętaj o prefiksie ('http://' lub 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "Pokaż rekord",
bClose: "Zamknij"
},
del : {
caption: "Usuwanie",
msg: "Czy usunąć wybrany rekord(y)?",
bSubmit: "Usuń",
bCancel: "Anuluj"
},
nav : {
edittext: " ",
edittitle: "Edytuj wybrany wiersz",
addtext:" ",
addtitle: "Dodaj nowy wiersz",
deltext: " ",
deltitle: "Usuń wybrany wiersz",
searchtext: " ",
searchtitle: "Wyszukaj rekord",
refreshtext: "",
refreshtitle: "Prze\u0142aduj",
alertcap: "Uwaga",
alerttext: "Proszę wybrać wiersz",
viewtext: "",
viewtitle: "View selected row"
},
col : {
caption: "Pokaż/Ukryj kolumny",
bSubmit: "Zatwierdź",
bCancel: "Anuluj"
},
errors : {
errcap : "B\u0142ąd",
nourl : "Brak adresu url",
norecords: "Brak danych",
model : "D\u0142ugość 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: [
"Nie", "Pon", "Wt", "Śr", "Cz", "Pi", "So",
"Niedziela", "Poniedzia\u0142ek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"
],
monthNames: [
"Sty", "Lu", "Mar", "Kwie", "Maj", "Cze", "Lip", "Sie", "Wrz", "Paź", "Lis", "Gru",
"Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return j < 11 || j > 13 ? ['', '', '', ''][Math.min((j - 1) % 10, 3)] : ''},
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-pl.js | JavaScript | art | 4,136 |
;(function($){
/**
* jqGrid German Translation
* Version 1.0.0 (developed for jQuery Grid 3.3.1)
* Olaf Klöppel opensource@blue-hit.de
* http://blue-hit.de/
*
* Updated for jqGrid 3.8
* Andreas Flack
* http://www.contentcontrol-berlin.de
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Zeige {0} - {1} von {2}",
emptyrecords: "Keine Datensätze vorhanden",
loadtext: "Lädt...",
pgtext : "Seite {0} von {1}"
},
search : {
caption: "Suche...",
Find: "Suchen",
Reset: "Zurücksetzen",
odata : ['gleich', 'ungleich', 'kleiner', 'kleiner gleich','größer','größer gleich', 'beginnt mit','beginnt nicht mit','ist in','ist nicht in','endet mit','endet nicht mit','enthält','enthält nicht'],
groupOps: [ { op: "AND", text: "alle" }, { op: "OR", text: "mindestens eine" } ],
matchText: " erfülle",
rulesText: " Bedingung(en)"
},
edit : {
addCaption: "Datensatz hinzufügen",
editCaption: "Datensatz bearbeiten",
bSubmit: "Speichern",
bCancel: "Abbrechen",
bClose: "Schließen",
saveData: "Daten wurden geändert! Änderungen speichern?",
bYes : "ja",
bNo : "nein",
bExit : "abbrechen",
msg: {
required:"Feld ist erforderlich",
number: "Bitte geben Sie eine Zahl ein",
minValue:"Wert muss größer oder gleich sein, als ",
maxValue:"Wert muss kleiner oder gleich sein, als ",
email: "ist keine gültige E-Mail-Adresse",
integer: "Bitte geben Sie eine Ganzzahl ein",
date: "Bitte geben Sie ein gültiges Datum ein",
url: "ist keine gültige URL. Präfix muss eingegeben werden ('http://' oder 'https://')",
nodefined : " ist nicht definiert!",
novalue : " Rückgabewert ist erforderlich!",
customarray : "Benutzerdefinierte Funktion sollte ein Array zurückgeben!",
customfcheck : "Benutzerdefinierte Funktion sollte im Falle der benutzerdefinierten Überprüfung vorhanden sein!"
}
},
view : {
caption: "Datensatz anzeigen",
bClose: "Schließen"
},
del : {
caption: "Löschen",
msg: "Ausgewählte Datensätze löschen?",
bSubmit: "Löschen",
bCancel: "Abbrechen"
},
nav : {
edittext: " ",
edittitle: "Ausgewählte Zeile editieren",
addtext:" ",
addtitle: "Neue Zeile einfügen",
deltext: " ",
deltitle: "Ausgewählte Zeile löschen",
searchtext: " ",
searchtitle: "Datensatz suchen",
refreshtext: "",
refreshtitle: "Tabelle neu laden",
alertcap: "Warnung",
alerttext: "Bitte Zeile auswählen",
viewtext: "",
viewtitle: "Ausgewählte Zeile anzeigen"
},
col : {
caption: "Spalten auswählen",
bSubmit: "Speichern",
bCancel: "Abbrechen"
},
errors : {
errcap : "Fehler",
nourl : "Keine URL angegeben",
norecords: "Keine Datensätze zu bearbeiten",
model : "colNames und colModel sind unterschiedlich lang!"
},
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: [
"So", "Mo", "Di", "Mi", "Do", "Fr", "Sa",
"Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"
],
monthNames: [
"Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez",
"Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return 'ter'},
srcformat: 'Y-m-d',
newformat: 'd.m.Y',
masks : {
ISO8601Long: "Y-m-d H:i:s",
ISO8601Short: "Y-m-d",
ShortDate: "j.n.Y",
LongDate: "l, j. F Y",
FullDateTime: "l, d. F Y G:i:s",
MonthDay: "d. F",
ShortTime: "G:i",
LongTime: "G:i:s",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-de.js | JavaScript | art | 4,348 |
;(function($){
/**
* jqGrid Russian Translation v1.0 02.07.2009 (based on translation by Alexey Kanaev v1.1 21.01.2009, http://softcore.com.ru)
* Sergey Dyagovchenko
* http://d.sumy.ua
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Просмотр {0} - {1} из {2}",
emptyrecords: "Нет записей для просмотра",
loadtext: "Загрузка...",
pgtext : "Стр. {0} из {1}"
},
search : {
caption: "Поиск...",
Find: "Найти",
Reset: "Сброс",
odata : ['равно', 'не равно', 'меньше', 'меньше или равно','больше','больше или равно', 'начинается с','не начинается с','находится в','не находится в','заканчивается на','не заканчивается на','содержит','не содержит'],
groupOps: [ { op: "AND", text: "все" }, { op: "OR", text: "любой" } ],
matchText: " совпадает",
rulesText: " правила"
},
edit : {
addCaption: "Добавить запись",
editCaption: "Редактировать запись",
bSubmit: "Сохранить",
bCancel: "Отмена",
bClose: "Закрыть",
saveData: "Данные были измененны! Сохранить изменения?",
bYes : "Да",
bNo : "Нет",
bExit : "Отмена",
msg: {
required:"Поле является обязательным",
number:"Пожалуйста, введите правильное число",
minValue:"значение должно быть больше либо равно",
maxValue:"значение должно быть меньше либо равно",
email: "некорректное значение e-mail",
integer: "Пожалуйста, введите целое число",
date: "Пожалуйста, введите правильную дату",
url: "неверная ссылка. Необходимо ввести префикс ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
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 : "Число полей не соответствует числу столбцов таблицы!"
},
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","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",
MonthDay: "F d",
ShortTime: "G:i",
LongTime: "G:i:s",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-ru.js | JavaScript | art | 5,399 |
;(function($){
/**
* jqGrid Swedish Translation
* Harald Normann harald.normann@wts.se, harald.normann@gmail.com
* http://www.worldteamsoftware.com
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Visar {0} - {1} av {2}",
emptyrecords: "Det finns inga poster att visa",
loadtext: "Laddar...",
pgtext : "Sida {0} av {1}"
},
search : {
caption: "Sök Poster - Ange sökvillkor",
Find: "Sök",
Reset: "Nollställ Villkor",
odata : ['lika', 'ej lika', 'mindre', 'mindre eller lika','större','större eller lika', 'börjar med','börjar inte med','tillhör','tillhör inte','slutar med','slutar inte med','innehåller','innehåller inte'],
groupOps: [ { op: "AND", text: "alla" }, { op: "OR", text: "eller" } ],
matchText: " träff",
rulesText: " regler"
},
edit : {
addCaption: "Ny Post",
editCaption: "Redigera Post",
bSubmit: "Spara",
bCancel: "Avbryt",
bClose: "Stäng",
saveData: "Data har ändrats! Spara förändringar?",
bYes : "Ja",
bNo : "Nej",
bExit : "Avbryt",
msg: {
required:"Fältet är obligatoriskt",
number:"Välj korrekt nummer",
minValue:"värdet måste vara större än eller lika med",
maxValue:"värdet måste vara mindre än eller lika med",
email: "är inte korrekt e-post adress",
integer: "Var god ange korrekt heltal",
date: "Var god ange korrekt datum",
url: "är inte en korrekt URL. Prefix måste anges ('http://' or 'https://')",
nodefined : " är inte definierad!",
novalue : " returvärde måste anges!",
customarray : "Custom funktion måste returnera en vektor!",
customfcheck : "Custom funktion måste finnas om Custom kontroll sker!"
}
},
view : {
caption: "Visa Post",
bClose: "Stäng"
},
del : {
caption: "Radera",
msg: "Radera markerad(e) post(er)?",
bSubmit: "Radera",
bCancel: "Avbryt"
},
nav : {
edittext: "",
edittitle: "Redigera markerad rad",
addtext:"",
addtitle: "Skapa ny post",
deltext: "",
deltitle: "Radera markerad rad",
searchtext: "",
searchtitle: "Sök poster",
refreshtext: "",
refreshtitle: "Uppdatera data",
alertcap: "Varning",
alerttext: "Ingen rad är markerad",
viewtext: "",
viewtitle: "Visa markerad rad"
},
col : {
caption: "Välj Kolumner",
bSubmit: "OK",
bCancel: "Avbryt"
},
errors : {
errcap : "Fel",
nourl : "URL saknas",
norecords: "Det finns inga poster att bearbeta",
model : "Antal colNames <> colModel!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"Kr", defaultValue: '0,00'},
date : {
dayNames: [
"Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör",
"Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"
],
monthNames: [
"Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec",
"Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"
],
AmPm : ["fm","em","FM","EM"],
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',
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-sv.js | JavaScript | art | 4,119 |
;(function($){
/**
* jqGrid Lithuanian Translation
* aur1mas aur1mas@devnet.lt
* http://aur1mas.devnet.lt
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Peržiūrima {0} - {1} iš {2}",
emptyrecords: "Įrašų nėra",
loadtext: "Kraunama...",
pgtext : "Puslapis {0} iš {1}"
},
search : {
caption: "Paieška...",
Find: "Ieškoti",
Reset: "Atstatyti",
odata : ['lygu', 'nelygu', 'mažiau', 'mažiau arba lygu','daugiau','daugiau arba lygu', 'prasideda','neprasideda','reikšmė yra','reikšmės nėra','baigiasi','nesibaigia','yra sudarytas','nėra sudarytas'],
groupOps: [ { op: "AND", text: "visi" }, { op: "OR", text: "bet kuris" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "Sukurti įrašą",
editCaption: "Redaguoti įrašą",
bSubmit: "Išsaugoti",
bCancel: "Atšaukti",
bClose: "Uždaryti",
saveData: "Duomenys buvo pakeisti! Išsaugoti pakeitimus?",
bYes : "Taip",
bNo : "Ne",
bExit : "Atšaukti",
msg: {
required:"Privalomas laukas",
number:"Įveskite tinkamą numerį",
minValue:"reikšmė turi būti didesnė arba lygi ",
maxValue:"reikšmė turi būti mažesnė arba lygi",
email: "neteisingas el. pašto adresas",
integer: "Įveskite teisingą sveikąjį skaičių",
date: "Įveskite teisingą datą",
url: "blogas adresas. Nepamirškite pridėti ('http://' arba 'https://')",
nodefined : " nėra apibrėžta!",
novalue : " turi būti gražinama kokia nors reikšmė!",
customarray : "Custom f-ja turi grąžinti masyvą!",
customfcheck : "Custom f-ja tūrėtų būti sukurta, prieš bandant ją naudoti!"
}
},
view : {
caption: "Peržiūrėti įrašus",
bClose: "Uždaryti"
},
del : {
caption: "Ištrinti",
msg: "Ištrinti pažymėtus įrašus(-ą)?",
bSubmit: "Ištrinti",
bCancel: "Atšaukti"
},
nav : {
edittext: "",
edittitle: "Redaguoti pažymėtą eilutę",
addtext:"",
addtitle: "Pridėti naują eilutę",
deltext: "",
deltitle: "Ištrinti pažymėtą eilutę",
searchtext: "",
searchtitle: "Rasti įrašus",
refreshtext: "",
refreshtitle: "Perkrauti lentelę",
alertcap: "Įspėjimas",
alerttext: "Pasirinkite eilutę",
viewtext: "",
viewtitle: "Peržiūrėti pasirinktą eilutę"
},
col : {
caption: "Pasirinkti stulpelius",
bSubmit: "Gerai",
bCancel: "Atšaukti"
},
errors : {
errcap : "Klaida",
nourl : "Url reikšmė turi būti perduota",
norecords: "Nėra įrašų, kuriuos būtų galima apdoroti",
model : "colNames skaičius <> colModel skaičiui!"
},
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: [
"Sek", "Pir", "Ant", "Tre", "Ket", "Pen", "Šeš",
"Sekmadienis", "Pirmadienis", "Antradienis", "Trečiadienis", "Ketvirtadienis", "Penktadienis", "Šeštadienis"
],
monthNames: [
"Sau", "Vas", "Kov", "Bal", "Geg", "Bir", "Lie", "Rugj", "Rugs", "Spa", "Lap", "Gru",
"Sausis", "Vasaris", "Kovas", "Balandis", "Gegužė", "Birželis", "Liepa", "Rugpjūtis", "Rugsėjis", "Spalis", "Lapkritis", "Gruodis"
],
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-lt.js | JavaScript | art | 4,134 |
(function(a) {
a.jgrid =
{
defaults:
{
recordtext: "regels {0} - {1} van {2}",
emptyrecords: "Geen data gevonden.",
loadtext: "laden...",
pgtext: "pagina {0} van {1}"
},
search:
{
caption: "Zoeken...",
Find: "Zoek",
Reset: "Herstellen",
odata: ["gelijk aan", "niet gelijk aan", "kleiner dan", "kleiner dan of gelijk aan", "groter dan", "groter dan of gelijk aan", "begint met", "begint niet met", "is in", "is niet in", "eindigd met", "eindigd niet met", "bevat", "bevat niet"],
groupOps: [{ op: "AND", text: "alle" }, { op: "OR", text: "een van de"}],
matchText: " match",
rulesText: " regels"
},
edit:
{
addCaption: "Nieuw",
editCaption: "Bewerken",
bSubmit: "Opslaan",
bCancel: "Annuleren",
bClose: "Sluiten",
saveData: "Er is data aangepast! Wijzigingen opslaan?",
bYes: "Ja",
bNo: "Nee",
bExit: "Sluiten",
msg:
{
required: "Veld is verplicht",
number: "Voer a.u.b. geldig nummer in",
minValue: "Waarde moet groter of gelijk zijn aan ",
maxValue: "Waarde moet kleiner of gelijks zijn aan",
email: "is geen geldig e-mailadres",
integer: "Voer a.u.b. een geldig getal in",
date: "Voer a.u.b. een geldige waarde in",
url: "is geen geldige URL. Prefix is verplicht ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view:
{
caption: "Tonen",
bClose: "Sluiten"
},
del:
{
caption: "Verwijderen",
msg: "Verwijder geselecteerde regel(s)?",
bSubmit: "Verwijderen",
bCancel: "Annuleren"
},
nav:
{
edittext: "",
edittitle: "Bewerken",
addtext: "",
addtitle: "Nieuw",
deltext: "",
deltitle: "Verwijderen",
searchtext: "",
searchtitle: "Zoeken",
refreshtext: "",
refreshtitle: "Vernieuwen",
alertcap: "Waarschuwing",
alerttext: "Selecteer a.u.b. een regel",
viewtext: "",
viewtitle: "Openen"
},
col:
{
caption: "Tonen/verbergen kolommen",
bSubmit: "OK",
bCancel: "Annuleren"
},
errors:
{
errcap: "Fout",
nourl: "Er is geen URL gedefinieerd",
norecords: "Geen data om te verwerken",
model: "Lengte van 'colNames' is niet gelijk aan 'colModel'!"
},
formatter:
{
integer:
{
thousandsSeparator: ".",
defaultValue: "0"
},
number:
{
decimalSeparator: ",",
thousandsSeparator: ".",
decimalPlaces: 2,
defaultValue: "0.00"
},
currency:
{
decimalSeparator: ",",
thousandsSeparator: ".",
decimalPlaces: 2,
prefix: "EUR ",
suffix: "",
defaultValue: "0.00"
},
date:
{
dayNames: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za", "Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"],
monthNames: ["Jan", "Feb", "Maa", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "October", "November", "December"],
AmPm: ["am", "pm", "AM", "PM"],
S: function(b) {
return b < 11 || b > 13 ? ["st", "nd", "rd", "th"][Math.min((b - 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 d F Y G:i:s",
MonthDay: "d F",
ShortTime: "G:i",
LongTime: "G:i:s",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit: false
},
baseLinkUrl: "",
showAction: "",
target: "",
checkbox:
{
disabled: true
},
idName: "id"
}
}
})(jQuery); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-nl.js | JavaScript | art | 5,258 |
;(function($){
/**
* jqGrid Danish Translation
* Kaare Rasmussen kjs@jasonic.dk
* http://jasonic.dk/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 = {
defaults : {
recordtext: "View {0} - {1} of {2}",
emptyrecords: "No records to view",
loadtext: "Loading...",
pgtext : "Page {0} of {1}"
},
search : {
caption: "Søg...",
Find: "Find",
Reset: "Nulstil",
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "Tilføj",
editCaption: "Ret",
bSubmit: "Send",
bCancel: "Annuller",
bClose: "Luk",
saveData: "Data has been changed! Save changes?",
bYes : "Yes",
bNo : "No",
bExit : "Cancel",
msg: {
required:"Felt er nødvendigt",
number:"Indtast venligst et validt tal",
minValue:"værdi skal være større end eller lig med",
maxValue:"værdi skal være mindre end eller lig med",
email: "er ikke en valid email",
integer: "Indtast venligst et validt heltalt",
date: "Indtast venligst en valid datoværdi",
url: "is not a valid URL. Prefix required ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "View Record",
bClose: "Close"
},
del : {
caption: "Slet",
msg: "Slet valgte række(r)?",
bSubmit: "Slet",
bCancel: "Annuller"
},
nav : {
edittext: " ",
edittitle: "Rediger valgte række",
addtext:" ",
addtitle: "Tilføj ny række",
deltext: " ",
deltitle: "Slet valgte række",
searchtext: " ",
searchtitle: "Find poster",
refreshtext: "",
refreshtitle: "Indlæs igen",
alertcap: "Advarsel",
alerttext: "Vælg venligst række",
viewtext: "",
viewtitle: "View selected row"
},
col : {
caption: "Vis/skjul kolonner",
bSubmit: "Send",
bCancel: "Annuller"
},
errors : {
errcap : "Fejl",
nourl : "Ingel url valgt",
norecords: "Ingen poster at behandle",
model : "colNames og colModel har ikke samme længde!"
},
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: [
"Søn", "Man", "Tirs", "Ons", "Tors", "Fre", "Lør",
"Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"
],
monthNames: [
"Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec",
"Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"
],
AmPm : ["","","",""],
S: function (j) {return '.'},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "j/n/Y",
LongDate: "l d. F Y",
FullDateTime: "l d F Y G:i:s",
MonthDay: "d. F",
ShortTime: "G:i",
LongTime: "G:i:s",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
// DK
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-dk.js | JavaScript | art | 4,002 |
;(function ($) {
/**
* jqGrid Persian Translation
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults: {
recordtext: "نمابش {0} - {1} از {2}",
emptyrecords: "رکوردی یافت نشد",
loadtext: "بارگزاري...",
pgtext: "صفحه {0} از {1}"
},
search: {
caption: "جستجو...",
Find: "يافته ها",
Reset: "از نو",
odata: ['برابر', 'نا برابر', 'به', 'کوچکتر', 'از', 'بزرگتر', 'شروع با', 'شروع نشود با', 'نباشد', 'عضو این نباشد', 'اتمام با', 'تمام نشود با', 'حاوی', 'نباشد حاوی'],
groupOps: [{
op: "AND",
text: "کل"
},
{
op: "OR",
text: "مجموع"
}],
matchText: " حاوی",
rulesText: " اطلاعات"
},
edit: {
addCaption: "اضافه کردن رکورد",
editCaption: "ويرايش رکورد",
bSubmit: "ثبت",
bCancel: "انصراف",
bClose: "بستن",
saveData: "دیتا تعییر کرد! ذخیره شود؟",
bYes: "بله",
bNo: "خیر",
bExit: "انصراف",
msg: {
required: "فيلدها بايد ختما پر شوند",
number: "لطفا عدد وعتبر وارد کنيد",
minValue: "مقدار وارد شده بايد بزرگتر يا مساوي با",
maxValue: "مقدار وارد شده بايد کوچکتر يا مساوي",
email: "پست الکترونيک وارد شده معتبر نيست",
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: "هيچ آدرسي تنظيم نشده است",
norecords: "هيچ رکوردي براي پردازش موجود نيست",
model: "طول نام ستون ها محالف ستون هاي مدل مي باشد!"
},
formatter: {
integer: {
thousandsSeparator: " ",
defaultValue: "0"
},
number: {
decimalSeparator: ".",
thousandsSeparator: " ",
decimalPlaces: 2,
defaultValue: "0.00"
},
currency: {
decimalSeparator: ".",
thousandsSeparator: " ",
decimalPlaces: 2,
prefix: "",
suffix: "",
defaultValue: "0"
},
date: {
dayNames: ["يک", "دو", "سه", "چهار", "پنج", "جمع", "شنب", "يکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"],
monthNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "ژانويه", "فوريه", "مارس", "آوريل", "مه", "ژوئن", "ژوئيه", "اوت", "سپتامبر", "اکتبر", "نوامبر", "December"],
AmPm: ["ب.ظ", "ب.ظ", "ق.ظ", "ق.ظ"],
S: function (b) {
return b < 11 || b > 13 ? ["st", "nd", "rd", "th"][Math.min((b - 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: "نمايش",
target: "",
checkbox: {
disabled: true
},
idName: "id"
}
}
})(jQuery); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-fa.js | JavaScript | art | 6,408 |
;(function($){
/**
* jqGrid Brazilian-Portuguese Translation
* Sergio Righi sergio.righi@gmail.com
* http://curve.com.br
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Ver {0} - {1} of {2}",
emptyrecords: "Nenhum registro para visualizar",
loadtext: "Carregando...",
pgtext : "Página {0} de {1}"
},
search : {
caption: "Procurar...",
Find: "Procurar",
Reset: "Resetar",
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
matchText: " iguala",
rulesText: " regras"
},
edit : {
addCaption: "Incluir",
editCaption: "Alterar",
bSubmit: "Enviar",
bCancel: "Cancelar",
bClose: "Fechar",
saveData: "Os dados foram alterados! Salvar alterações?",
bYes : "Sim",
bNo : "Não",
bExit : "Cancelar",
msg: {
required:"Campo obrigatório",
number:"Por favor, informe um número válido",
minValue:"valor deve ser igual ou maior que ",
maxValue:"valor deve ser menor ou igual a",
email: "este e-mail não é válido",
integer: "Por favor, informe um valor inteiro",
date: "Por favor, informe uma data válida",
url: "não é uma URL válida. Prefixo obrigatório ('http://' or 'https://')",
nodefined : " não está definido!",
novalue : " um valor de retorno é obrigatório!",
customarray : "Função customizada deve retornar um array!",
customfcheck : "Função customizada deve estar presente em caso de validação customizada!"
}
},
view : {
caption: "Ver Registro",
bClose: "Fechar"
},
del : {
caption: "Apagar",
msg: "Apagar registros selecionado(s)?",
bSubmit: "Apagar",
bCancel: "Cancelar"
},
nav : {
edittext: " ",
edittitle: "Alterar registro selecionado",
addtext:" ",
addtitle: "Incluir novo registro",
deltext: " ",
deltitle: "Apagar registro selecionado",
searchtext: " ",
searchtitle: "Procurar registros",
refreshtext: "",
refreshtitle: "Recarrgando Tabela",
alertcap: "Aviso",
alerttext: "Por favor, selecione um registro",
viewtext: "",
viewtitle: "Ver linha selecionada"
},
col : {
caption: "Mostrar/Esconder Colunas",
bSubmit: "Enviar",
bCancel: "Cancelar"
},
errors : {
errcap : "Erro",
nourl : "Nenhuma URL defenida",
norecords: "Sem registros para exibir",
model : "Comprimento de colNames <> colModel!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
currency : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, prefix: "R$ ", suffix:"", defaultValue: '0,00'},
date : {
dayNames: [
"Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb",
"Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"
],
monthNames: [
"Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez",
"Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return j < 11 || j > 13 ? ['º', 'º', 'º', 'º'][Math.min((j - 1) % 10, 3)] : 'º'},
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-pt-br.js | JavaScript | art | 4,263 |
;(function($){
/**
* jqGrid Turkish Translation
* Erhan Gündoğan (erhan@trposta.net)
* http://blog.zakkum.com
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "{0}-{1} listeleniyor. Toplam:{2}",
emptyrecords: "Kayıt bulunamadı",
loadtext: "Yükleniyor...",
pgtext : "{0}/{1}. Sayfa"
},
search : {
caption: "Arama...",
Find: "Bul",
Reset: "Temizle",
odata : ['eşit', 'eşit değil', 'daha az', 'daha az veya eşit', 'daha fazla', 'daha fazla veya eşit', 'ile başlayan', 'ile başlamayan', 'içinde', 'içinde değil', 'ile biten', 'ile bitmeyen', 'içeren', 'içermeyen'],
groupOps: [ { op: "VE", text: "tüm" }, { op: "VEYA", text: "herhangi" } ],
matchText: " uyan",
rulesText: " kurallar"
},
edit : {
addCaption: "Kayıt Ekle",
editCaption: "Kayıt Düzenle",
bSubmit: "Gönder",
bCancel: "İptal",
bClose: "Kapat",
saveData: "Veriler değişti! Kayıt edilsin mi?",
bYes : "Evet",
bNo : "Hayıt",
bExit : "İptal",
msg: {
required:"Alan gerekli",
number:"Lütfen bir numara giriniz",
minValue:"girilen değer daha büyük ya da buna eşit olmalıdır",
maxValue:"girilen değer daha küçük ya da buna eşit olmalıdır",
email: "geçerli bir e-posta adresi değildir",
integer: "Lütfen bir tamsayı giriniz",
url: "Geçerli bir URL değil. ('http://' or 'https://') ön eki gerekli.",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "Kayıt Görüntüle",
bClose: "Kapat"
},
del : {
caption: "Sil",
msg: "Seçilen kayıtlar silinsin mi?",
bSubmit: "Sil",
bCancel: "İptal"
},
nav : {
edittext: " ",
edittitle: "Seçili satırı düzenle",
addtext:" ",
addtitle: "Yeni satır ekle",
deltext: " ",
deltitle: "Seçili satırı sil",
searchtext: " ",
searchtitle: "Kayıtları bul",
refreshtext: "",
refreshtitle: "Tabloyu yenile",
alertcap: "Uyarı",
alerttext: "Lütfen bir satır seçiniz",
viewtext: "",
viewtitle: "Seçilen satırı görüntüle"
},
col : {
caption: "Sütunları göster/gizle",
bSubmit: "Gönder",
bCancel: "İptal"
},
errors : {
errcap : "Hata",
nourl : "Bir url yapılandırılmamış",
norecords: "İşlem yapılacak bir kayıt yok",
model : "colNames uzunluğu <> 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: [
"Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts",
"Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"
],
monthNames: [
"Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara",
"Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"
],
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-tr.js | JavaScript | art | 4,212 |
;(function($){
/**
* jqGrid Danish Translation
* Aesiras A/S
* http://www.aesiras.dk
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Vis {0} - {1} of {2}",
emptyrecords: "Ingen linjer fundet",
loadtext: "Henter...",
pgtext : "Side {0} af {1}"
},
search : {
caption: "Søg...",
Find: "Find",
Reset: "Nulstil",
odata : ['lig', 'forskellige fra', 'mindre', 'mindre eller lig','større','større eller lig', 'begynder med','begynder ikke med','findes i','findes ikke i','ender med','ender ikke med','indeholder','indeholder ikke'],
groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
matchText: " lig",
rulesText: " regler"
},
edit : {
addCaption: "Tilføj",
editCaption: "Ret",
bSubmit: "Send",
bCancel: "Annuller",
bClose: "Luk",
saveData: "Data er ændret. Gem data?",
bYes : "Ja",
bNo : "Nej",
bExit : "Fortryd",
msg: {
required:"Felt er nødvendigt",
number:"Indtast venligst et validt tal",
minValue:"værdi skal være større end eller lig med",
maxValue:"værdi skal være mindre end eller lig med",
email: "er ikke en gyldig email",
integer: "Indtast venligst et gyldigt heltal",
date: "Indtast venligst en gyldig datoværdi",
url: "er ugyldig URL. Prefix mangler ('http://' or 'https://')",
nodefined : " er ikke defineret!",
novalue : " returværdi kræves!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "Vis linje",
bClose: "Luk"
},
del : {
caption: "Slet",
msg: "Slet valgte linje(r)?",
bSubmit: "Slet",
bCancel: "Fortryd"
},
nav : {
edittext: " ",
edittitle: "Rediger valgte linje",
addtext:" ",
addtitle: "Tilføj ny linje",
deltext: " ",
deltitle: "Slet valgte linje",
searchtext: " ",
searchtitle: "Find linjer",
refreshtext: "",
refreshtitle: "Indlæs igen",
alertcap: "Advarsel",
alerttext: "Vælg venligst linje",
viewtext: "",
viewtitle: "Vis valgte linje"
},
col : {
caption: "Vis/skjul kolonner",
bSubmit: "Opdatere",
bCancel: "Fortryd"
},
errors : {
errcap : "Fejl",
nourl : "Ingen url valgt",
norecords: "Ingen linjer at behandle",
model : "colNames og colModel har ikke samme længde!"
},
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: [
"Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør",
"Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"
],
monthNames: [
"Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec",
"Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"
],
AmPm : ["","","",""],
S: function (j) {return '.'},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "j/n/Y",
LongDate: "l d. F Y",
FullDateTime: "l d F Y G:i:s",
MonthDay: "d. F",
ShortTime: "G:i",
LongTime: "G:i:s",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
// DA
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-da.js | JavaScript | art | 3,969 |
;(function($){
/**
* jqGrid Romanian Translation
* Alexandru Emil Lupu contact@alecslupu.ro
* http://www.alecslupu.ro/
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Vizualizare {0} - {1} din {2}",
emptyrecords: "Nu există înregistrări de vizualizat",
loadtext: "Încărcare...",
pgtext : "Pagina {0} din {1}"
},
search : {
caption: "Caută...",
Find: "Caută",
Reset: "Resetare",
odata : ['egal', 'diferit', 'mai mic', 'mai mic sau egal','mai mare','mai mare sau egal', 'începe cu','nu începe cu','se găsește în','nu se găsește în','se termină cu','nu se termină cu','conține',''],
groupOps: [ { op: "AND", text: "toate" }, { op: "OR", text: "oricare" } ],
matchText: " găsite",
rulesText: " reguli"
},
edit : {
addCaption: "Adăugare înregistrare",
editCaption: "Modificare înregistrare",
bSubmit: "Salvează",
bCancel: "Anulare",
bClose: "Închide",
saveData: "Informațiile au fost modificate! Salvați modificările?",
bYes : "Da",
bNo : "Nu",
bExit : "Anulare",
msg: {
required:"Câmpul este obligatoriu",
number:"Vă rugăm introduceți un număr valid",
minValue:"valoarea trebuie sa fie mai mare sau egală cu",
maxValue:"valoarea trebuie sa fie mai mică sau egală cu",
email: "nu este o adresă de e-mail validă",
integer: "Vă rugăm introduceți un număr valid",
date: "Vă rugăm să introduceți o dată validă",
url: "Nu este un URL valid. Prefixul este necesar('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "Vizualizare înregistrare",
bClose: "Închidere"
},
del : {
caption: "Ștegere",
msg: "Ștergeți înregistrarea (înregistrările) selectate?",
bSubmit: "Șterge",
bCancel: "Anulare"
},
nav : {
edittext: "",
edittitle: "Modifică rândul selectat",
addtext:"",
addtitle: "Adaugă rând nou",
deltext: "",
deltitle: "Șterge rândul selectat",
searchtext: "",
searchtitle: "Căutare înregistrări",
refreshtext: "",
refreshtitle: "Reîncarcare Grid",
alertcap: "Avertisment",
alerttext: "Vă rugăm să selectați un rând",
viewtext: "",
viewtitle: "Vizualizează rândul selectat"
},
col : {
caption: "Arată/Ascunde coloanele",
bSubmit: "Salvează",
bCancel: "Anulare"
},
errors : {
errcap : "Eroare",
nourl : "Niciun url nu este setat",
norecords: "Nu sunt înregistrări de procesat",
model : "Lungimea 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: [
"Dum", "Lun", "Mar", "Mie", "Joi", "Vin", "Sâm",
"Duminică", "Luni", "Marți", "Miercuri", "Joi", "Vineri", "Sâmbătă"
],
monthNames: [
"Ian", "Feb", "Mar", "Apr", "Mai", "Iun", "Iul", "Aug", "Sep", "Oct", "Noi", "Dec",
"Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"
],
AmPm : ["am","pm","AM","PM"],
/*
Here is a problem in romanian:
M / F
1st = primul / prima
2nd = Al doilea / A doua
3rd = Al treilea / A treia
4th = Al patrulea/ A patra
5th = Al cincilea / A cincea
6th = Al șaselea / A șasea
7th = Al șaptelea / A șaptea
....
*/
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-ro.js | JavaScript | art | 4,463 |
;(function($){
/**
* jqGrid Greek (el) Translation
* Alex Cicovic
* http://www.alexcicovic.com
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "View {0} - {1} of {2}",
emptyrecords: "No records to view",
loadtext: "Φόρτωση...",
pgtext : "Page {0} of {1}"
},
search : {
caption: "Αναζήτηση...",
Find: "Εύρεση",
Reset: "Επαναφορά",
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "Εισαγωγή Εγγραφής",
editCaption: "Επεξεργασία Εγγραφής",
bSubmit: "Καταχώρηση",
bCancel: "Άκυρο",
bClose: "Κλείσιμο",
saveData: "Data has been changed! Save changes?",
bYes : "Yes",
bNo : "No",
bExit : "Cancel",
msg: {
required:"Το πεδίο είναι απαραίτητο",
number:"Το πεδίο δέχεται μόνο αριθμούς",
minValue:"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση του ",
maxValue:"Η τιμή πρέπει να είναι μικρότερη ή ίση του ",
email: "Η διεύθυνση e-mail δεν είναι έγκυρη",
integer: "Το πεδίο δέχεται μόνο ακέραιους αριθμούς",
url: "is not a valid URL. Prefix required ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "View Record",
bClose: "Close"
},
del : {
caption: "Διαγραφή",
msg: "Διαγραφή των επιλεγμένων εγγραφών;",
bSubmit: "Ναι",
bCancel: "Άκυρο"
},
nav : {
edittext: " ",
edittitle: "Επεξεργασία επιλεγμένης εγγραφής",
addtext:" ",
addtitle: "Εισαγωγή νέας εγγραφής",
deltext: " ",
deltitle: "Διαγραφή επιλεγμένης εγγραφής",
searchtext: " ",
searchtitle: "Εύρεση Εγγραφών",
refreshtext: "",
refreshtitle: "Ανανέωση Πίνακα",
alertcap: "Προσοχή",
alerttext: "Δεν έχετε επιλέξει εγγραφή",
viewtext: "",
viewtitle: "View selected row"
},
col : {
caption: "Εμφάνιση / Απόκρυψη Στηλών",
bSubmit: "ΟΚ",
bCancel: "Άκυρο"
},
errors : {
errcap : "Σφάλμα",
nourl : "Δεν έχει δοθεί διεύθυνση χειρισμού για τη συγκεκριμένη ενέργεια",
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 : ["πμ","μμ","ΠΜ","ΜΜ"],
S: function (j) {return j == 1 || j > 1 ? ['η'][Math.min((j - 1) % 10, 3)] : ''},
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-el.js | JavaScript | art | 5,025 |
;(function($){
/**
* jqGrid Icelandic Translation
* jtm@hi.is Univercity of Iceland
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "View {0} - {1} of {2}",
emptyrecords: "No records to view",
loadtext: "Hleður...",
pgtext : "Page {0} of {1}"
},
search : {
caption: "Leita...",
Find: "Leita",
Reset: "Endursetja",
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "Add Record",
editCaption: "Edit Record",
bSubmit: "Vista",
bCancel: "Hætta við",
bClose: "Loka",
saveData: "Data has been changed! Save changes?",
bYes : "Yes",
bNo : "No",
bExit : "Cancel",
msg: {
required:"Reitur er nauðsynlegur",
number:"Vinsamlega settu inn tölu",
minValue:"gildi verður að vera meira en eða jafnt og ",
maxValue:"gildi verður að vera minna en eða jafnt og ",
email: "er ekki löglegt email",
integer: "Vinsamlega settu inn tölu",
date: "Please, enter valid date value",
url: "is not a valid URL. Prefix required ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "View Record",
bClose: "Close"
},
del : {
caption: "Eyða",
msg: "Eyða völdum færslum ?",
bSubmit: "Eyða",
bCancel: "Hætta við"
},
nav : {
edittext: " ",
edittitle: "Breyta færslu",
addtext:" ",
addtitle: "Ný færsla",
deltext: " ",
deltitle: "Eyða færslu",
searchtext: " ",
searchtitle: "Leita",
refreshtext: "",
refreshtitle: "Endurhlaða",
alertcap: "Viðvörun",
alerttext: "Vinsamlega veldu færslu",
viewtext: "",
viewtitle: "View selected row"
},
col : {
caption: "Sýna / fela dálka",
bSubmit: "Vista",
bCancel: "Hætta við"
},
errors : {
errcap : "Villa",
nourl : "Vantar slóð",
norecords: "Engar færslur valdar",
model : "Length of 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: [
"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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-is.js | JavaScript | art | 4,056 |
;(function($){
/**
* jqGrid Chinese Translation for v3.6
* waiting 2010.01.18
* http://waiting.javaeye.com/
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* update 2010.05.04
* add double u3000 SPACE for search:odata to fix SEARCH box display err when narrow width from only use of eq/ne/cn/in/lt/gt operator under IE6/7
**/
$.jgrid = {
defaults : {
recordtext: "{0} - {1}\u3000共 {2} 条", // 共字前是全角空格
emptyrecords: "无数据显示",
loadtext: "读取中...",
pgtext : " {0} 共 {1} 页"
},
search : {
caption: "搜索...",
Find: "查找",
Reset: "重置",
odata : ['等于\u3000\u3000', '不等\u3000\u3000', '小于\u3000\u3000', '小于等于','大于\u3000\u3000','大于等于',
'开始于','不开始于','属于\u3000\u3000','不属于','结束于','不结束于','包含\u3000\u3000','不包含'],
groupOps: [ { op: "AND", text: "所有" }, { op: "OR", text: "任一" } ],
matchText: " 匹配",
rulesText: " 规则"
},
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 : "Custom function should be present in case of custom checking!"
}
},
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: [
"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: 'm-d-Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "Y/j/n",
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-cn.js | JavaScript | art | 4,022 |
;(function($){
/**
* jqGrid Japanese Translation
* OKADA Yoshitada okada.dev@sth.jp
* 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 = {
defaults : {
recordtext: "View {0} - {1} of {2}",
emptyrecords: "No records to view",
loadtext: "\u8aad\u307f\u8fbc\u307f\u4e2d...",
pgtext : "Page {0} of {1}"
},
search : {
caption: "\u691c\u7d22...",
Find: "\u691c\u7d22",
Reset: "\u30ea\u30bb\u30c3\u30c8",
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "\u30ec\u30b3\u30fc\u30c9\u8ffd\u52a0",
editCaption: "\u30ec\u30b3\u30fc\u30c9\u7de8\u96c6",
bSubmit: "\u9001\u4fe1",
bCancel: "\u30ad\u30e3\u30f3\u30bb\u30eb",
bClose: "\u9589\u3058\u308b",
saveData: "Data has been changed! Save changes?",
bYes : "Yes",
bNo : "No",
bExit : "Cancel",
msg: {
required:"\u3053\u306e\u9805\u76ee\u306f\u5fc5\u9808\u3067\u3059\u3002",
number:"\u6b63\u3057\u3044\u6570\u5024\u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
minValue:"\u6b21\u306e\u5024\u4ee5\u4e0a\u3067\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
maxValue:"\u6b21\u306e\u5024\u4ee5\u4e0b\u3067\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
email: "e-mail\u304c\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002",
integer: "\u6b63\u3057\u3044\u6574\u6570\u5024\u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
date: "\u6b63\u3057\u3044\u5024\u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
url: "is not a valid URL. Prefix required ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "View Record",
bClose: "Close"
},
del : {
caption: "\u524a\u9664",
msg: "\u9078\u629e\u3057\u305f\u30ec\u30b3\u30fc\u30c9\u3092\u524a\u9664\u3057\u307e\u3059\u304b\uff1f",
bSubmit: "\u524a\u9664",
bCancel: "\u30ad\u30e3\u30f3\u30bb\u30eb"
},
nav : {
edittext: " ",
edittitle: "\u9078\u629e\u3057\u305f\u884c\u3092\u7de8\u96c6",
addtext:" ",
addtitle: "\u884c\u3092\u65b0\u898f\u8ffd\u52a0",
deltext: " ",
deltitle: "\u9078\u629e\u3057\u305f\u884c\u3092\u524a\u9664",
searchtext: " ",
searchtitle: "\u30ec\u30b3\u30fc\u30c9\u691c\u7d22",
refreshtext: "",
refreshtitle: "\u30b0\u30ea\u30c3\u30c9\u3092\u30ea\u30ed\u30fc\u30c9",
alertcap: "\u8b66\u544a",
alerttext: "\u884c\u3092\u9078\u629e\u3057\u3066\u4e0b\u3055\u3044\u3002",
viewtext: "",
viewtitle: "View selected row"
},
col : {
caption: "\u5217\u3092\u8868\u793a\uff0f\u96a0\u3059",
bSubmit: "\u9001\u4fe1",
bCancel: "\u30ad\u30e3\u30f3\u30bb\u30eb"
},
errors : {
errcap : "\u30a8\u30e9\u30fc",
nourl : "URL\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002",
norecords: "\u51e6\u7406\u5bfe\u8c61\u306e\u30ec\u30b3\u30fc\u30c9\u304c\u3042\u308a\u307e\u305b\u3093\u3002",
model : "colNames\u306e\u9577\u3055\u304ccolModel\u3068\u4e00\u81f4\u3057\u307e\u305b\u3093\u3002"
},
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: [
"\u65e5", "\u6708", "\u706b", "\u6c34", "\u6728", "\u91d1", "\u571f",
"\u65e5", "\u6708", "\u706b", "\u6c34", "\u6728", "\u91d1", "\u571f"
],
monthNames: [
"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
"1\u6708", "2\u6708", "3\u6708", "4\u6708", "5\u6708", "6\u6708", "7\u6708", "8\u6708", "9\u6708", "10\u6708", "11\u6708", "12\u6708"
],
AmPm : ["am","pm","AM","PM"],
S: "\u756a\u76ee",
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-jp.js | JavaScript | art | 5,035 |
;(function($){
/**
* jqGrid Bulgarian 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 = {
defaults : {
recordtext: "{0} - {1} от {2}",
emptyrecords: "Няма запис(и)",
loadtext: "Зареждам...",
pgtext : "Стр. {0} от {1}"
},
search : {
caption: "Търсене...",
Find: "Намери",
Reset: "Изчисти",
odata : ['равно', 'различно', 'по-малко', 'по-малко или=','по-голямо','по-голямо или =', 'започва с','не започва с','се намира в','не се намира в','завършва с','не завършава с','съдържа', 'не съдържа' ],
groupOps: [ { op: "AND", text: " И " }, { op: "OR", text: "ИЛИ" } ],
matchText: " включи",
rulesText: " клауза"
},
edit : {
addCaption: "Нов Запис",
editCaption: "Редакция Запис",
bSubmit: "Запиши",
bCancel: "Изход",
bClose: "Затвори",
saveData: "Данните са променени! Да съхраня ли промените?",
bYes : "Да",
bNo : "Не",
bExit : "Отказ",
msg: {
required:"Полето е задължително",
number:"Въведете валидно число!",
minValue:"стойността трябва да е по-голяма или равна от",
maxValue:"стойността трябва да е по-малка или равна от",
email: "не е валиден ел. адрес",
integer: "Въведете валидно цяло число",
date: "Въведете валидна дата",
url: "e невалиден 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 : "Модела не съответства на имената!"
},
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 : ["","","",""],
S: function (j) {
if(j==7 || j==8 || j== 27 || j== 28) {
return 'ми';
}
return ['ви', 'ри', 'ти'][Math.min((j - 1) % 10, 2)];
},
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-bg.js | JavaScript | art | 4,967 |
;(function($){
/**
* jqGrid Spanish Translation
* Traduccion jqGrid en Español por Yamil Bracho
* Traduccion corregida y ampliada por Faserline, S.L.
* http://www.faserline.com
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Mostrando {0} - {1} de {2}",
emptyrecords: "Sin registros que mostrar",
loadtext: "Cargando...",
pgtext : "Página {0} de {1}"
},
search : {
caption: "Búsqueda...",
Find: "Buscar",
Reset: "Limpiar",
odata : ['igual ', 'no igual a', 'menor que', 'menor o igual que','mayor que','mayor o igual a', 'empiece por','no empiece por','está en','no está en','termina por','no termina por','contiene','no contiene'],
groupOps: [ { op: "AND", text: "todo" }, { op: "OR", text: "cualquier" } ],
matchText: " match",
rulesText: " reglas"
},
edit : {
addCaption: "Agregar registro",
editCaption: "Modificar registro",
bSubmit: "Guardar",
bCancel: "Cancelar",
bClose: "Cerrar",
saveData: "Los datos han cambiado. ¿Guardar cambios?",
bYes : "Yes",
bNo : "No",
bExit : "Cancel",
msg: {
required:"Campo obligatorio",
number:"Introduzca un número",
minValue:"El valor debe ser mayor o igual a ",
maxValue:"El valor debe ser menor o igual a ",
email: "no es una dirección de correo válida",
integer: "Introduzca un valor entero",
date: "Introduza una fecha correcta ",
url: "no es una URL válida. Prefijo requerido ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "Consultar registro",
bClose: "Cerrar"
},
del : {
caption: "Eliminar",
msg: "¿Desea eliminar los registros seleccionados?",
bSubmit: "Eliminar",
bCancel: "Cancelar"
},
nav : {
edittext: " ",
edittitle: "Modificar fila seleccionada",
addtext:" ",
addtitle: "Agregar nueva fila",
deltext: " ",
deltitle: "Eliminar fila seleccionada",
searchtext: " ",
searchtitle: "Buscar información",
refreshtext: "",
refreshtitle: "Recargar datos",
alertcap: "Aviso",
alerttext: "Seleccione una fila",
viewtext: "",
viewtitle: "Ver fila seleccionada"
},
col : {
caption: "Mostrar/ocultar columnas",
bSubmit: "Enviar",
bCancel: "Cancelar"
},
errors : {
errcap : "Error",
nourl : "No se ha especificado una URL",
norecords: "No hay datos para procesar",
model : "Las columnas de nombres son diferentes de las columnas de modelo"
},
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: [
"Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa",
"Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado"
],
monthNames: [
"Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic",
"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"
],
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-sp.js | JavaScript | art | 4,315 |
;(function($){
/**
* jqGrid Japanese Translation
* OKADA Yoshitada okada.dev@sth.jp
* 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 = {
defaults : {
recordtext: "{2} \u4EF6\u4E2D {0} - {1} \u3092\u8868\u793A ",
emptyrecords: "\u8868\u793A\u3059\u308B\u30EC\u30B3\u30FC\u30C9\u304C\u3042\u308A\u307E\u305B\u3093",
loadtext: "\u8aad\u307f\u8fbc\u307f\u4e2d...",
pgtext : "{1} \u30DA\u30FC\u30B8\u4E2D {0} \u30DA\u30FC\u30B8\u76EE "
},
search : {
caption: "\u691c\u7d22...",
Find: "\u691c\u7d22",
Reset: "\u30ea\u30bb\u30c3\u30c8",
odata: ["\u6B21\u306B\u7B49\u3057\u3044", "\u6B21\u306B\u7B49\u3057\u304F\u306A\u3044",
"\u6B21\u3088\u308A\u5C0F\u3055\u3044", "\u6B21\u306B\u7B49\u3057\u3044\u304B\u5C0F\u3055\u3044",
"\u6B21\u3088\u308A\u5927\u304D\u3044", "\u6B21\u306B\u7B49\u3057\u3044\u304B\u5927\u304D\u3044",
"\u6B21\u3067\u59CB\u307E\u308B", "\u6B21\u3067\u59CB\u307E\u3089\u306A\u3044",
"\u6B21\u306B\u542B\u307E\u308C\u308B", "\u6B21\u306B\u542B\u307E\u308C\u306A\u3044",
"\u6B21\u3067\u7D42\u308F\u308B", "\u6B21\u3067\u7D42\u308F\u3089\u306A\u3044",
"\u6B21\u3092\u542B\u3080", "\u6B21\u3092\u542B\u307E\u306A\u3044"],
groupOps: [{
op: "AND",
text: "\u3059\u3079\u3066\u306E"
},
{
op: "OR",
text: "\u3044\u305A\u308C\u304B\u306E"
}],
matchText: " \u6B21\u306E",
rulesText: " \u6761\u4EF6\u3092\u6E80\u305F\u3059"
},
edit : {
addCaption: "\u30ec\u30b3\u30fc\u30c9\u8ffd\u52a0",
editCaption: "\u30ec\u30b3\u30fc\u30c9\u7de8\u96c6",
bSubmit: "\u9001\u4fe1",
bCancel: "\u30ad\u30e3\u30f3\u30bb\u30eb",
bClose: "\u9589\u3058\u308b",
saveData: "\u30C7\u30FC\u30BF\u304C\u5909\u66F4\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u4FDD\u5B58\u3057\u307E\u3059\u304B\uFF1F",
bYes: "\u306F\u3044",
bNo: "\u3044\u3044\u3048",
bExit: "\u30AD\u30E3\u30F3\u30BB\u30EB",
msg: {
required:"\u3053\u306e\u9805\u76ee\u306f\u5fc5\u9808\u3067\u3059\u3002",
number:"\u6b63\u3057\u3044\u6570\u5024\u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
minValue:"\u6b21\u306e\u5024\u4ee5\u4e0a\u3067\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
maxValue:"\u6b21\u306e\u5024\u4ee5\u4e0b\u3067\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
email: "e-mail\u304c\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002",
integer: "\u6b63\u3057\u3044\u6574\u6570\u5024\u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
date: "\u6b63\u3057\u3044\u5024\u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
url: "\u306F\u6709\u52B9\u306AURL\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\20\u30D7\u30EC\u30D5\u30A3\u30C3\u30AF\u30B9\u304C\u5FC5\u8981\u3067\u3059\u3002 ('http://' \u307E\u305F\u306F 'https://')",
nodefined: " \u304C\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u305B\u3093",
novalue: " \u623B\u308A\u5024\u304C\u5FC5\u8981\u3067\u3059",
customarray: "\u30AB\u30B9\u30BF\u30E0\u95A2\u6570\u306F\u914D\u5217\u3092\u8FD4\u3059\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
customfcheck: "\u30AB\u30B9\u30BF\u30E0\u691C\u8A3C\u306B\u306F\u30AB\u30B9\u30BF\u30E0\u95A2\u6570\u304C\u5FC5\u8981\u3067\u3059"
}
},
view : {
caption: "\u30EC\u30B3\u30FC\u30C9\u3092\u8868\u793A",
bClose: "\u9589\u3058\u308B"
},
del : {
caption: "\u524a\u9664",
msg: "\u9078\u629e\u3057\u305f\u30ec\u30b3\u30fc\u30c9\u3092\u524a\u9664\u3057\u307e\u3059\u304b\uff1f",
bSubmit: "\u524a\u9664",
bCancel: "\u30ad\u30e3\u30f3\u30bb\u30eb"
},
nav : {
edittext: " ",
edittitle: "\u9078\u629e\u3057\u305f\u884c\u3092\u7de8\u96c6",
addtext:" ",
addtitle: "\u884c\u3092\u65b0\u898f\u8ffd\u52a0",
deltext: " ",
deltitle: "\u9078\u629e\u3057\u305f\u884c\u3092\u524a\u9664",
searchtext: " ",
searchtitle: "\u30ec\u30b3\u30fc\u30c9\u691c\u7d22",
refreshtext: "",
refreshtitle: "\u30b0\u30ea\u30c3\u30c9\u3092\u30ea\u30ed\u30fc\u30c9",
alertcap: "\u8b66\u544a",
alerttext: "\u884c\u3092\u9078\u629e\u3057\u3066\u4e0b\u3055\u3044\u3002",
viewtext: "",
viewtitle: "\u9078\u629E\u3057\u305F\u884C\u3092\u8868\u793A"
},
col : {
caption: "\u5217\u3092\u8868\u793a\uff0f\u96a0\u3059",
bSubmit: "\u9001\u4fe1",
bCancel: "\u30ad\u30e3\u30f3\u30bb\u30eb"
},
errors : {
errcap : "\u30a8\u30e9\u30fc",
nourl : "URL\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002",
norecords: "\u51e6\u7406\u5bfe\u8c61\u306e\u30ec\u30b3\u30fc\u30c9\u304c\u3042\u308a\u307e\u305b\u3093\u3002",
model : "colNames\u306e\u9577\u3055\u304ccolModel\u3068\u4e00\u81f4\u3057\u307e\u305b\u3093\u3002"
},
formatter : {
integer: {
thousandsSeparator: ",",
defaultValue: '0'
},
number: {
decimalSeparator: ".",
thousandsSeparator: ",",
decimalPlaces: 2,
defaultValue: '0.00'
},
currency: {
decimalSeparator: ".",
thousandsSeparator: ",",
decimalPlaces: 0,
prefix: "",
suffix: "",
defaultValue: '0'
},
date : {
dayNames: [
"\u65e5", "\u6708", "\u706b", "\u6c34", "\u6728", "\u91d1", "\u571f",
"\u65e5", "\u6708", "\u706b", "\u6c34", "\u6728", "\u91d1", "\u571f"
],
monthNames: [
"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
"1\u6708", "2\u6708", "3\u6708", "4\u6708", "5\u6708", "6\u6708", "7\u6708", "8\u6708", "9\u6708", "10\u6708", "11\u6708", "12\u6708"
],
AmPm : ["am","pm","AM","PM"],
S: "\u756a\u76ee",
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-ja.js | JavaScript | art | 6,698 |
;(function($){
/**
* jqGrid (fi) Finnish Translation
* Jukka Inkeri awot.fi 2010-05-19 Version
* http://awot.fi
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults: {
recordtext: "Rivit {0} - {1} / {2}",
emptyrecords: "Ei näytettäviä",
loadtext: "Haetaan...",
pgtext: "Sivu {0} / {1}"
},
search: {
caption: "Etsi...",
Find: "Etsi",
Reset: "Tyhjää",
odata: ['=', '<>', '<', '<=','>','>=', 'alkaa','ei ala','joukossa','ei joukossa','loppuu','ei lopu','sisältää','ei sisällä'],
groupOps: [ { op: "AND", text: "kaikki" }, { op: "OR", text: "mikä tahansa" } ],
matchText: " täytä ehdot:",
rulesText: ""
},
edit: {
addCaption: "Uusi rivi",
editCaption: "Muokkaa riviä",
bSubmit: "OK",
bCancel: "Peru",
bClose: "Sulje",
saveData: "Tietoja muutettu! Tallennetaanko?",
bYes: "K",
bNo: "E",
bExit: "Peru",
msg: {
required: "pakollinen",
number: "Anna kelvollinen nro",
minValue: "arvo oltava >= ",
maxValue: "arvo oltava <= ",
email: "virheellinen sposti ",
integer: "Anna kelvollinen kokonaisluku",
date: "Anna kelvollinen pvm",
url: "Ei ole sopiva linkki(URL). Alku oltava ('http://' tai 'https://')",
nodefined: " ei ole määritelty!",
novalue: " paluuarvo vaaditaan!",
customarray: "Custom function should return array!",
customfcheck: "Custom function should be present in case of custom checking!"
}
},
view: {
caption: "Näytä rivi",
bClose: "Sulje"
},
del: {
caption: "Poista",
msg: "Poista valitut rivit?",
bSubmit: "Poista",
bCancel: "Peru"
},
nav: {
edittext: " ",
edittitle: "Muokkaa valittu rivi",
addtext: " ",
addtitle: "Uusi rivi",
deltext: " ",
deltitle: "Poista valittu rivi",
searchtext: " ",
searchtitle: "Etsi tietoja",
refreshtext: "",
refreshtitle: "Lataa uudelleen",
alertcap: "Varoitus",
alerttext: "Valitse rivi",
viewtext: "",
viewtitle: "Näyta valitut rivit"
},
col: {
caption: "Näyta/Piilota sarakkeet",
bSubmit: "OK",
bCancel: "Peru"
},
errors : {
errcap: "Virhe",
nourl: "url asettamatta",
norecords: "Ei muokattavia tietoja",
model: "Pituus 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: [
"Su", "Ma", "Ti", "Ke", "To", "Pe", "La",
"Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"
],
monthNames: [
"Tam", "Hel", "Maa", "Huh", "Tou", "Kes", "Hei", "Elo", "Syy", "Lok", "Mar", "Jou",
"Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"
],
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: "d.m.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: '',
target: '',
checkbox: {disabled:true},
idName: 'id'
}
};
// FI
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-fi.js | JavaScript | art | 4,023 |
;(function($){
/**
* jqGrid Galician Translation
* Translated by Jorge Barreiro <yortx.barry@gmail.com>
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Amosando {0} - {1} de {2}",
emptyrecords: "Sen rexistros que amosar",
loadtext: "Cargando...",
pgtext : "Páxina {0} de {1}"
},
search : {
caption: "Búsqueda...",
Find: "Buscar",
Reset: "Limpar",
odata : ['igual ', 'diferente a', 'menor que', 'menor ou igual que','maior que','maior ou igual a', 'empece por','non empece por','está en','non está en','termina por','non termina por','contén','non contén'],
groupOps: [ { op: "AND", text: "todo" }, { op: "OR", text: "calquera" } ],
matchText: " match",
rulesText: " regras"
},
edit : {
addCaption: "Engadir rexistro",
editCaption: "Modificar rexistro",
bSubmit: "Gardar",
bCancel: "Cancelar",
bClose: "Pechar",
saveData: "Modificáronse os datos, quere gardar os cambios?",
bYes : "Si",
bNo : "Non",
bExit : "Cancelar",
msg: {
required:"Campo obrigatorio",
number:"Introduza un número",
minValue:"O valor debe ser maior ou igual a ",
maxValue:"O valor debe ser menor ou igual a ",
email: "non é un enderezo de correo válido",
integer: "Introduza un valor enteiro",
date: "Introduza unha data correcta ",
url: "non é unha URL válida. Prefixo requerido ('http://' ou 'https://')",
nodefined : " non está definido.",
novalue : " o valor de retorno é obrigatorio.",
customarray : "A función persoalizada debe devolver un array.",
customfcheck : "A función persoalizada debe estar presente no caso de ter validación persoalizada."
}
},
view : {
caption: "Consultar rexistro",
bClose: "Pechar"
},
del : {
caption: "Eliminar",
msg: "Desexa eliminar os rexistros seleccionados?",
bSubmit: "Eliminar",
bCancel: "Cancelar"
},
nav : {
edittext: " ",
edittitle: "Modificar a fila seleccionada",
addtext:" ",
addtitle: "Engadir unha nova fila",
deltext: " ",
deltitle: "Eliminar a fila seleccionada",
searchtext: " ",
searchtitle: "Buscar información",
refreshtext: "",
refreshtitle: "Recargar datos",
alertcap: "Aviso",
alerttext: "Seleccione unha fila",
viewtext: "",
viewtitle: "Ver fila seleccionada"
},
col : {
caption: "Mostrar/ocultar columnas",
bSubmit: "Enviar",
bCancel: "Cancelar"
},
errors : {
errcap : "Erro",
nourl : "Non especificou unha URL",
norecords: "Non hai datos para procesar",
model : "As columnas de nomes son diferentes das columnas de modelo"
},
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: [
"Do", "Lu", "Ma", "Me", "Xo", "Ve", "Sa",
"Domingo", "Luns", "Martes", "Mércoles", "Xoves", "Vernes", "Sábado"
],
monthNames: [
"Xan", "Feb", "Mar", "Abr", "Mai", "Xuñ", "Xul", "Ago", "Set", "Out", "Nov", "Dec",
"Xaneiro", "Febreiro", "Marzo", "Abril", "Maio", "Xuño", "Xullo", "Agosto", "Setembro", "Outubro", "Novembro", "Decembro"
],
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-gl.js | JavaScript | art | 4,285 |
;(function($){
/**
* jqGrid Serbian Translation
* Александар Миловац(Aleksandar Milovac) aleksandar.milovac@gmail.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 = {
defaults : {
recordtext: "Преглед {0} - {1} од {2}",
emptyrecords: "Не постоји ниједан запис",
loadtext: "Учитавање...",
pgtext : "Страна {0} од {1}"
},
search : {
caption: "Тражење...",
Find: "Тражи",
Reset: "Ресетуј",
odata : ['једнако', 'није једнако', 'мање', 'мање или једнако','веће','веће или једнако', 'почиње са','не почиње са','је у','није у','завршава са','не завршава са','садржи','не садржи'],
groupOps: [ { op: "И", text: "сви" }, { op: "ИЛИ", text: "сваки" } ],
matchText: " match",
rulesText: " правила"
},
edit : {
addCaption: "Додај запис",
editCaption: "Измени запис",
bSubmit: "Пошаљи",
bCancel: "Одустани",
bClose: "Затвори",
saveData: "Податак је измењен! Сачувај измене?",
bYes : "Да",
bNo : "Не",
bExit : "Одустани",
msg: {
required:"Поље је обавезно",
number:"Молим, унесите исправан број",
minValue:"вредност мора бити већа од или једнака са ",
maxValue:"вредност мора бити мања од или једнака са",
email: "није исправна имејл адреса",
integer: "Молим, унесите исправну целобројну вредност ",
date: "Молим, унесите исправан датум",
url: "није исправан УРЛ. Потребан је префикс ('http://' or 'https://')",
nodefined : " није дефинисан!",
novalue : " захтевана је повратна вредност!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
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","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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-sr.js | JavaScript | art | 5,027 |
;(function($){
/**
* jqGrid French 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 = {
defaults : {
recordtext: "Enregistrements {0} - {1} sur {2}",
emptyrecords: "Aucun enregistrement à afficher",
loadtext: "Chargement...",
pgtext : "Page {0} sur {1}"
},
search : {
caption: "Recherche...",
Find: "Chercher",
Reset: "Annuler",
odata : ['égal', 'différent', 'inférieur', 'inférieur ou égal','supérieur','supérieur ou égal', 'commence par','ne commence pas par','est dans',"n'est pas dans",'finit par','ne finit pas par','contient','ne contient pas'],
groupOps: [ { op: "AND", text: "tous" }, { op: "OR", text: "aucun" } ],
matchText: " correspondance",
rulesText: " règles"
},
edit : {
addCaption: "Ajouter",
editCaption: "Editer",
bSubmit: "Valider",
bCancel: "Annuler",
bClose: "Fermer",
saveData: "Les données ont changé ! Enregistrer les modifications ?",
bYes: "Oui",
bNo: "Non",
bExit: "Annuler",
msg: {
required: "Champ obligatoire",
number: "Saisissez un nombre correct",
minValue: "La valeur doit être supérieure ou égale à",
maxValue: "La valeur doit être inférieure ou égale à",
email: "n'est pas un email correct",
integer: "Saisissez un entier correct",
url: "n'est pas une adresse correcte. Préfixe requis ('http://' or 'https://')",
nodefined : " n'est pas défini!",
novalue : " la valeur de retour est requise!",
customarray : "Une fonction personnalisée devrait retourner un tableau (array)!",
customfcheck : "Une fonction personnalisée devrait être présente dans le cas d'une vérification personnalisée!"
}
},
view : {
caption: "Voir les enregistrement",
bClose: "Fermer"
},
del : {
caption: "Supprimer",
msg: "Supprimer les enregistrements sélectionnés ?",
bSubmit: "Supprimer",
bCancel: "Annuler"
},
nav : {
edittext: " ",
edittitle: "Editer la ligne sélectionnée",
addtext:" ",
addtitle: "Ajouter une ligne",
deltext: " ",
deltitle: "Supprimer la ligne sélectionnée",
searchtext: " ",
searchtitle: "Chercher un enregistrement",
refreshtext: "",
refreshtitle: "Recharger le tableau",
alertcap: "Avertissement",
alerttext: "Veuillez sélectionner une ligne",
viewtext: "",
viewtitle: "Afficher la ligne sélectionnée"
},
col : {
caption: "Afficher/Masquer les colonnes",
bSubmit: "Valider",
bCancel: "Annuler"
},
errors : {
errcap : "Erreur",
nourl : "Aucune adresse n'est paramétrée",
norecords: "Aucun enregistrement à traiter",
model : "Nombre de titres (colNames) <> Nombre de données (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: [
"Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam",
"Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"
],
monthNames: [
"Jan", "Fév", "Mar", "Avr", "Mai", "Jui", "Jul", "Aou", "Sep", "Oct", "Nov", "Déc",
"Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Aout", "Septembre", "Octobre", "Novembre", "Décembre"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return j == 1 ? 'er' : 'e';},
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-fr.js | JavaScript | art | 4,239 |
;(function($){
/**
* jqGrid Thai Translation
* Kittituch Manakul m.kittituch@Gmail.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 = {
defaults : {
recordtext: "แสดง {0} - {1} จาก {2}",
emptyrecords: "ไม่พบข้อมูล",
loadtext: "กำลังร้องขอข้อมูล...",
pgtext : "หน้า {0} จาก {1}"
},
search : {
caption: "กำลังค้นหา...",
Find: "ค้นหา",
Reset: "คืนค่ากลับ",
odata : ['เท่ากับ', 'ไม่เท่ากับ', 'น้อยกว่า', 'ไม่มากกว่า','มากกกว่า','ไม่น้อยกว่า', 'ขึ้นต้นด้วย','ไม่ขึ้นต้นด้วย','มีคำใดคำหนึ่งใน','ไม่มีคำใดคำหนึ่งใน','ลงท้ายด้วย','ไม่ลงท้ายด้วย','มีคำว่า','ไม่มีคำว่า'],
groupOps: [ { op: "และ", text: "ทั้งหมด" }, { op: "หรือ", text: "ใดๆ" } ],
matchText: " ตรงกันกับ",
rulesText: " ตามกฏ"
},
edit : {
addCaption: "เพิ่มข้อมูล",
editCaption: "แก้ไขข้อมูล",
bSubmit: "บันทึก",
bCancel: "ยกเลิก",
bClose: "ปิด",
saveData: "คุณต้องการบันทึการแก้ไข ใช่หรือไม่?",
bYes : "บันทึก",
bNo : "ละทิ้งการแก้ไข",
bExit : "ยกเลิก",
msg: {
required:"ข้อมูลนี้จำเป็น",
number:"กรุณากรอกหมายเลขให้ถูกต้อง",
minValue:"ค่าของข้อมูลนี้ต้องไม่น้อยกว่า",
maxValue:"ค่าของข้อมูลนี้ต้องไม่มากกว่า",
email: "อีเมลล์นี้ไม่ถูกต้อง",
integer: "กรุณากรอกเป็นจำนวนเต็ม",
date: "กรุณากรอกวันที่ให้ถูกต้อง",
url: "URL ไม่ถูกต้อง 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 : "จำนวนคอลัมน์ไม่เท่ากับจำนวนคอลัมน์โมเดล!"
},
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","AM","PM"],
S: function (j) {return ''},
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-th.js | JavaScript | art | 6,130 |
;(function($){
/**
* jqGrid Arabic Translation
*
* 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 = {
defaults : {
recordtext: "تسجيل {0} - {1} على {2}",
emptyrecords: "لا يوجد تسجيل",
loadtext: "تحميل...",
pgtext : "صفحة {0} على {1}"
},
search : {
caption: "بحث...",
Find: "بحث",
Reset: "إلغاء",
odata : ['يساوي', 'يختلف', 'أقل', 'أقل أو يساوي','أكبر','أكبر أو يساوي', 'يبدأ بـ','لا يبدأ بـ','est dans',"n'est pas dans",'ينته بـ','لا ينته بـ','يحتوي','لا يحتوي'],
groupOps: [ { op: "مع", text: "الكل" }, { op: "أو", text: "لا أحد" } ],
matchText: " توافق",
rulesText: " قواعد"
},
edit : {
addCaption: "اضافة",
editCaption: "تحديث",
bSubmit: "تثبيث",
bCancel: "إلغاء",
bClose: "غلق",
saveData: "تغيرت المعطيات هل تريد التسجيل ?",
bYes: "نعم",
bNo: "لا",
bExit: "إلغاء",
msg: {
required: "خانة إجبارية",
number: "سجل رقم صحيح",
minValue: "يجب أن تكون القيمة أكبر أو تساوي 0",
maxValue: "يجب أن تكون القيمة أقل أو تساوي 0",
email: "بريد غير صحيح",
integer: "سجل عدد طبييعي صحيح",
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 : "لا يوجد عنوان محدد",
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 : ["صباحا","مساءا","صباحا","مساءا"],
S: function (j) {return j == 1 ? 'er' : 'e';},
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-ar.js | JavaScript | art | 4,610 |
;(function($){
/**
* jqGrid Czech Translation
* Pavel Jirak pavel.jirak@jipas.cz
* doplnil Thomas Wagner xwagne01@stud.fit.vutbr.cz
* 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 = {
defaults : {
recordtext: "Zobrazeno {0} - {1} z {2} záznamů",
emptyrecords: "Nenalezeny žádné záznamy",
loadtext: "Načítám...",
pgtext : "Strana {0} z {1}"
},
search : {
caption: "Vyhledávám...",
Find: "Hledat",
Reset: "Reset",
odata : ['rovno', 'nerovono', 'menší', 'menší nebo rovno','větší', 'větší nebo rovno', 'začíná s', 'nezačíná s', 'je v', 'není v', 'končí s', 'nekončí s', 'obahuje', 'neobsahuje'],
groupOps: [ { op: "AND", text: "všech" }, { op: "OR", text: "některého z" } ],
matchText: " hledat podle",
rulesText: " pravidel"
},
edit : {
addCaption: "Přidat záznam",
editCaption: "Editace záznamu",
bSubmit: "Uložit",
bCancel: "Storno",
bClose: "Zavřít",
saveData: "Data byla změněna! Uložit změny?",
bYes : "Ano",
bNo : "Ne",
bExit : "Zrušit",
msg: {
required:"Pole je vyžadováno",
number:"Prosím, vložte validní číslo",
minValue:"hodnota musí být větší než nebo rovná ",
maxValue:"hodnota musí být menší než nebo rovná ",
email: "není validní e-mail",
integer: "Prosím, vložte celé číslo",
date: "Prosím, vložte validní datum",
url: "není platnou URL. Vyžadován prefix ('http://' or 'https://')",
nodefined : " není definován!",
novalue : " je vyžadována návratová hodnota!",
customarray : "Custom function mělá vrátit pole!",
customfcheck : "Custom function by měla být přítomna v případě custom checking!"
}
},
view : {
caption: "Zobrazit záznam",
bClose: "Zavřít"
},
del : {
caption: "Smazat",
msg: "Smazat vybraný(é) záznam(y)?",
bSubmit: "Smazat",
bCancel: "Storno"
},
nav : {
edittext: " ",
edittitle: "Editovat vybraný řádek",
addtext:" ",
addtitle: "Přidat nový řádek",
deltext: " ",
deltitle: "Smazat vybraný záznam ",
searchtext: " ",
searchtitle: "Najít záznamy",
refreshtext: "",
refreshtitle: "Obnovit tabulku",
alertcap: "Varování",
alerttext: "Prosím, vyberte řádek",
viewtext: "",
viewtitle: "Zobrazit vybraný řádek"
},
col : {
caption: "Zobrazit/Skrýt sloupce",
bSubmit: "Uložit",
bCancel: "Storno"
},
errors : {
errcap : "Chyba",
nourl : "Není nastavena url",
norecords: "Žádné záznamy ke zpracování",
model : "Délka 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: [
"Ne", "Po", "Út", "St", "Čt", "Pá", "So",
"Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"
],
monthNames: [
"Led", "Úno", "Bře", "Dub", "Kvě", "Čer", "Čvc", "Srp", "Zář", "Říj", "Lis", "Pro",
"Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"
],
AmPm : ["do","od","DO","OD"],
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-cs.js | JavaScript | art | 4,184 |
;(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 = {
defaults : {
recordtext: "View {0} - {1} of {2}",
emptyrecords: "No records to view",
loadtext: "Loading...",
pgtext : "Page {0} of {1}"
},
search : {
caption: "Search...",
Find: "Find",
Reset: "Reset",
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "Add Record",
editCaption: "Edit Record",
bSubmit: "Submit",
bCancel: "Cancel",
bClose: "Close",
saveData: "Data has been changed! Save changes?",
bYes : "Yes",
bNo : "No",
bExit : "Cancel",
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",
url: "is not a valid URL. Prefix required ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "View Record",
bClose: "Close"
},
del : {
caption: "Delete",
msg: "Delete selected record(s)?",
bSubmit: "Delete",
bCancel: "Cancel"
},
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",
viewtext: "",
viewtitle: "View selected row"
},
col : {
caption: "Select columns",
bSubmit: "Ok",
bCancel: "Cancel"
},
errors : {
errcap : "Error",
nourl : "No url is set",
norecords: "No records to process",
model : "Length of 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: [
"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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-en.js | JavaScript | art | 3,799 |
;(function($){
/**
* jqGrid Hungarian Translation
* Őrszigety Ádám udx6bs@freemail.hu
* 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 = {
defaults : {
recordtext: "Oldal {0} - {1} / {2}",
emptyrecords: "Nincs találat",
loadtext: "Betöltés...",
pgtext : "Oldal {0} / {1}"
},
search : {
caption: "Keresés...",
Find: "Keres",
Reset: "Alapértelmezett",
odata : ['egyenlő', 'nem egyenlő', 'kevesebb', 'kevesebb vagy egyenlő','nagyobb','nagyobb vagy egyenlő', 'ezzel kezdődik','nem ezzel kezdődik','tartalmaz','nem tartalmaz','végződik','nem végződik','tartalmaz','nem tartalmaz'],
groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "Új tétel",
editCaption: "Tétel szerkesztése",
bSubmit: "Mentés",
bCancel: "Mégse",
bClose: "Bezárás",
saveData: "A tétel megváltozott! Tétel mentése?",
bYes : "Igen",
bNo : "Nem",
bExit : "Mégse",
msg: {
required:"Kötelező mező",
number:"Kérjük, adjon meg egy helyes számot",
minValue:"Nagyobb vagy egyenlőnek kell lenni mint ",
maxValue:"Kisebb vagy egyenlőnek kell lennie mint",
email: "hibás emailcím",
integer: "Kérjük adjon meg egy helyes egész számot",
date: "Kérjük adjon meg egy helyes dátumot",
url: "nem helyes cím. Előtag kötelező ('http://' vagy 'https://')",
nodefined : " nem definiált!",
novalue : " visszatérési érték kötelező!!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "Tétel megtekintése",
bClose: "Bezárás"
},
del : {
caption: "Törlés",
msg: "Kiválaztott tétel(ek) törlése?",
bSubmit: "Törlés",
bCancel: "Mégse"
},
nav : {
edittext: "",
edittitle: "Tétel szerkesztése",
addtext:"",
addtitle: "Új tétel hozzáadása",
deltext: "",
deltitle: "Tétel törlése",
searchtext: "",
searchtitle: "Keresés",
refreshtext: "",
refreshtitle: "Frissítés",
alertcap: "Figyelmeztetés",
alerttext: "Kérem válasszon tételt.",
viewtext: "",
viewtitle: "Tétel megtekintése"
},
col : {
caption: "Oszlopok kiválasztása",
bSubmit: "Ok",
bCancel: "Mégse"
},
errors : {
errcap : "Hiba",
nourl : "Nincs URL beállítva",
norecords: "Nincs feldolgozásra váró tétel",
model : "colNames és colModel hossza nem egyenlő!"
},
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: [
"Va", "Hé", "Ke", "Sze", "Csü", "Pé", "Szo",
"Vasárnap", "Hétfő", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat"
],
monthNames: [
"Jan", "Feb", "Már", "Ápr", "Máj", "Jún", "Júl", "Aug", "Szep", "Okt", "Nov", "Dec",
"Január", "Február", "Március", "Áprili", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"
],
AmPm : ["de","du","DE","DU"],
S: function (j) {return '.-ik';},
srcformat: 'Y-m-d',
newformat: 'Y/m/d',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "Y/j/n",
LongDate: "Y. F hó d., l",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "a g:i",
LongTime: "a g:i:s",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "Y, F"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-hu.js | JavaScript | art | 3,973 |
;(function($){
/**
* jqGrid Slovak Translation
* Milan Cibulka
* 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 = {
defaults : {
recordtext: "Zobrazených {0} - {1} z {2} záznamov",
emptyrecords: "Neboli nájdené žiadne záznamy",
loadtext: "Načítám...",
pgtext : "Strana {0} z {1}"
},
search : {
caption: "Vyhľadávam...",
Find: "Hľadať",
Reset: "Reset",
odata : ['rovná sa', 'nerovná sa', 'menšie', 'menšie alebo rovnajúce sa','väčšie', 'väčšie alebo rovnajúce sa', 'začína s', 'nezačína s', 'je v', 'nie je v', 'končí s', 'nekončí s', 'obahuje', 'neobsahuje'],
groupOps: [ { op: "AND", text: "všetkých" }, { op: "OR", text: "niektorého z" } ],
matchText: " hľadať podla",
rulesText: " pravidiel"
},
edit : {
addCaption: "Pridať záznam",
editCaption: "Editácia záznamov",
bSubmit: "Uložiť",
bCancel: "Storno",
bClose: "Zavrieť",
saveData: "Údaje boli zmenené! Uložiť zmeny?",
bYes : "Ano",
bNo : "Nie",
bExit : "Zrušiť",
msg: {
required:"Pole je požadované",
number:"Prosím, vložte valídne číslo",
minValue:"hodnota musí býť väčšia ako alebo rovná ",
maxValue:"hodnota musí býť menšia ako alebo rovná ",
email: "nie je valídny e-mail",
integer: "Prosím, vložte celé číslo",
date: "Prosím, vložte valídny dátum",
url: "nie je platnou URL. Požadovaný prefix ('http://' alebo 'https://')",
nodefined : " nie je definovaný!",
novalue : " je vyžadovaná návratová hodnota!",
customarray : "Custom function mala vrátiť pole!",
customfcheck : "Custom function by mala byť prítomná v prípade custom checking!"
}
},
view : {
caption: "Zobraziť záznam",
bClose: "Zavrieť"
},
del : {
caption: "Zmazať",
msg: "Zmazať vybraný(é) záznam(y)?",
bSubmit: "Zmazať",
bCancel: "Storno"
},
nav : {
edittext: " ",
edittitle: "Editovať vybraný riadok",
addtext:" ",
addtitle: "Pridať nový riadek",
deltext: " ",
deltitle: "Zmazať vybraný záznam ",
searchtext: " ",
searchtitle: "Nájsť záznamy",
refreshtext: "",
refreshtitle: "Obnoviť tabuľku",
alertcap: "Varovanie",
alerttext: "Prosím, vyberte riadok",
viewtext: "",
viewtitle: "Zobraziť vybraný riadok"
},
col : {
caption: "Zobrazit/Skrýť stĺpce",
bSubmit: "Uložiť",
bCancel: "Storno"
},
errors : {
errcap : "Chyba",
nourl : "Nie je nastavená url",
norecords: "Žiadne záznamy k spracovaniu",
model : "Dĺžka 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: [
"Ne", "Po", "Ut", "St", "Št", "Pi", "So",
"Nedela", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatek", "Sobota"
],
monthNames: [
"Jan", "Feb", "Mar", "Apr", "Máj", "Jún", "Júl", "Aug", "Sep", "Okt", "Nov", "Dec",
"Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"
],
AmPm : ["do","od","DO","OD"],
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: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/i18n/grid.locale-sk.js | JavaScript | art | 4,164 |
/*
The below work is licensed under Creative Commons GNU LGPL License.
Original work:
License: http://creativecommons.org/licenses/LGPL/2.1/
Author: Stefan Goessner/2006
Web: http://goessner.net/
Modifications made:
Version: 0.9-p5
Description: Restructured code, JSLint validated (no strict whitespaces),
added handling of empty arrays, empty strings, and int/floats values.
Author: Michael Schøler/2008-01-29
Web: http://michael.hinnerup.net/blog/2008/01/26/converting-json-to-xml-and-xml-to-json/
Description: json2xml added support to convert functions as CDATA
so it will be easy to write characters that cause some problems when convert
Author: Tony Tomov
*/
/*global alert */
var xmlJsonClass = {
// Param "xml": Element or document DOM node.
// Param "tab": Tab or indent string for pretty output formatting omit or use empty string "" to supress.
// Returns: JSON string
xml2json: function(xml, tab) {
if (xml.nodeType === 9) {
// document node
xml = xml.documentElement;
}
var nws = this.removeWhite(xml);
var obj = this.toObj(nws);
var json = this.toJson(obj, xml.nodeName, "\t");
return "{\n" + tab + (tab ? json.replace(/\t/g, tab) : json.replace(/\t|\n/g, "")) + "\n}";
},
// Param "o": JavaScript object
// Param "tab": tab or indent string for pretty output formatting omit or use empty string "" to supress.
// Returns: XML string
json2xml: function(o, tab) {
var toXml = function(v, name, ind) {
var xml = "";
var i, n;
if (v instanceof Array) {
if (v.length === 0) {
xml += ind + "<"+name+">__EMPTY_ARRAY_</"+name+">\n";
}
else {
for (i = 0, n = v.length; i < n; i += 1) {
var sXml = ind + toXml(v[i], name, ind+"\t") + "\n";
xml += sXml;
}
}
}
else if (typeof(v) === "object") {
var hasChild = false;
xml += ind + "<" + name;
var m;
for (m in v) if (v.hasOwnProperty(m)) {
if (m.charAt(0) === "@") {
xml += " " + m.substr(1) + "=\"" + v[m].toString() + "\"";
}
else {
hasChild = true;
}
}
xml += hasChild ? ">" : "/>";
if (hasChild) {
for (m in v) if (v.hasOwnProperty(m)) {
if (m === "#text") {
xml += v[m];
}
else if (m === "#cdata") {
xml += "<![CDATA[" + v[m] + "]]>";
}
else if (m.charAt(0) !== "@") {
xml += toXml(v[m], m, ind+"\t");
}
}
xml += (xml.charAt(xml.length - 1) === "\n" ? ind : "") + "</" + name + ">";
}
}
else if (typeof(v) === "function") {
xml += ind + "<" + name + ">" + "<![CDATA[" + v + "]]>" + "</" + name + ">";
}
else {
if (v.toString() === "\"\"" || v.toString().length === 0) {
xml += ind + "<" + name + ">__EMPTY_STRING_</" + name + ">";
}
else {
xml += ind + "<" + name + ">" + v.toString() + "</" + name + ">";
}
}
return xml;
};
var xml = "";
var m;
for (m in o) if (o.hasOwnProperty(m)) {
xml += toXml(o[m], m, "");
}
return tab ? xml.replace(/\t/g, tab) : xml.replace(/\t|\n/g, "");
},
// Internal methods
toObj: function(xml) {
var o = {};
var FuncTest = /function/i;
if (xml.nodeType === 1) {
// element node ..
if (xml.attributes.length) {
// element with attributes ..
var i;
for (i = 0; i < xml.attributes.length; i += 1) {
o["@" + xml.attributes[i].nodeName] = (xml.attributes[i].nodeValue || "").toString();
}
}
if (xml.firstChild) {
// element has child nodes ..
var textChild = 0, cdataChild = 0, hasElementChild = false;
var n;
for (n = xml.firstChild; n; n = n.nextSibling) {
if (n.nodeType === 1) {
hasElementChild = true;
}
else if (n.nodeType === 3 && n.nodeValue.match(/[^ \f\n\r\t\v]/)) {
// non-whitespace text
textChild += 1;
}
else if (n.nodeType === 4) {
// cdata section node
cdataChild += 1;
}
}
if (hasElementChild) {
if (textChild < 2 && cdataChild < 2) {
// structured element with evtl. a single text or/and cdata node ..
this.removeWhite(xml);
for (n = xml.firstChild; n; n = n.nextSibling) {
if (n.nodeType === 3) {
// text node
o["#text"] = this.escape(n.nodeValue);
}
else if (n.nodeType === 4) {
// cdata node
if (FuncTest.test(n.nodeValue)) {
o[n.nodeName] = [o[n.nodeName], n.nodeValue];
} else {
o["#cdata"] = this.escape(n.nodeValue);
}
}
else if (o[n.nodeName]) {
// multiple occurence of element ..
if (o[n.nodeName] instanceof Array) {
o[n.nodeName][o[n.nodeName].length] = this.toObj(n);
}
else {
o[n.nodeName] = [o[n.nodeName], this.toObj(n)];
}
}
else {
// first occurence of element ..
o[n.nodeName] = this.toObj(n);
}
}
}
else {
// mixed content
if (!xml.attributes.length) {
o = this.escape(this.innerXml(xml));
}
else {
o["#text"] = this.escape(this.innerXml(xml));
}
}
}
else if (textChild) {
// pure text
if (!xml.attributes.length) {
o = this.escape(this.innerXml(xml));
if (o === "__EMPTY_ARRAY_") {
o = "[]";
} else if (o === "__EMPTY_STRING_") {
o = "";
}
}
else {
o["#text"] = this.escape(this.innerXml(xml));
}
}
else if (cdataChild) {
// cdata
if (cdataChild > 1) {
o = this.escape(this.innerXml(xml));
}
else {
for (n = xml.firstChild; n; n = n.nextSibling) {
if(FuncTest.test(xml.firstChild.nodeValue)) {
o = xml.firstChild.nodeValue;
break;
} else {
o["#cdata"] = this.escape(n.nodeValue);
}
}
}
}
}
if (!xml.attributes.length && !xml.firstChild) {
o = null;
}
}
else if (xml.nodeType === 9) {
// document.node
o = this.toObj(xml.documentElement);
}
else {
alert("unhandled node type: " + xml.nodeType);
}
return o;
},
toJson: function(o, name, ind, wellform) {
if(wellform === undefined) wellform = true;
var json = name ? ("\"" + name + "\"") : "", tab = "\t", newline = "\n";
if(!wellform) {
tab= ""; newline= "";
}
if (o === "[]") {
json += (name ? ":[]" : "[]");
}
else if (o instanceof Array) {
var n, i, ar=[];
for (i = 0, n = o.length; i < n; i += 1) {
ar[i] = this.toJson(o[i], "", ind + tab, wellform);
}
json += (name ? ":[" : "[") + (ar.length > 1 ? (newline + ind + tab + ar.join(","+newline + ind + tab) + newline + ind) : ar.join("")) + "]";
}
else if (o === null) {
json += (name && ":") + "null";
}
else if (typeof(o) === "object") {
var arr = [], m;
for (m in o) {
if (o.hasOwnProperty(m)) {
arr[arr.length] = this.toJson(o[m], m, ind + tab, wellform);
}
}
json += (name ? ":{" : "{") + (arr.length > 1 ? (newline + ind + tab + arr.join(","+newline + ind + tab) + newline + ind) : arr.join("")) + "}";
}
else if (typeof(o) === "string") {
/*
var objRegExp = /(^-?\d+\.?\d*$)/;
var FuncTest = /function/i;
var os = o.toString();
if (objRegExp.test(os) || FuncTest.test(os) || os==="false" || os==="true") {
// int or float
json += (name && ":") + "\"" +os + "\"";
}
else {
*/
json += (name && ":") + "\"" + o.replace(/\\/g,'\\\\').replace(/\"/g,'\\"') + "\"";
//}
}
else {
json += (name && ":") + "\"" + o.toString()+ "\"";
}
return json;
},
innerXml: function(node) {
var s = "";
if ("innerHTML" in node) {
s = node.innerHTML;
}
else {
var asXml = function(n) {
var s = "", i;
if (n.nodeType === 1) {
s += "<" + n.nodeName;
for (i = 0; i < n.attributes.length; i += 1) {
s += " " + n.attributes[i].nodeName + "=\"" + (n.attributes[i].nodeValue || "").toString() + "\"";
}
if (n.firstChild) {
s += ">";
for (var c = n.firstChild; c; c = c.nextSibling) {
s += asXml(c);
}
s += "</" + n.nodeName + ">";
}
else {
s += "/>";
}
}
else if (n.nodeType === 3) {
s += n.nodeValue;
}
else if (n.nodeType === 4) {
s += "<![CDATA[" + n.nodeValue + "]]>";
}
return s;
};
for (var c = node.firstChild; c; c = c.nextSibling) {
s += asXml(c);
}
}
return s;
},
escape: function(txt) {
return txt.replace(/[\\]/g, "\\\\").replace(/[\"]/g, '\\"').replace(/[\n]/g, '\\n').replace(/[\r]/g, '\\r');
},
removeWhite: function(e) {
e.normalize();
var n;
for (n = e.firstChild; n; ) {
if (n.nodeType === 3) {
// text node
if (!n.nodeValue.match(/[^ \f\n\r\t\v]/)) {
// pure whitespace text node
var nxt = n.nextSibling;
e.removeChild(n);
n = nxt;
}
else {
n = n.nextSibling;
}
}
else if (n.nodeType === 1) {
// element node
this.removeWhite(n);
n = n.nextSibling;
}
else {
// any other node
n = n.nextSibling;
}
}
return e;
}
}; | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/JsonXml.js | JavaScript | art | 9,124 |
;(function($){
/*
**
* jqGrid extension for cellediting Grid Data
* 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-2.0.html
**/
/**
* all events and options here are aded anonynous and not in the base grid
* since the array is to big. Here is the order of execution.
* From this point we use jQuery isFunction
* formatCell
* beforeEditCell,
* onSelectCell (used only for noneditable cels)
* afterEditCell,
* beforeSaveCell, (called before validation of values if any)
* beforeSubmitCell (if cellsubmit remote (ajax))
* afterSubmitCell(if cellsubmit remote (ajax)),
* afterSaveCell,
* errorCell,
* serializeCellData - new
* Options
* cellsubmit (remote,clientArray) (added in grid options)
* cellurl
* ajaxCellOptions
* */
$.jgrid.extend({
editCell : function (iRow,iCol, ed){
return this.each(function (){
var $t = this, nm, tmp,cc, cm;
if (!$t.grid || $t.p.cellEdit !== true) {return;}
iCol = parseInt(iCol,10);
// select the row that can be used for other methods
$t.p.selrow = $t.rows[iRow].id;
if (!$t.p.knv) {$($t).jqGrid("GridNav");}
// check to see if we have already edited cell
if ($t.p.savedRow.length>0) {
// prevent second click on that field and enable selects
if (ed===true ) {
if(iRow == $t.p.iRow && iCol == $t.p.iCol){
return;
}
}
// save the cell
$($t).jqGrid("saveCell",$t.p.savedRow[0].id,$t.p.savedRow[0].ic);
} else {
window.setTimeout(function () { $("#"+$t.p.knv).attr("tabindex","-1").focus();},0);
}
cm = $t.p.colModel[iCol];
nm = cm.name;
if (nm=='subgrid' || nm=='cb' || nm=='rn') {return;}
cc = $("td:eq("+iCol+")",$t.rows[iRow]);
if (cm.editable===true && ed===true && !cc.hasClass("not-editable-cell")) {
if(parseInt($t.p.iCol,10)>=0 && parseInt($t.p.iRow,10)>=0) {
$("td:eq("+$t.p.iCol+")",$t.rows[$t.p.iRow]).removeClass("edit-cell ui-state-highlight");
$($t.rows[$t.p.iRow]).removeClass("selected-row ui-state-hover");
}
$(cc).addClass("edit-cell ui-state-highlight");
$($t.rows[iRow]).addClass("selected-row ui-state-hover");
try {
tmp = $.unformat(cc,{rowId: $t.rows[iRow].id, colModel:cm},iCol);
} catch (_) {
tmp = ( cm.edittype && cm.edittype == 'textarea' ) ? $(cc).text() : $(cc).html();
}
if($t.p.autoencode) { tmp = $.jgrid.htmlDecode(tmp); }
if (!cm.edittype) {cm.edittype = "text";}
$t.p.savedRow.push({id:iRow,ic:iCol,name:nm,v:tmp});
if(tmp == " " || tmp == " " || (tmp.length==1 && tmp.charCodeAt(0)==160) ) {tmp='';}
if($.isFunction($t.p.formatCell)) {
var tmp2 = $t.p.formatCell.call($t, $t.rows[iRow].id,nm,tmp,iRow,iCol);
if(tmp2 !== undefined ) {tmp = tmp2;}
}
var opt = $.extend({}, cm.editoptions || {} ,{id:iRow+"_"+nm,name:nm});
var elc = $.jgrid.createEl(cm.edittype,opt,tmp,true,$.extend({},$.jgrid.ajaxOptions,$t.p.ajaxSelectOptions || {}));
if ($.isFunction($t.p.beforeEditCell)) {
$t.p.beforeEditCell.call($t, $t.rows[iRow].id,nm,tmp,iRow,iCol);
}
$(cc).html("").append(elc).attr("tabindex","0");
window.setTimeout(function () { $(elc).focus();},0);
$("input, select, textarea",cc).bind("keydown",function(e) {
if (e.keyCode === 27) {
if($("input.hasDatepicker",cc).length >0) {
if( $(".ui-datepicker").is(":hidden") ) { $($t).jqGrid("restoreCell",iRow,iCol); }
else { $("input.hasDatepicker",cc).datepicker('hide'); }
} else {
$($t).jqGrid("restoreCell",iRow,iCol);
}
} //ESC
if (e.keyCode === 13) {$($t).jqGrid("saveCell",iRow,iCol);}//Enter
if (e.keyCode == 9) {
if(!$t.grid.hDiv.loading ) {
if (e.shiftKey) {$($t).jqGrid("prevCell",iRow,iCol);} //Shift TAb
else {$($t).jqGrid("nextCell",iRow,iCol);} //Tab
} else {
return false;
}
}
e.stopPropagation();
});
if ($.isFunction($t.p.afterEditCell)) {
$t.p.afterEditCell.call($t, $t.rows[iRow].id,nm,tmp,iRow,iCol);
}
} else {
if (parseInt($t.p.iCol,10)>=0 && parseInt($t.p.iRow,10)>=0) {
$("td:eq("+$t.p.iCol+")",$t.rows[$t.p.iRow]).removeClass("edit-cell ui-state-highlight");
$($t.rows[$t.p.iRow]).removeClass("selected-row ui-state-hover");
}
cc.addClass("edit-cell ui-state-highlight");
$($t.rows[iRow]).addClass("selected-row ui-state-hover");
if ($.isFunction($t.p.onSelectCell)) {
tmp = cc.html().replace(/\ \;/ig,'');
$t.p.onSelectCell.call($t, $t.rows[iRow].id,nm,tmp,iRow,iCol);
}
}
$t.p.iCol = iCol; $t.p.iRow = iRow;
});
},
saveCell : function (iRow, iCol){
return this.each(function(){
var $t= this, fr;
if (!$t.grid || $t.p.cellEdit !== true) {return;}
if ( $t.p.savedRow.length >= 1) {fr = 0;} else {fr=null;}
if(fr !== null) {
var cc = $("td:eq("+iCol+")",$t.rows[iRow]),v,v2,
cm = $t.p.colModel[iCol], nm = cm.name, nmjq = $.jgrid.jqID(nm) ;
switch (cm.edittype) {
case "select":
if(!cm.editoptions.multiple) {
v = $("#"+iRow+"_"+nmjq+">option:selected",$t.rows[iRow]).val();
v2 = $("#"+iRow+"_"+nmjq+">option:selected",$t.rows[iRow]).text();
} else {
var sel = $("#"+iRow+"_"+nmjq,$t.rows[iRow]), selectedText = [];
v = $(sel).val();
if(v) { v.join(",");} else { v=""; }
$("option:selected",sel).each(
function(i,selected){
selectedText[i] = $(selected).text();
}
);
v2 = selectedText.join(",");
}
if(cm.formatter) { v2 = v; }
break;
case "checkbox":
var cbv = ["Yes","No"];
if(cm.editoptions){
cbv = cm.editoptions.value.split(":");
}
v = $("#"+iRow+"_"+nmjq,$t.rows[iRow]).attr("checked") ? cbv[0] : cbv[1];
v2=v;
break;
case "password":
case "text":
case "textarea":
case "button" :
v = $("#"+iRow+"_"+nmjq,$t.rows[iRow]).val();
v2=v;
break;
case 'custom' :
try {
if(cm.editoptions && $.isFunction(cm.editoptions.custom_value)) {
v = cm.editoptions.custom_value.call($t, $(".customelement",cc),'get');
if (v===undefined) { throw "e2";} else { v2=v; }
} else { throw "e1"; }
} catch (e) {
if (e=="e1") { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+$.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose); }
if (e=="e2") { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+$.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose); }
else {$.jgrid.info_dialog(jQuery.jgrid.errors.errcap,e.message,jQuery.jgrid.edit.bClose); }
}
break;
}
// The common approach is if nothing changed do not do anything
if (v2 !== $t.p.savedRow[fr].v){
if ($.isFunction($t.p.beforeSaveCell)) {
var vv = $t.p.beforeSaveCell.call($t, $t.rows[iRow].id,nm, v, iRow,iCol);
if (vv) {v = vv; v2=vv;}
}
var cv = $.jgrid.checkValues(v,iCol,$t);
if(cv[0] === true) {
var addpost = {};
if ($.isFunction($t.p.beforeSubmitCell)) {
addpost = $t.p.beforeSubmitCell.call($t, $t.rows[iRow].id,nm, v, iRow,iCol);
if (!addpost) {addpost={};}
}
if( $("input.hasDatepicker",cc).length >0) { $("input.hasDatepicker",cc).datepicker('hide'); }
if ($t.p.cellsubmit == 'remote') {
if ($t.p.cellurl) {
var postdata = {};
if($t.p.autoencode) { v = $.jgrid.htmlEncode(v); }
postdata[nm] = v;
var idname,oper, opers;
opers = $t.p.prmNames;
idname = opers.id;
oper = opers.oper;
postdata[idname] = $t.rows[iRow].id;
postdata[oper] = opers.editoper;
postdata = $.extend(addpost,postdata);
$("#lui_"+$t.p.id).show();
$t.grid.hDiv.loading = true;
$.ajax( $.extend( {
url: $t.p.cellurl,
data :$.isFunction($t.p.serializeCellData) ? $t.p.serializeCellData.call($t, postdata) : postdata,
type: "POST",
complete: function (result, stat) {
$("#lui_"+$t.p.id).hide();
$t.grid.hDiv.loading = false;
if (stat == 'success') {
if ($.isFunction($t.p.afterSubmitCell)) {
var ret = $t.p.afterSubmitCell.call($t, result,postdata.id,nm,v,iRow,iCol);
if(ret[0] === true) {
$(cc).empty();
$($t).jqGrid("setCell",$t.rows[iRow].id, iCol, v2, false, false, true);
$(cc).addClass("dirty-cell");
$($t.rows[iRow]).addClass("edited");
if ($.isFunction($t.p.afterSaveCell)) {
$t.p.afterSaveCell.call($t, $t.rows[iRow].id,nm, v, iRow,iCol);
}
$t.p.savedRow.splice(0,1);
} else {
$.jgrid.info_dialog($.jgrid.errors.errcap,ret[1],$.jgrid.edit.bClose);
$($t).jqGrid("restoreCell",iRow,iCol);
}
} else {
$(cc).empty();
$($t).jqGrid("setCell",$t.rows[iRow].id, iCol, v2, false, false, true);
$(cc).addClass("dirty-cell");
$($t.rows[iRow]).addClass("edited");
if ($.isFunction($t.p.afterSaveCell)) {
$t.p.afterSaveCell.call($t, $t.rows[iRow].id,nm, v, iRow,iCol);
}
$t.p.savedRow.splice(0,1);
}
}
},
error:function(res,stat) {
$("#lui_"+$t.p.id).hide();
$t.grid.hDiv.loading = false;
if ($.isFunction($t.p.errorCell)) {
$t.p.errorCell.call($t, res,stat);
$($t).jqGrid("restoreCell",iRow,iCol);
} else {
$.jgrid.info_dialog($.jgrid.errors.errcap,res.status+" : "+res.statusText+"<br/>"+stat,$.jgrid.edit.bClose);
$($t).jqGrid("restoreCell",iRow,iCol);
}
}
}, $.jgrid.ajaxOptions, $t.p.ajaxCellOptions || {}));
} else {
try {
$.jgrid.info_dialog($.jgrid.errors.errcap,$.jgrid.errors.nourl,$.jgrid.edit.bClose);
$($t).jqGrid("restoreCell",iRow,iCol);
} catch (e) {}
}
}
if ($t.p.cellsubmit == 'clientArray') {
$(cc).empty();
$($t).jqGrid("setCell",$t.rows[iRow].id,iCol, v2, false, false, true);
$(cc).addClass("dirty-cell");
$($t.rows[iRow]).addClass("edited");
if ($.isFunction($t.p.afterSaveCell)) {
$t.p.afterSaveCell.call($t, $t.rows[iRow].id,nm, v, iRow,iCol);
}
$t.p.savedRow.splice(0,1);
}
} else {
try {
window.setTimeout(function(){$.jgrid.info_dialog($.jgrid.errors.errcap,v+" "+cv[1],$.jgrid.edit.bClose);},100);
$($t).jqGrid("restoreCell",iRow,iCol);
} catch (e) {}
}
} else {
$($t).jqGrid("restoreCell",iRow,iCol);
}
}
if ($.browser.opera) {
$("#"+$t.p.knv).attr("tabindex","-1").focus();
} else {
window.setTimeout(function () { $("#"+$t.p.knv).attr("tabindex","-1").focus();},0);
}
});
},
restoreCell : function(iRow, iCol) {
return this.each(function(){
var $t= this, fr;
if (!$t.grid || $t.p.cellEdit !== true ) {return;}
if ( $t.p.savedRow.length >= 1) {fr = 0;} else {fr=null;}
if(fr !== null) {
var cc = $("td:eq("+iCol+")",$t.rows[iRow]);
// datepicker fix
if($.isFunction($.fn.datepicker)) {
try {
$("input.hasDatepicker",cc).datepicker('hide');
} catch (e) {}
}
$(cc).empty().attr("tabindex","-1");
$($t).jqGrid("setCell",$t.rows[iRow].id, iCol, $t.p.savedRow[fr].v, false, false, true);
if ($.isFunction($t.p.afterRestoreCell)) {
$t.p.afterRestoreCell.call($t, $t.rows[iRow].id, $t.p.savedRow[fr].v, iRow, iCol);
}
$t.p.savedRow.splice(0,1);
}
window.setTimeout(function () { $("#"+$t.p.knv).attr("tabindex","-1").focus();},0);
});
},
nextCell : function (iRow,iCol) {
return this.each(function (){
var $t = this, nCol=false;
if (!$t.grid || $t.p.cellEdit !== true) {return;}
// try to find next editable cell
for (var i=iCol+1; i<$t.p.colModel.length; i++) {
if ( $t.p.colModel[i].editable ===true) {
nCol = i; break;
}
}
if(nCol !== false) {
$($t).jqGrid("editCell",iRow,nCol,true);
} else {
if ($t.p.savedRow.length >0) {
$($t).jqGrid("saveCell",iRow,iCol);
}
}
});
},
prevCell : function (iRow,iCol) {
return this.each(function (){
var $t = this, nCol=false;
if (!$t.grid || $t.p.cellEdit !== true) {return;}
// try to find next editable cell
for (var i=iCol-1; i>=0; i--) {
if ( $t.p.colModel[i].editable ===true) {
nCol = i; break;
}
}
if(nCol !== false) {
$($t).jqGrid("editCell",iRow,nCol,true);
} else {
if ($t.p.savedRow.length >0) {
$($t).jqGrid("saveCell",iRow,iCol);
}
}
});
},
GridNav : function() {
return this.each(function () {
var $t = this;
if (!$t.grid || $t.p.cellEdit !== true ) {return;}
// trick to process keydown on non input elements
$t.p.knv = $t.p.id + "_kn";
var selection = $("<span style='width:0px;height:0px;background-color:black;' tabindex='0'><span tabindex='-1' style='width:0px;height:0px;background-color:grey' id='"+$t.p.knv+"'></span></span>"),
i, kdir;
$(selection).insertBefore($t.grid.cDiv);
$("#"+$t.p.knv)
.focus()
.keydown(function (e){
kdir = e.keyCode;
if($t.p.direction == "rtl") {
if(kdir==37) { kdir = 39;}
else if (kdir==39) { kdir = 37; }
}
switch (kdir) {
case 38:
if ($t.p.iRow-1 >0 ) {
scrollGrid($t.p.iRow-1,$t.p.iCol,'vu');
$($t).jqGrid("editCell",$t.p.iRow-1,$t.p.iCol,false);
}
break;
case 40 :
if ($t.p.iRow+1 <= $t.rows.length-1) {
scrollGrid($t.p.iRow+1,$t.p.iCol,'vd');
$($t).jqGrid("editCell",$t.p.iRow+1,$t.p.iCol,false);
}
break;
case 37 :
if ($t.p.iCol -1 >= 0) {
i = findNextVisible($t.p.iCol-1,'lft');
scrollGrid($t.p.iRow, i,'h');
$($t).jqGrid("editCell",$t.p.iRow, i,false);
}
break;
case 39 :
if ($t.p.iCol +1 <= $t.p.colModel.length-1) {
i = findNextVisible($t.p.iCol+1,'rgt');
scrollGrid($t.p.iRow,i,'h');
$($t).jqGrid("editCell",$t.p.iRow,i,false);
}
break;
case 13:
if (parseInt($t.p.iCol,10)>=0 && parseInt($t.p.iRow,10)>=0) {
$($t).jqGrid("editCell",$t.p.iRow,$t.p.iCol,true);
}
break;
}
return false;
});
function scrollGrid(iR, iC, tp){
if (tp.substr(0,1)=='v') {
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 == 'vd') {
if(nROT >= ch) {
$($t.grid.bDiv)[0].scrollTop = $($t.grid.bDiv)[0].scrollTop + $t.rows[iR].clientHeight;
}
}
if(tp == 'vu'){
if (pROT < st ) {
$($t.grid.bDiv)[0].scrollTop = $($t.grid.bDiv)[0].scrollTop - $t.rows[iR].clientHeight;
}
}
}
if(tp=='h') {
var cw = $($t.grid.bDiv)[0].clientWidth,
sl = $($t.grid.bDiv)[0].scrollLeft,
nCOL = $t.rows[iR].cells[iC].offsetLeft+$t.rows[iR].cells[iC].clientWidth,
pCOL = $t.rows[iR].cells[iC].offsetLeft;
if(nCOL >= cw+parseInt(sl,10)) {
$($t.grid.bDiv)[0].scrollLeft = $($t.grid.bDiv)[0].scrollLeft + $t.rows[iR].cells[iC].clientWidth;
} else if (pCOL < sl) {
$($t.grid.bDiv)[0].scrollLeft = $($t.grid.bDiv)[0].scrollLeft - $t.rows[iR].cells[iC].clientWidth;
}
}
}
function findNextVisible(iC,act){
var ind, i;
if(act == 'lft') {
ind = iC+1;
for (i=iC;i>=0;i--){
if ($t.p.colModel[i].hidden !== true) {
ind = i;
break;
}
}
}
if(act == 'rgt') {
ind = iC-1;
for (i=iC; i<$t.p.colModel.length;i++){
if ($t.p.colModel[i].hidden !== true) {
ind = i;
break;
}
}
}
return ind;
}
});
},
getChangedCells : function (mthd) {
var ret=[];
if (!mthd) {mthd='all';}
this.each(function(){
var $t= this,nm;
if (!$t.grid || $t.p.cellEdit !== true ) {return;}
$($t.rows).each(function(j){
var res = {};
if ($(this).hasClass("edited")) {
$('td',this).each( function(i) {
nm = $t.p.colModel[i].name;
if ( nm !== 'cb' && nm !== 'subgrid') {
if (mthd=='dirty') {
if ($(this).hasClass('dirty-cell')) {
try {
res[nm] = $.unformat(this,{rowId:$t.rows[j].id, colModel:$t.p.colModel[i]},i);
} catch (e){
res[nm] = $.jgrid.htmlDecode($(this).html());
}
}
} else {
try {
res[nm] = $.unformat(this,{rowId:$t.rows[j].id,colModel:$t.p.colModel[i]},i);
} catch (e) {
res[nm] = $.jgrid.htmlDecode($(this).html());
}
}
}
});
res.id = this.id;
ret.push(res);
}
});
});
return ret;
}
/// end cell editing
});
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/grid.celledit.js | JavaScript | art | 17,090 |
/* Multiselect
----------------------------------*/
.ui-multiselect { border: solid 1px; font-size: 0.8em; }
.ui-multiselect ul { -moz-user-select: none; }
.ui-multiselect li { margin: 0; padding: 0; cursor: default; line-height: 20px; height: 20px; font-size: 11px; list-style: none; }
.ui-multiselect li a { color: #999; text-decoration: none; padding: 0; display: block; float: left; cursor: pointer;}
.ui-multiselect li.ui-draggable-dragging { padding-left: 10px; }
.ui-multiselect div.selected { position: relative; padding: 0; margin: 0; border: 0; float:left; }
.ui-multiselect ul.selected { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; position: relative; width: 100%; }
.ui-multiselect ul.selected li { }
.ui-multiselect div.available { position: relative; padding: 0; margin: 0; border: 0; float:left; border-left: 1px solid; }
.ui-multiselect ul.available { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; width: 100%; }
.ui-multiselect ul.available li { padding-left: 10px; }
.ui-multiselect .ui-state-default { border: none; margin-bottom: 1px; position: relative; padding-left: 20px;}
.ui-multiselect .ui-state-hover { border: none; }
.ui-multiselect .ui-widget-header {border: none; font-size: 11px; margin-bottom: 1px;}
.ui-multiselect .add-all { float: right; padding: 7px;}
.ui-multiselect .remove-all { float: right; padding: 7px;}
.ui-multiselect .search { float: left; padding: 4px;}
.ui-multiselect .count { float: left; padding: 7px;}
.ui-multiselect li span.ui-icon-arrowthick-2-n-s { position: absolute; left: 2px; }
.ui-multiselect li a.action { position: absolute; right: 2px; top: 2px; }
.ui-multiselect input.search { height: 14px; padding: 1px; opacity: 0.5; margin: 4px; width: 100px; } | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/css/ui.multiselect.css | CSS | art | 1,886 |
/*Grid*/
.ui-jqgrid {position: relative; font-size:11px;}
.ui-jqgrid .ui-jqgrid-view {position: relative;left:0px; top: 0px; padding: .0em;}
/* caption*/
.ui-jqgrid .ui-jqgrid-titlebar {padding: .3em .2em .2em .3em; position: relative; border-left: 0px none;border-right: 0px none; border-top: 0px none;}
.ui-jqgrid .ui-jqgrid-title { float: left; margin: .1em 0 .2em; }
.ui-jqgrid .ui-jqgrid-titlebar-close { position: absolute;top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height:18px;}.ui-jqgrid .ui-jqgrid-titlebar-close span { display: block; margin: 1px; }
.ui-jqgrid .ui-jqgrid-titlebar-close:hover { padding: 0; }
/* header*/
.ui-jqgrid .ui-jqgrid-hdiv {position: relative; margin: 0em;padding: 0em; overflow-x: hidden; overflow-y: auto; border-left: 0px none !important; border-top : 0px none !important; border-right : 0px none !important;}
.ui-jqgrid .ui-jqgrid-hbox {float: left; padding-right: 20px;}
.ui-jqgrid .ui-jqgrid-htable {table-layout:fixed;margin:0em;}
.ui-jqgrid .ui-jqgrid-htable th {height:22px;padding: 0 2px 0 2px;}
.ui-jqgrid .ui-jqgrid-htable th div {overflow: hidden; position:relative; height:17px;}
.ui-th-column, .ui-jqgrid .ui-jqgrid-htable th.ui-th-column {overflow: hidden;white-space: nowrap;text-align:center;border-top : 0px none;border-bottom : 0px none;}
.ui-th-ltr, .ui-jqgrid .ui-jqgrid-htable th.ui-th-ltr {border-left : 0px none;}
.ui-th-rtl, .ui-jqgrid .ui-jqgrid-htable th.ui-th-rtl {border-right : 0px none;}
.ui-jqgrid .ui-th-div-ie {white-space: nowrap; zoom :1; height:17px;}
.ui-jqgrid .ui-jqgrid-resize {height:20px !important;position: relative; cursor :e-resize;display: inline;overflow: hidden;}
.ui-jqgrid .ui-grid-ico-sort {overflow:hidden;position:absolute;display:inline; cursor: pointer !important;}
.ui-jqgrid .ui-icon-asc {margin-top:-3px; height:12px;}
.ui-jqgrid .ui-icon-desc {margin-top:3px;height:12px;}
.ui-jqgrid .ui-i-asc {margin-top:0px;height:16px;}
.ui-jqgrid .ui-i-desc {margin-top:0px;margin-left:13px;height:16px;}
.ui-jqgrid .ui-jqgrid-sortable {cursor:pointer;}
.ui-jqgrid tr.ui-search-toolbar th { border-top-width: 1px !important; border-top-color: inherit !important; border-top-style: ridge !important }
tr.ui-search-toolbar input {margin: 1px 0px 0px 0px}
tr.ui-search-toolbar select {margin: 1px 0px 0px 0px}
/* body */
.ui-jqgrid .ui-jqgrid-bdiv {position: relative; margin: 0em; padding:0; overflow: auto; text-align:left;}
.ui-jqgrid .ui-jqgrid-btable {table-layout:fixed; margin:0em; outline-style: none; }
.ui-jqgrid tr.jqgrow { outline-style: none; }
.ui-jqgrid tr.jqgroup { outline-style: none; }
.ui-jqgrid tr.jqgrow td {font-weight: normal; overflow: hidden; white-space: pre; height: 22px;padding: 0 2px 0 2px;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;}
.ui-jqgrid tr.jqgfirstrow td {padding: 0 2px 0 2px;border-right-width: 1px; border-right-style: solid;}
.ui-jqgrid tr.jqgroup td {font-weight: normal; overflow: hidden; white-space: pre; height: 22px;padding: 0 2px 0 2px;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;}
.ui-jqgrid tr.jqfoot td {font-weight: bold; overflow: hidden; white-space: pre; height: 22px;padding: 0 2px 0 2px;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;}
.ui-jqgrid tr.ui-row-ltr td {text-align:left;border-right-width: 1px; border-right-color: inherit; border-right-style: solid;}
.ui-jqgrid tr.ui-row-rtl td {text-align:right;border-left-width: 1px; border-left-color: inherit; border-left-style: solid;}
.ui-jqgrid td.jqgrid-rownum { padding: 0 2px 0 2px; margin: 0px; border: 0px none;}
.ui-jqgrid .ui-jqgrid-resize-mark { width:2px; left:0; background-color:#777; cursor: e-resize; cursor: col-resize; position:absolute; top:0; height:100px; overflow:hidden; display:none; border:0 none;}
/* footer */
.ui-jqgrid .ui-jqgrid-sdiv {position: relative; margin: 0em;padding: 0em; overflow: hidden; border-left: 0px none !important; border-top : 0px none !important; border-right : 0px none !important;}
.ui-jqgrid .ui-jqgrid-ftable {table-layout:fixed; margin-bottom:0em;}
.ui-jqgrid tr.footrow td {font-weight: bold; overflow: hidden; white-space:nowrap; height: 21px;padding: 0 2px 0 2px;border-top-width: 1px; border-top-color: inherit; border-top-style: solid;}
.ui-jqgrid tr.footrow-ltr td {text-align:left;border-right-width: 1px; border-right-color: inherit; border-right-style: solid;}
.ui-jqgrid tr.footrow-rtl td {text-align:right;border-left-width: 1px; border-left-color: inherit; border-left-style: solid;}
/* Pager*/
.ui-jqgrid .ui-jqgrid-pager { border-left: 0px none !important;border-right: 0px none !important; border-bottom: 0px none !important; margin: 0px !important; padding: 0px !important; position: relative; height: 25px;white-space: nowrap;overflow: hidden;}
.ui-jqgrid .ui-pager-control {position: relative;}
.ui-jqgrid .ui-pg-table {position: relative; padding-bottom:2px; width:auto; margin: 0em;}
.ui-jqgrid .ui-pg-table td {font-weight:normal; vertical-align:middle; padding:1px;}
.ui-jqgrid .ui-pg-button { height:19px !important;}
.ui-jqgrid .ui-pg-button span { display: block; margin: 1px; float:left;}
.ui-jqgrid .ui-pg-button:hover { padding: 0px; }
.ui-jqgrid .ui-state-disabled:hover {padding:1px;}
.ui-jqgrid .ui-pg-input { height:13px;font-size:.8em; margin: 0em;}
.ui-jqgrid .ui-pg-selbox {font-size:.8em; line-height:18px; display:block; height:18px; margin: 0em;}
.ui-jqgrid .ui-separator {height: 18px; border-left: 1px solid #ccc ; border-right: 1px solid #ccc ; margin: 1px; float: right;}
.ui-jqgrid .ui-paging-info {font-weight: normal;height:19px; margin-top:3px;margin-right:4px;}
.ui-jqgrid .ui-jqgrid-pager .ui-pg-div {padding:1px 0;float:left;list-style-image:none;list-style-position:outside;list-style-type:none;position:relative;}
.ui-jqgrid .ui-jqgrid-pager .ui-pg-button { cursor:pointer; }
.ui-jqgrid .ui-jqgrid-pager .ui-pg-div span.ui-icon {float:left;margin:0 2px;}
.ui-jqgrid td input, .ui-jqgrid td select .ui-jqgrid td textarea { margin: 0em;}
.ui-jqgrid td textarea {width:auto;height:auto;}
.ui-jqgrid .ui-jqgrid-toppager {border-left: 0px none !important;border-right: 0px none !important; border-top: 0px none !important; margin: 0px !important; padding: 0px !important; position: relative; height: 25px !important;white-space: nowrap;overflow: hidden;}
/*subgrid*/
.ui-jqgrid .ui-jqgrid-btable .ui-sgcollapsed span {display: block;}
.ui-jqgrid .ui-subgrid {margin:0em;padding:0em; width:100%;}
.ui-jqgrid .ui-subgrid table {table-layout: fixed;}
.ui-jqgrid .ui-subgrid tr.ui-subtblcell td {height:18px;border-right-width: 1px; border-right-color: inherit; border-right-style: solid;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;}
.ui-jqgrid .ui-subgrid td.subgrid-data {border-top: 0px none !important;}
.ui-jqgrid .ui-subgrid td.subgrid-cell {border-width: 0px 0px 1px 0px;}
.ui-jqgrid .ui-th-subgrid {height:20px;}
/* loading */
.ui-jqgrid .loading {position: absolute; top: 45%;left: 45%;width: auto;z-index:101;padding: 6px; margin: 5px;text-align: center;font-weight: bold;display: none;border-width: 2px !important;}
.ui-jqgrid .jqgrid-overlay {display:none;z-index:100;}
* html .jqgrid-overlay {width: expression(this.parentNode.offsetWidth+'px');height: expression(this.parentNode.offsetHeight+'px');}
* .jqgrid-overlay iframe {position:absolute;top:0;left:0;z-index:-1;width: expression(this.parentNode.offsetWidth+'px');height: expression(this.parentNode.offsetHeight+'px');}
/* end loading div */
/* toolbar */
.ui-jqgrid .ui-userdata {border-left: 0px none; border-right: 0px none; height : 21px;overflow: hidden; }
/*Modal Window */
.ui-jqdialog { display: none; width: 300px; position: absolute; padding: .2em; font-size:11px; overflow:visible;}
.ui-jqdialog .ui-jqdialog-titlebar { padding: .3em .2em; position: relative; }
.ui-jqdialog .ui-jqdialog-title { margin: .1em 0 .2em; }
.ui-jqdialog .ui-jqdialog-titlebar-close { position: absolute; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
.ui-jqdialog .ui-jqdialog-titlebar-close span { display: block; margin: 1px; }
.ui-jqdialog .ui-jqdialog-titlebar-close:hover, .ui-jqdialog .ui-jqdialog-titlebar-close:focus { padding: 0; }
.ui-jqdialog-content, .ui-jqdialog .ui-jqdialog-content { border: 0; padding: .3em .2em; background: none; height:auto;}
.ui-jqdialog .ui-jqconfirm {padding: .4em 1em; border-width:3px;position:absolute;bottom:10px;right:10px;overflow:visible;display:none;height:80px;width:220px;text-align:center;}
/* end Modal window*/
/* Form edit */
.ui-jqdialog-content .FormGrid {margin: 0px;}
.ui-jqdialog-content .EditTable { width: 100%; margin-bottom:0em;}
.ui-jqdialog-content .DelTable { width: 100%; margin-bottom:0em;}
.EditTable td input, .EditTable td select, .EditTable td textarea {margin: 0em;}
.EditTable td textarea { width:auto; height:auto;}
.ui-jqdialog-content td.EditButton {text-align: right;border-top: 0px none;border-left: 0px none;border-right: 0px none; padding-bottom:5px; padding-top:5px;}
.ui-jqdialog-content td.navButton {text-align: center; border-left: 0px none;border-top: 0px none;border-right: 0px none; padding-bottom:5px; padding-top:5px;}
.ui-jqdialog-content input.FormElement {padding:.3em}
.ui-jqdialog-content .data-line {padding-top:.1em;border: 0px none;}
.ui-jqdialog-content .CaptionTD {text-align: left; vertical-align: middle;border: 0px none; padding: 2px;white-space: nowrap;}
.ui-jqdialog-content .DataTD {padding: 2px; border: 0px none; vertical-align: top;}
.ui-jqdialog-content .form-view-data {white-space:pre}
.fm-button { display: inline-block; margin:0 4px 0 0; padding: .4em .5em; text-decoration:none !important; cursor:pointer; position: relative; text-align: center; zoom: 1; }
.fm-button-icon-left { padding-left: 1.9em; }
.fm-button-icon-right { padding-right: 1.9em; }
.fm-button-icon-left .ui-icon { right: auto; left: .2em; margin-left: 0; position: absolute; top: 50%; margin-top: -8px; }
.fm-button-icon-right .ui-icon { left: auto; right: .2em; margin-left: 0; position: absolute; top: 50%; margin-top: -8px;}
#nData, #pData { float: left; margin:3px;padding: 0; width: 15px; }
/* End Eorm edit */
/*.ui-jqgrid .edit-cell {}*/
.ui-jqgrid .selected-row, div.ui-jqgrid .selected-row td {font-style : normal;border-left: 0px none;}
/* Tree Grid */
.ui-jqgrid .tree-wrap {float: left; position: relative;height: 18px;white-space: nowrap;overflow: hidden;}
.ui-jqgrid .tree-minus {position: absolute; height: 18px; width: 18px; overflow: hidden;}
.ui-jqgrid .tree-plus {position: absolute; height: 18px; width: 18px; overflow: hidden;}
.ui-jqgrid .tree-leaf {position: absolute; height: 18px; width: 18px;overflow: hidden;}
.ui-jqgrid .treeclick {cursor: pointer;}
/* moda dialog */
.jqmOverlay { background-color: #000; }
* iframe.jqm {position:absolute;top:0;left:0;z-index:-1;width: expression(this.parentNode.offsetWidth+'px');height: expression(this.parentNode.offsetHeight+'px');}
.ui-jqgrid-dnd tr td {border-right-width: 1px; border-right-color: inherit; border-right-style: solid; height:20px}
/* RTL Support */
.ui-jqgrid .ui-jqgrid-title-rtl {float:right;margin: .1em 0 .2em; }
.ui-jqgrid .ui-jqgrid-hbox-rtl {float: right; padding-left: 20px;}
.ui-jqgrid .ui-jqgrid-resize-ltr {float: right;margin: -2px -2px -2px 0px;}
.ui-jqgrid .ui-jqgrid-resize-rtl {float: left;margin: -2px 0px -1px -3px;}
.ui-jqgrid .ui-sort-rtl {left:0px;}
.ui-jqgrid .tree-wrap-ltr {float: left;}
.ui-jqgrid .tree-wrap-rtl {float: right;}
.ui-jqgrid .ui-ellipsis {text-overflow:ellipsis; -moz-binding:url('ellipsis-xbl.xml#ellipsis');}
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/css/ui.jqgrid.css | CSS | art | 11,674 |
.ui-searchFilter { display: none; position: absolute; z-index: 770; overflow: visible;}
.ui-searchFilter table {position:relative; margin:0em; width:auto}
.ui-searchFilter table td {margin: 0em; padding: 1px;}
.ui-searchFilter table td input, .ui-searchFilter table td select {margin: 0.1em;}
.ui-searchFilter .ui-state-default { cursor: pointer; }
.ui-searchFilter .divider { height: 1px; }
.ui-searchFilter .divider div { background-color: black; height: 1px; } | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/css/jquery.searchFilter.css | CSS | art | 469 |
// This file should be used if you want to debug
function jqGridInclude()
{
var pathtojsfiles = "js/"; // need to be ajusted
// set include to false if you do not want some modules to be included
var modules = [
{ include: true, incfile:'i18n/grid.locale-en.js'}, // jqGrid translation
{ include: true, incfile:'grid.base.js'}, // jqGrid base
{ include: true, incfile:'grid.common.js'}, // jqGrid common for editing
{ include: true, incfile:'grid.formedit.js'}, // jqGrid Form editing
{ include: true, incfile:'grid.inlinedit.js'}, // jqGrid inline editing
{ include: true, incfile:'grid.celledit.js'}, // jqGrid cell editing
{ include: true, incfile:'grid.subgrid.js'}, //jqGrid subgrid
{ include: true, incfile:'grid.treegrid.js'}, //jqGrid treegrid
{ include: true, incfile:'grid.custom.js'}, //jqGrid custom
{ include: true, incfile:'grid.postext.js'}, //jqGrid postext
{ include: true, incfile:'grid.tbltogrid.js'}, //jqGrid table to grid
{ include: true, incfile:'grid.setcolumns.js'}, //jqGrid setcolumns
{ include: true, incfile:'grid.import.js'}, //jqGrid import
{ include: true, incfile:'grid.grouping.js'}, //jqGrid grouping
{ include: true, incfile:'jquery.fmatter.js'}, //jqGrid formater
{ include: true, incfile:'JsonXml.js'}, //xmljson utils
{ include: true, incfile:'jquery.searchFilter.js'} // search Plugin
];
var filename;
for(var i=0;i<modules.length; i++)
{
if(modules[i].include === true) {
filename = pathtojsfiles+modules[i].incfile;
if(jQuery.browser.safari) {
jQuery.ajax({url:filename,dataType:'script', async:false, cache: true});
} else {
IncludeJavaScript(filename);
}
}
}
function IncludeJavaScript(jsFile)
{
var oHead = document.getElementsByTagName('head')[0];
var oScript = document.createElement('script');
oScript.type = 'text/javascript';
oScript.charset = 'utf-8';
oScript.src = jsFile;
oHead.appendChild(oScript);
};
};
jqGridInclude(); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/grid.loader.js | JavaScript | art | 2,242 |
/**
* jqGrid extension - Tree Grid
* 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
**/
/*global document, jQuery, $ */
(function($) {
$.jgrid.extend({
setTreeNode : function(i, len){
return this.each(function(){
var $t = this;
if( !$t.grid || !$t.p.treeGrid ) {return;}
var expCol = $t.p.expColInd,
expanded = $t.p.treeReader.expanded_field,
isLeaf = $t.p.treeReader.leaf_field,
level = $t.p.treeReader.level_field,
icon = $t.p.treeReader.icon_field,
loaded = $t.p.treeReader.loaded, lft, rgt, curLevel, ident,lftpos, twrap,
ldat, lf;
while(i<len) {
var ind = $t.rows[i].id, dind = $t.p._index[ind], expan;
ldat = $t.p.data[dind];
//$t.rows[i].level = ldat[level];
if($t.p.treeGridModel == 'nested') {
if(!ldat[isLeaf]) {
lft = parseInt(ldat[$t.p.treeReader.left_field],10);
rgt = parseInt(ldat[$t.p.treeReader.right_field],10);
// NS Model
ldat[isLeaf] = (rgt === lft+1) ? 'true' : 'false';
$t.rows[i].cells[$t.p._treeleafpos].innerHTML = ldat[isLeaf];
}
}
//else {
//row.parent_id = rd[$t.p.treeReader.parent_id_field];
//}
curLevel = parseInt(ldat[level],10);
if($t.p.tree_root_level === 0) {
ident = curLevel+1;
lftpos = curLevel;
} else {
ident = curLevel;
lftpos = curLevel -1;
}
twrap = "<div class='tree-wrap tree-wrap-"+$t.p.direction+"' style='width:"+(ident*18)+"px;'>";
twrap += "<div style='"+($t.p.direction=="rtl" ? "right:" : "left:")+(lftpos*18)+"px;' class='ui-icon ";
if(ldat[loaded] !== undefined) {
if(ldat[loaded]=="true" || ldat[loaded]===true) {
ldat[loaded] = true;
} else {
ldat[loaded] = false;
}
}
if(ldat[isLeaf] == "true" || ldat[isLeaf] === true) {
twrap += ((ldat[icon] !== undefined && ldat[icon] !== "") ? ldat[icon] : $t.p.treeIcons.leaf)+" tree-leaf treeclick'";
ldat[isLeaf] = true;
lf="leaf";
} else {
ldat[isLeaf] = false;
lf="";
}
ldat[expanded] = ((ldat[expanded] == "true" || ldat[expanded] === true) ? true : false) && ldat[loaded];
if(ldat[expanded] === true) {
twrap += $t.p.treeIcons.minus+" tree-minus treeclick'";
} else {
twrap += $t.p.treeIcons.plus+" tree-plus treeclick'";
}
twrap += "</div></div>";
$($t.rows[i].cells[expCol]).wrapInner("<span class='cell-wrapper"+lf+"'></span>").prepend(twrap);
if(curLevel !== parseInt($t.p.tree_root_level,10)) {
var pn = $($t).jqGrid('getNodeParent',ldat);
expan = pn && pn.hasOwnProperty(expanded) ? pn[expanded] : true;
if( !expan ){
$($t.rows[i]).css("display","none");
}
}
$($t.rows[i].cells[expCol])
.find("div.treeclick")
.bind("click",function(e){
var target = e.target || e.srcElement,
ind2 =$(target,$t.rows).closest("tr.jqgrow")[0].id,
pos = $t.p._index[ind2];
if(!$t.p.data[pos][isLeaf]){
if($t.p.data[pos][expanded]){
$($t).jqGrid("collapseRow",$t.p.data[pos]);
$($t).jqGrid("collapseNode",$t.p.data[pos]);
} else {
$($t).jqGrid("expandRow",$t.p.data[pos]);
$($t).jqGrid("expandNode",$t.p.data[pos]);
}
}
return false;
});
if($t.p.ExpandColClick === true) {
$($t.rows[i].cells[expCol])
.find("span.cell-wrapper")
.css("cursor","pointer")
.bind("click",function(e) {
var target = e.target || e.srcElement,
ind2 =$(target,$t.rows).closest("tr.jqgrow")[0].id,
pos = $t.p._index[ind2];
if(!$t.p.data[pos][isLeaf]){
if($t.p.data[pos][expanded]){
$($t).jqGrid("collapseRow",$t.p.data[pos]);
$($t).jqGrid("collapseNode",$t.p.data[pos]);
} else {
$($t).jqGrid("expandRow",$t.p.data[pos]);
$($t).jqGrid("expandNode",$t.p.data[pos]);
}
}
$($t).jqGrid("setSelection",ind2);
return false;
});
}
i++;
}
});
},
setTreeGrid : function() {
return this.each(function (){
var $t = this, i=0, pico, ecol = false, nm, key, dupcols=[];
if(!$t.p.treeGrid) {return;}
if(!$t.p.treedatatype ) {$.extend($t.p,{treedatatype: $t.p.datatype});}
$t.p.subGrid = false;$t.p.altRows =false;
$t.p.pgbuttons = false;$t.p.pginput = false;
$t.p.gridview = true;
$t.p.multiselect = false;$t.p.rowList = [];
$t.p.expColInd = 0;
pico = 'ui-icon-triangle-1-' + ($t.p.direction=="rtl" ? 'w' : 'e');
$t.p.treeIcons = $.extend({plus:pico,minus:'ui-icon-triangle-1-s',leaf:'ui-icon-radio-off'},$t.p.treeIcons || {});
if($t.p.treeGridModel == 'nested') {
$t.p.treeReader = $.extend({
level_field: "level",
left_field:"lft",
right_field: "rgt",
leaf_field: "isLeaf",
expanded_field: "expanded",
loaded: "loaded",
icon_field: "icon"
},$t.p.treeReader);
} else if($t.p.treeGridModel == 'adjacency') {
$t.p.treeReader = $.extend({
level_field: "level",
parent_id_field: "parent",
leaf_field: "isLeaf",
expanded_field: "expanded",
loaded: "loaded",
icon_field: "icon"
},$t.p.treeReader );
}
for ( key in $t.p.colModel){
if($t.p.colModel.hasOwnProperty(key)) {
nm = $t.p.colModel[key].name;
if( nm == $t.p.ExpandColumn && !ecol ) {
ecol = true;
$t.p.expColInd = i;
}
i++;
//
for(var tkey in $t.p.treeReader) {
if($t.p.treeReader[tkey] == nm)
dupcols.push(nm);
}
}
}
$.each($t.p.treeReader,function(j,n){
if(n && $.inArray(n, dupcols) === -1){
if(j==='leaf_field') { $t.p._treeleafpos= i; }
i++;
$t.p.colNames.push(n);
$t.p.colModel.push({name:n,width:1,hidden:true,sortable:false,resizable:false,hidedlg:true,editable:true,search:false});
}
});
});
},
expandRow: function (record){
this.each(function(){
var $t = this;
if(!$t.grid || !$t.p.treeGrid) {return;}
var childern = $($t).jqGrid("getNodeChildren",record),
//if ($($t).jqGrid("isVisibleNode",record)) {
expanded = $t.p.treeReader.expanded_field;
$(childern).each(function(i){
var id = $.jgrid.getAccessor(this,$t.p.localReader.id);
$("#"+id,$t.grid.bDiv).css("display","");
if(this[expanded]) {
$($t).jqGrid("expandRow",this);
}
});
//}
});
},
collapseRow : function (record) {
this.each(function(){
var $t = this;
if(!$t.grid || !$t.p.treeGrid) {return;}
var childern = $($t).jqGrid("getNodeChildren",record),
expanded = $t.p.treeReader.expanded_field;
$(childern).each(function(i){
var id = $.jgrid.getAccessor(this,$t.p.localReader.id);
$("#"+id,$t.grid.bDiv).css("display","none");
if(this[expanded]){
$($t).jqGrid("collapseRow",this);
}
});
});
},
// NS ,adjacency models
getRootNodes : function() {
var result = [];
this.each(function(){
var $t = this;
if(!$t.grid || !$t.p.treeGrid) {return;}
switch ($t.p.treeGridModel) {
case 'nested' :
var level = $t.p.treeReader.level_field;
$($t.p.data).each(function(i){
if(parseInt(this[level],10) === parseInt($t.p.tree_root_level,10)) {
result.push(this);
}
});
break;
case 'adjacency' :
var parent_id = $t.p.treeReader.parent_id_field;
$($t.p.data).each(function(i){
if(this[parent_id] === null || String(this[parent_id]).toLowerCase() == "null") {
result.push(this);
}
});
break;
}
});
return result;
},
getNodeDepth : function(rc) {
var ret = null;
this.each(function(){
if(!this.grid || !this.p.treeGrid) {return;}
var $t = this;
switch ($t.p.treeGridModel) {
case 'nested' :
var level = $t.p.treeReader.level_field;
ret = parseInt(rc[level],10) - parseInt($t.p.tree_root_level,10);
break;
case 'adjacency' :
ret = $($t).jqGrid("getNodeAncestors",rc).length;
break;
}
});
return ret;
},
getNodeParent : function(rc) {
var result = null;
this.each(function(){
var $t = this;
if(!$t.grid || !$t.p.treeGrid) {return;}
switch ($t.p.treeGridModel) {
case 'nested' :
var lftc = $t.p.treeReader.left_field,
rgtc = $t.p.treeReader.right_field,
levelc = $t.p.treeReader.level_field,
lft = parseInt(rc[lftc],10), rgt = parseInt(rc[rgtc],10), level = parseInt(rc[levelc],10);
$(this.p.data).each(function(){
if(parseInt(this[levelc],10) === level-1 && parseInt(this[lftc],10) < lft && parseInt(this[rgtc],10) > rgt) {
result = this;
return false;
}
});
break;
case 'adjacency' :
var parent_id = $t.p.treeReader.parent_id_field,
dtid = $t.p.localReader.id;
$(this.p.data).each(function(i,val){
if(this[dtid] == rc[parent_id] ) {
result = this;
return false;
}
});
break;
}
});
return result;
},
getNodeChildren : function(rc) {
var result = [];
this.each(function(){
var $t = this;
if(!$t.grid || !$t.p.treeGrid) {return;}
switch ($t.p.treeGridModel) {
case 'nested' :
var lftc = $t.p.treeReader.left_field,
rgtc = $t.p.treeReader.right_field,
levelc = $t.p.treeReader.level_field,
lft = parseInt(rc[lftc],10), rgt = parseInt(rc[rgtc],10), level = parseInt(rc[levelc],10);
$(this.p.data).each(function(i){
if(parseInt(this[levelc],10) === level+1 && parseInt(this[lftc],10) > lft && parseInt(this[rgtc],10) < rgt) {
result.push(this);
}
});
break;
case 'adjacency' :
var parent_id = $t.p.treeReader.parent_id_field,
dtid = $t.p.localReader.id;
$(this.p.data).each(function(i,val){
if(this[parent_id] == rc[dtid]) {
result.push(this);
}
});
break;
}
});
return result;
},
getFullTreeNode : function(rc) {
var result = [];
this.each(function(){
var $t = this, len;
if(!$t.grid || !$t.p.treeGrid) {return;}
switch ($t.p.treeGridModel) {
case 'nested' :
var lftc = $t.p.treeReader.left_field,
rgtc = $t.p.treeReader.right_field,
levelc = $t.p.treeReader.level_field,
lft = parseInt(rc[lftc],10), rgt = parseInt(rc[rgtc],10), level = parseInt(rc[levelc],10);
$(this.p.data).each(function(i){
if(parseInt(this[levelc],10) >= level && parseInt(this[lftc],10) >= lft && parseInt(this[lftc],10) <= rgt) {
result.push(this);
}
});
break;
case 'adjacency' :
if(rc) {
result.push(rc);
var parent_id = $t.p.treeReader.parent_id_field,
dtid = $t.p.localReader.id;
$(this.p.data).each(function(i){
len = result.length;
for (i = 0; i < len; i++) {
if (result[i][dtid] == this[parent_id]) {
result.push(this);
break;
}
}
});
}
break;
}
});
return result;
},
// End NS, adjacency Model
getNodeAncestors : function(rc) {
var ancestors = [];
this.each(function(){
if(!this.grid || !this.p.treeGrid) {return;}
var parent = $(this).jqGrid("getNodeParent",rc);
while (parent) {
ancestors.push(parent);
parent = $(this).jqGrid("getNodeParent",parent);
}
});
return ancestors;
},
isVisibleNode : function(rc) {
var result = true;
this.each(function(){
var $t = this;
if(!$t.grid || !$t.p.treeGrid) {return;}
var ancestors = $($t).jqGrid("getNodeAncestors",rc),
expanded = $t.p.treeReader.expanded_field;
$(ancestors).each(function(){
result = result && this[expanded];
if(!result) {return false;}
});
});
return result;
},
isNodeLoaded : function(rc) {
var result;
this.each(function(){
var $t = this;
if(!$t.grid || !$t.p.treeGrid) {return;}
var isLeaf = $t.p.treeReader.leaf_field;
if(rc !== undefined ) {
if(rc.loaded !== undefined) {
result = rc.loaded;
} else if( rc[isLeaf] || $($t).jqGrid("getNodeChildren",rc).length > 0){
result = true;
} else {
result = false;
}
} else {
result = false;
}
});
return result;
},
expandNode : function(rc) {
return this.each(function(){
if(!this.grid || !this.p.treeGrid) {return;}
var expanded = this.p.treeReader.expanded_field,
parent = this.p.treeReader.parent_id_field,
loaded = this.p.treeReader.loaded,
level = this.p.treeReader.level_field,
lft = this.p.treeReader.left_field,
rgt = this.p.treeReader.right_field;
if(!rc[expanded]) {
var id = $.jgrid.getAccessor(rc,this.p.localReader.id);
var rc1 = $("#"+id,this.grid.bDiv)[0];
var position = this.p._index[id];
if( $(this).jqGrid("isNodeLoaded",this.p.data[position]) ) {
rc[expanded] = true;
$("div.treeclick",rc1).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus");
} else {
rc[expanded] = true;
$("div.treeclick",rc1).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus");
this.p.treeANode = rc1.rowIndex;
this.p.datatype = this.p.treedatatype;
if(this.p.treeGridModel == 'nested') {
$(this).jqGrid("setGridParam",{postData:{nodeid:id,n_left:rc[lft],n_right:rc[rgt],n_level:rc[level]}});
} else {
$(this).jqGrid("setGridParam",{postData:{nodeid:id,parentid:rc[parent],n_level:rc[level]}} );
}
$(this).trigger("reloadGrid");
rc[loaded] = true;
if(this.p.treeGridModel == 'nested') {
$(this).jqGrid("setGridParam",{postData:{nodeid:'',n_left:'',n_right:'',n_level:''}});
} else {
$(this).jqGrid("setGridParam",{postData:{nodeid:'',parentid:'',n_level:''}});
}
}
}
});
},
collapseNode : function(rc) {
return this.each(function(){
if(!this.grid || !this.p.treeGrid) {return;}
if(rc.expanded) {
rc.expanded = false;
var id = $.jgrid.getAccessor(rc,this.p.localReader.id);
var rc1 = $("#"+id,this.grid.bDiv)[0];
$("div.treeclick",rc1).removeClass(this.p.treeIcons.minus+" tree-minus").addClass(this.p.treeIcons.plus+" tree-plus");
}
});
},
SortTree : function( sortname, newDir, st, datefmt) {
return this.each(function(){
if(!this.grid || !this.p.treeGrid) {return;}
var i, len,
rec, records = [], $t = this, query, roots,
rt = $(this).jqGrid("getRootNodes");
// Sorting roots
query = $.jgrid.from(rt);
query.orderBy(sortname,newDir,st, datefmt);
roots = query.select();
// Sorting children
for (i = 0, len = roots.length; i < len; i++) {
rec = roots[i];
records.push(rec);
$(this).jqGrid("collectChildrenSortTree",records, rec, sortname, newDir,st, datefmt);
}
$.each(records, function(index, row) {
var id = $.jgrid.getAccessor(this,$t.p.localReader.id);
$('#'+$t.p.id+ ' tbody tr:eq('+index+')').after($('tr#'+id,$t.grid.bDiv));
});
query = null;roots=null;records=null;
});
},
collectChildrenSortTree : function(records, rec, sortname, newDir,st, datefmt) {
return this.each(function(){
if(!this.grid || !this.p.treeGrid) {return;}
var i, len,
child, ch, query, children;
ch = $(this).jqGrid("getNodeChildren",rec);
query = $.jgrid.from(ch);
query.orderBy(sortname, newDir, st, datefmt);
children = query.select();
for (i = 0, len = children.length; i < len; i++) {
child = children[i];
records.push(child);
$(this).jqGrid("collectChildrenSortTree",records, child, sortname, newDir, st, datefmt);
}
});
},
// experimental
setTreeRow : function(rowid, data) {
var success=false;
this.each(function(){
var t = this;
if(!t.grid || !t.p.treeGrid) {return;}
success = $(t).jqGrid("setRowData",rowid,data);
});
return success;
},
delTreeNode : function (rowid) {
return this.each(function () {
var $t = this, rid = $t.p.localReader.id,
left = $t.p.treeReader.left_field,
right = $t.p.treeReader.right_field, myright, width, res, key;
if(!$t.grid || !$t.p.treeGrid) {return;}
var rc = $t.p._index[rowid];
if (rc !== undefined) {
// nested
myright = parseInt($t.p.data[rc][right],10);
width = myright - parseInt($t.p.data[rc][left],10) + 1;
var dr = $($t).jqGrid("getFullTreeNode",$t.p.data[rc]);
if(dr.length>0){
for (var i=0;i<dr.length;i++){
$($t).jqGrid("delRowData",dr[i][rid]);
}
}
if( $t.p.treeGridModel === "nested") {
// ToDo - update grid data
res = $.jgrid.from($t.p.data)
.greater(left,myright,{stype:'integer'})
.select();
if(res.length) {
for( key in res) {
res[key][left] = parseInt(res[key][left],10) - width ;
}
}
res = $.jgrid.from($t.p.data)
.greater(right,myright,{stype:'integer'})
.select();
if(res.length) {
for( key in res) {
res[key][right] = parseInt(res[key][right],10) - width ;
}
}
}
}
});
},
addChildNode : function( nodeid, parentid, data ) {
//return this.each(function(){
var $t = this[0];
if(data) {
// we suppose tha the id is autoincremet and
var expanded = $t.p.treeReader.expanded_field,
isLeaf = $t.p.treeReader.leaf_field,
level = $t.p.treeReader.level_field,
icon = $t.p.treeReader.icon_field,
parent = $t.p.treeReader.parent_id_field,
left = $t.p.treeReader.left_field,
right = $t.p.treeReader.right_field,
loaded = $t.p.treeReader.loaded,
method, parentindex, parentdata, parentlevel, i, len, max=0, rowind = parentid, leaf, maxright;
if ( !nodeid ) {
i = $t.p.data.length-1;
if( i>= 0 ) {
while(i>=0){max = Math.max(max, parseInt($t.p.data[i][$t.p.localReader.id],10)); i--;}
}
nodeid = max+1;
}
var prow = $($t).jqGrid('getInd', parentid);
leaf = false;
// if not a parent we assume root
if ( parentid === undefined || parentid === null || parentid==="") {
parentid = null;
rowind = null;
method = 'last';
parentlevel = $t.p.tree_root_level;
i = $t.p.data.length+1;
} else {
method = 'after';
parentindex = $t.p._index[parentid];
parentdata = $t.p.data[parentindex];
parentid = parentdata[$t.p.localReader.id];
parentlevel = parseInt(parentdata[level],10)+1;
var childs = $($t).jqGrid('getFullTreeNode', parentdata);
// if there are child nodes get the last index of it
if(childs.length) {
i = childs[childs.length-1][$t.p.localReader.id];
rowind = i;
i = $($t).jqGrid('getInd',rowind)+1;
} else {
i = $($t).jqGrid('getInd', parentid)+1;
}
// if the node is leaf
if(parentdata[isLeaf]) {
leaf = true;
parentdata[expanded] = true;
//var prow = $($t).jqGrid('getInd', parentid);
$($t.rows[prow])
.find("span.cell-wrapperleaf").removeClass("cell-wrapperleaf").addClass("cell-wrapper")
.end()
.find("div.tree-leaf").removeClass($t.p.treeIcons.leaf+" tree-leaf").addClass($t.p.treeIcons.minus+" tree-minus");
$t.p.data[parentindex][isLeaf] = false;
parentdata[loaded] = true;
}
}
len = i+1;
data[expanded] = false;
data[loaded] = true;
data[level] = parentlevel;
data[isLeaf] = true;
if( $t.p.treeGridModel === "adjacency") {
data[parent] = parentid;
}
if( $t.p.treeGridModel === "nested") {
// this method requiere more attention
var query, res, key;
//maxright = parseInt(maxright,10);
// ToDo - update grid data
if(parentid !== null) {
maxright = parseInt(parentdata[right],10);
query = $.jgrid.from($t.p.data);
query = query.greaterOrEquals(right,maxright,{stype:'integer'});
res = query.select();
if(res.length) {
for( key in res) {
res[key][left] = res[key][left] > maxright ? parseInt(res[key][left],10) +2 : res[key][left];
res[key][right] = res[key][right] >= maxright ? parseInt(res[key][right],10) +2 : res[key][right];
}
}
data[left] = maxright;
data[right]= maxright+1;
} else {
maxright = parseInt( $($t).jqGrid('getCol', right, false, 'max'), 10);
res = $.jgrid.from($t.p.data)
.greater(left,maxright,{stype:'integer'})
.select();
if(res.length) {
for( key in res) {
res[key][left] = parseInt(res[key][left],10) +2 ;
}
}
res = $.jgrid.from($t.p.data)
.greater(right,maxright,{stype:'integer'})
.select();
if(res.length) {
for( key in res) {
res[key][right] = parseInt(res[key][right],10) +2 ;
}
}
data[left] = maxright+1;
data[right] = maxright + 2;
}
}
if( parentid === null || $($t).jqGrid("isNodeLoaded",parentdata) || leaf ) {
$($t).jqGrid('addRowData', nodeid, data, method, rowind);
$($t).jqGrid('setTreeNode', i, len);
}
if(parentdata && !parentdata[expanded]) {
$($t.rows[prow])
.find("div.treeclick")
.click();
}
}
//});
}
});
})(jQuery); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/grid.treegrid.js | JavaScript | art | 20,928 |
;(function($){
/**
* jqGrid extension for SubGrid Data
* 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-2.0.html
**/
$.jgrid.extend({
setSubGrid : function () {
return this.each(function (){
var $t = this, cm,
suboptions = {
plusicon : "ui-icon-plus",
minusicon : "ui-icon-minus",
openicon: "ui-icon-carat-1-sw",
expandOnLoad: false,
delayOnLoad : 50,
selectOnExpand : false,
reloadOnExpand : true
};
$t.p.subGridOptions = $.extend(suboptions, $t.p.subGridOptions || {});
$t.p.colNames.unshift("");
$t.p.colModel.unshift({name:'subgrid',width: $.browser.safari ? $t.p.subGridWidth+$t.p.cellLayout : $t.p.subGridWidth,sortable: false,resizable:false,hidedlg:true,search:false,fixed:true});
cm = $t.p.subGridModel;
if(cm[0]) {
cm[0].align = $.extend([],cm[0].align || []);
for(var i=0;i<cm[0].name.length;i++) { cm[0].align[i] = cm[0].align[i] || 'left';}
}
});
},
addSubGridCell :function (pos,iRow) {
var prp='',ic,sid;
this.each(function(){
prp = this.formatCol(pos,iRow);
sid= this.p.id;
ic = this.p.subGridOptions.plusicon;
});
return "<td role=\"grid\" aria-describedby=\""+sid+"_subgrid\" class=\"ui-sgcollapsed sgcollapsed\" "+prp+"><a href='javascript:void(0);'><span class='ui-icon "+ic+"'></span></a></td>";
},
addSubGrid : function( pos, sind ) {
return this.each(function(){
var ts = this;
if (!ts.grid ) { return; }
//-------------------------
var subGridCell = function(trdiv,cell,pos)
{
var tddiv = $("<td align='"+ts.p.subGridModel[0].align[pos]+"'></td>").html(cell);
$(trdiv).append(tddiv);
};
var subGridXml = function(sjxml, sbid){
var tddiv, i, sgmap,
dummy = $("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),
trdiv = $("<tr></tr>");
for (i = 0; i<ts.p.subGridModel[0].name.length; i++) {
tddiv = $("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+ts.p.direction+"'></th>");
$(tddiv).html(ts.p.subGridModel[0].name[i]);
$(tddiv).width( ts.p.subGridModel[0].width[i]);
$(trdiv).append(tddiv);
}
$(dummy).append(trdiv);
if (sjxml){
sgmap = ts.p.xmlReader.subgrid;
$(sgmap.root+" "+sgmap.row, sjxml).each( function(){
trdiv = $("<tr class='ui-widget-content ui-subtblcell'></tr>");
if(sgmap.repeatitems === true) {
$(sgmap.cell,this).each( function(i) {
subGridCell(trdiv, $(this).text() || ' ',i);
});
} else {
var f = ts.p.subGridModel[0].mapping || ts.p.subGridModel[0].name;
if (f) {
for (i=0;i<f.length;i++) {
subGridCell(trdiv, $(f[i],this).text() || ' ',i);
}
}
}
$(dummy).append(trdiv);
});
}
var pID = $("table:first",ts.grid.bDiv).attr("id")+"_";
$("#"+pID+sbid).append(dummy);
ts.grid.hDiv.loading = false;
$("#load_"+ts.p.id).hide();
return false;
};
var subGridJson = function(sjxml, sbid){
var tddiv,result , i,cur, sgmap,j,
dummy = $("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),
trdiv = $("<tr></tr>");
for (i = 0; i<ts.p.subGridModel[0].name.length; i++) {
tddiv = $("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+ts.p.direction+"'></th>");
$(tddiv).html(ts.p.subGridModel[0].name[i]);
$(tddiv).width( ts.p.subGridModel[0].width[i]);
$(trdiv).append(tddiv);
}
$(dummy).append(trdiv);
if (sjxml){
sgmap = ts.p.jsonReader.subgrid;
result = sjxml[sgmap.root];
if ( typeof result !== 'undefined' ) {
for (i=0;i<result.length;i++) {
cur = result[i];
trdiv = $("<tr class='ui-widget-content ui-subtblcell'></tr>");
if(sgmap.repeatitems === true) {
if(sgmap.cell) { cur=cur[sgmap.cell]; }
for (j=0;j<cur.length;j++) {
subGridCell(trdiv, cur[j] || ' ',j);
}
} else {
var f = ts.p.subGridModel[0].mapping || ts.p.subGridModel[0].name;
if(f.length) {
for (j=0;j<f.length;j++) {
subGridCell(trdiv, cur[f[j]] || ' ',j);
}
}
}
$(dummy).append(trdiv);
}
}
}
var pID = $("table:first",ts.grid.bDiv).attr("id")+"_";
$("#"+pID+sbid).append(dummy);
ts.grid.hDiv.loading = false;
$("#load_"+ts.p.id).hide();
return false;
};
var populatesubgrid = function( rd )
{
var sid,dp, i, j;
sid = $(rd).attr("id");
dp = {nd_: (new Date().getTime())};
dp[ts.p.prmNames.subgridid]=sid;
if(!ts.p.subGridModel[0]) { return false; }
if(ts.p.subGridModel[0].params) {
for(j=0; j < ts.p.subGridModel[0].params.length; j++) {
for(i=0; i<ts.p.colModel.length; i++) {
if(ts.p.colModel[i].name == ts.p.subGridModel[0].params[j]) {
dp[ts.p.colModel[i].name]= $("td:eq("+i+")",rd).text().replace(/\ \;/ig,'');
}
}
}
}
if(!ts.grid.hDiv.loading) {
ts.grid.hDiv.loading = true;
$("#load_"+ts.p.id).show();
if(!ts.p.subgridtype) { ts.p.subgridtype = ts.p.datatype; }
if($.isFunction(ts.p.subgridtype)) {
ts.p.subgridtype.call(ts, dp);
} else {
ts.p.subgridtype = ts.p.subgridtype.toLowerCase();
}
switch(ts.p.subgridtype) {
case "xml":
case "json":
$.ajax($.extend({
type:ts.p.mtype,
url: ts.p.subGridUrl,
dataType:ts.p.subgridtype,
data: $.isFunction(ts.p.serializeSubGridData)? ts.p.serializeSubGridData.call(ts, dp) : dp,
complete: function(sxml) {
if(ts.p.subgridtype == "xml") {
subGridXml(sxml.responseXML, sid);
} else {
subGridJson($.jgrid.parse(sxml.responseText),sid);
}
sxml=null;
}
}, $.jgrid.ajaxOptions, ts.p.ajaxSubgridOptions || {}));
break;
}
}
return false;
};
var _id, pID,atd, nhc=0, bfsc, r;
$.each(ts.p.colModel,function(i,v){
if(this.hidden === true || this.name == 'rn' || this.name == 'cb') {
nhc++;
}
});
var len = ts.rows.length, i=1;
if( sind !== undefined && sind > 0) {
i = sind;
len = sind+1;
}
while(i < len) {
if($(ts.rows[i]).hasClass('jqgrow')) {
$(ts.rows[i].cells[pos]).bind('click', function(e) {
var tr = $(this).parent("tr")[0];
r = tr.nextSibling;
if($(this).hasClass("sgcollapsed")) {
pID = ts.p.id;
_id = tr.id;
if(ts.p.subGridOptions.reloadOnExpand === true || ( ts.p.subGridOptions.reloadOnExpand === false && !$(r).hasClass('ui-subgrid') ) ) {
atd = pos >=1 ? "<td colspan='"+pos+"'> </td>":"";
bfsc =true;
if($.isFunction(ts.p.subGridBeforeExpand)) {
bfsc = ts.p.subGridBeforeExpand.call(ts, pID+"_"+_id,_id);
}
if(bfsc === false) {return false;}
$(tr).after( "<tr role='row' class='ui-subgrid'>"+atd+"<td class='ui-widget-content subgrid-cell'><span class='ui-icon "+ts.p.subGridOptions.openicon+"'></span></td><td colspan='"+parseInt(ts.p.colNames.length-1-nhc,10)+"' class='ui-widget-content subgrid-data'><div id="+pID+"_"+_id+" class='tablediv'></div></td></tr>" );
if( $.isFunction(ts.p.subGridRowExpanded)) {
ts.p.subGridRowExpanded.call(ts, pID+"_"+ _id,_id);
} else {
populatesubgrid(tr);
}
} else {
$(r).show();
}
$(this).html("<a href='javascript:void(0);'><span class='ui-icon "+ts.p.subGridOptions.minusicon+"'></span></a>").removeClass("sgcollapsed").addClass("sgexpanded");
if(ts.p.subGridOptions.selectOnExpand) {
$(ts).jqGrid('setSelection',_id);
}
} else if($(this).hasClass("sgexpanded")) {
bfsc = true;
if( $.isFunction(ts.p.subGridRowColapsed)) {
_id = tr.id;
bfsc = ts.p.subGridRowColapsed.call(ts, pID+"_"+_id,_id );
}
if(bfsc===false) {return false;}
if(ts.p.subGridOptions.reloadOnExpand === true) {
$(r).remove(".ui-subgrid");
} else if($(r).hasClass('ui-subgrid')) { // incase of dynamic deleting
$(r).hide();
}
$(this).html("<a href='javascript:void(0);'><span class='ui-icon "+ts.p.subGridOptions.plusicon+"'></span></a>").removeClass("sgexpanded").addClass("sgcollapsed");
}
return false;
});
}
if(ts.p.subGridOptions.expandOnLoad === true) {
$(ts.rows[i].cells[pos]).trigger('click');
}
i++;
}
ts.subGridXml = function(xml,sid) {subGridXml(xml,sid);};
ts.subGridJson = function(json,sid) {subGridJson(json,sid);};
});
},
expandSubGridRow : function(rowid) {
return this.each(function () {
var $t = this;
if(!$t.grid && !rowid) {return;}
if($t.p.subGrid===true) {
var rc = $(this).jqGrid("getInd",rowid,true);
if(rc) {
var sgc = $("td.sgcollapsed",rc)[0];
if(sgc) {
$(sgc).trigger("click");
}
}
}
});
},
collapseSubGridRow : function(rowid) {
return this.each(function () {
var $t = this;
if(!$t.grid && !rowid) {return;}
if($t.p.subGrid===true) {
var rc = $(this).jqGrid("getInd",rowid,true);
if(rc) {
var sgc = $("td.sgexpanded",rc)[0];
if(sgc) {
$(sgc).trigger("click");
}
}
}
});
},
toggleSubGridRow : function(rowid) {
return this.each(function () {
var $t = this;
if(!$t.grid && !rowid) {return;}
if($t.p.subGrid===true) {
var rc = $(this).jqGrid("getInd",rowid,true);
if(rc) {
var sgc = $("td.sgcollapsed",rc)[0];
if(sgc) {
$(sgc).trigger("click");
} else {
sgc = $("td.sgexpanded",rc)[0];
if(sgc) {
$(sgc).trigger("click");
}
}
}
}
});
}
});
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/grid.subgrid.js | JavaScript | art | 9,611 |
// Grouping module
;(function($){
$.jgrid.extend({
groupingSetup : function () {
return this.each(function (){
var $t = this,
grp = $t.p.groupingView;
if(grp !== null && ( (typeof grp === 'object') || $.isFunction(grp) ) ) {
if(!grp.groupField.length) {
$t.p.grouping = false;
} else {
if ( typeof(grp.visibiltyOnNextGrouping) == 'undefined') {
grp.visibiltyOnNextGrouping = [];
}
for(var i=0;i<grp.groupField.length;i++) {
if(!grp.groupOrder[i]) {
grp.groupOrder[i] = 'asc';
}
if(!grp.groupText[i]) {
grp.groupText[i] = '{0}';
}
if( typeof(grp.groupColumnShow[i]) != 'boolean') {
grp.groupColumnShow[i] = true;
}
if( typeof(grp.groupSummary[i]) != 'boolean') {
grp.groupSummary[i] = false;
}
if(grp.groupColumnShow[i] === true) {
grp.visibiltyOnNextGrouping[i] = true;
$($t).jqGrid('showCol',grp.groupField[i]);
} else {
grp.visibiltyOnNextGrouping[i] = $("#"+$t.p.id+"_"+grp.groupField[i]).is(":visible");
$($t).jqGrid('hideCol',grp.groupField[i]);
}
grp.sortitems[i] = [];
grp.sortnames[i] = [];
grp.summaryval[i] = [];
if(grp.groupSummary[i]) {
grp.summary[i] =[];
var cm = $t.p.colModel;
for(var j=0, cml = cm.length; j < cml; j++) {
if(cm[j].summaryType) {
grp.summary[i].push({nm:cm[j].name,st:cm[j].summaryType, v:''});
}
}
}
}
$t.p.scroll = false;
$t.p.rownumbers = false;
$t.p.subGrid = false;
$t.p.treeGrid = false;
$t.p.gridview = true;
}
} else {
$t.p.grouping = false;
}
});
},
groupingPrepare : function (rData, items, gdata, record) {
this.each(function(){
// currently only one level
// Is this a good idea to do it so!!!!?????
items[0] += "";
var itm = items[0].toString().split(' ').join('');
var grp = this.p.groupingView, $t= this;
if(gdata.hasOwnProperty(itm)) {
gdata[itm].push(rData);
} else {
gdata[itm] = [];
gdata[itm].push(rData);
grp.sortitems[0].push(itm);
grp.sortnames[0].push($.trim(items[0].toString()));
grp.summaryval[0][itm] = $.extend(true,[],grp.summary[0]);
}
if(grp.groupSummary[0]) {
$.each(grp.summaryval[0][itm],function(i,n) {
if ($.isFunction(this.st)) {
this.v = this.st.call($t, this.v, this.nm, record);
} else {
this.v = $($t).jqGrid('groupingCalculations.'+this.st, this.v, this.nm, record);
}
});
}
});
return gdata;
},
groupingToggle : function(hid){
this.each(function(){
var $t = this,
grp = $t.p.groupingView,
strpos = hid.lastIndexOf('_'),
uid = hid.substring(0,strpos+1),
num = parseInt(hid.substring(strpos+1),10)+1,
minus = grp.minusicon,
plus = grp.plusicon,
tar = $("#"+hid),
r = tar[0].nextSibling,
tarspan = $("#"+hid+" span."+"tree-wrap-"+$t.p.direction),
collapsed = false;
if( tarspan.hasClass(minus) ) {
if(grp.showSummaryOnHide && grp.groupSummary[0]) {
if(r){
while(r) {
if($(r).hasClass('jqfoot') ) { break; }
$(r).hide();
r = r.nextSibling;
}
}
} else {
if(r){
while(r) {
if($(r).attr('id') ==uid+String(num) ) { break; }
$(r).hide();
r = r.nextSibling;
}
}
}
tarspan.removeClass(minus).addClass(plus);
collapsed = true;
} else {
if(r){
while(r) {
if($(r).attr('id') ==uid+String(num) ) { break; }
$(r).show();
r = r.nextSibling;
}
}
tarspan.removeClass(plus).addClass(minus);
collapsed = false;
}
if( $.isFunction($t.p.onClickGroup)) { $t.p.onClickGroup.call($t, hid , collapsed); }
});
return false;
},
groupingRender : function (grdata, colspans ) {
return this.each(function(){
var $t = this,
grp = $t.p.groupingView,
str = "", icon = "", hid, pmrtl ="", gv, cp, ii;
//only one level for now
if(!grp.groupDataSorted) {
// ???? TO BE IMPROVED
grp.sortitems[0].sort();
grp.sortnames[0].sort();
if(grp.groupOrder[0].toLowerCase() == 'desc')
{
grp.sortitems[0].reverse();
grp.sortnames[0].reverse();
}
}
if(grp.groupCollapse) { pmrtl = grp.plusicon; }
else {pmrtl = grp.minusicon;}
pmrtl += " tree-wrap-"+$t.p.direction;
ii = 0;
while(ii < colspans) {
if($t.p.colModel[ii].name == grp.groupField[0]) {
cp = ii;
break;
}
ii++;
}
$.each(grp.sortitems[0],function(i,n){
hid = $t.p.id+"ghead_"+i;
icon = "<span style='cursor:pointer;' class='ui-icon "+pmrtl+"' onclick=\"jQuery('#"+$t.p.id+"').jqGrid('groupingToggle','"+hid+"');return false;\"></span>";
try {
gv = $t.formatter(hid, grp.sortnames[0][i], cp, grp.sortitems[0] );
} catch (egv) {
gv = grp.sortnames[0][i];
}
str += "<tr id=\""+hid+"\" role=\"row\" class= \"ui-widget-content jqgroup ui-row-"+$t.p.direction+"\"><td colspan=\""+colspans+"\">"+icon+$.jgrid.format(grp.groupText[0], gv, grdata[n].length)+"</td></tr>";
for(var kk=0;kk<grdata[n].length;kk++) {
str += grdata[n][kk].join('');
}
if(grp.groupSummary[0]) {
var hhdr = "";
if(grp.groupCollapse && !grp.showSummaryOnHide) {
hhdr = " style=\"display:none;\"";
}
str += "<tr"+hhdr+" role=\"row\" class=\"ui-widget-content jqfoot ui-row-"+$t.p.direction+"\">";
var fdata = grp.summaryval[0][n],
cm = $t.p.colModel,
vv, grlen = grdata[n].length;
for(var k=0; k<colspans;k++) {
var tmpdata = "<td "+$t.formatCol(k,1,'')+"> </td>",
tplfld = "{0}";
$.each(fdata,function(){
if(this.nm == cm[k].name) {
if(cm[k].summaryTpl) {
tplfld = cm[k].summaryTpl;
}
if(this.st == 'avg') {
if(this.v && grlen > 0) {
this.v = (this.v/grlen);
}
}
try {
vv = $t.formatter('', this.v, k, this);
} catch (ef) {
vv = this.v;
}
tmpdata= "<td "+$t.formatCol(k,1,'')+">"+$.jgrid.format(tplfld,vv)+ "</td>";
return false;
}
});
str += tmpdata;
}
str += "</tr>";
}
});
$("#"+$t.p.id+" tbody:first").append(str);
// free up memory
str = null;
});
},
groupingGroupBy : function (name, options, current) {
return this.each(function(){
var $t = this;
if(typeof(name) == "string") {
name = [name];
}
var grp = $t.p.groupingView;
$t.p.grouping = true;
// show previous hidden groups if they are hidden and weren't removed yet
for(var i=0;i<grp.groupField.length;i++) {
if(!grp.groupColumnShow[i] && grp.visibiltyOnNextGrouping[i]) {
$($t).jqGrid('showCol',grp.groupField[i]);
}
}
// set visibility status of current group columns on next grouping
for(var i=0;i<name.length;i++) {
grp.visibiltyOnNextGrouping[i] = $("#"+$t.p.id+"_"+name[i]).is(":visible");
}
$t.p.groupingView = $.extend($t.p.groupingView, options || {});
grp.groupField = name;
$($t).trigger("reloadGrid");
});
},
groupingRemove : function (current) {
return this.each(function(){
var $t = this;
if(typeof(current) == 'undefined') {
current = true;
}
$t.p.grouping = false;
if(current===true) {
var grp = $t.p.groupingView;
// show previous hidden groups if they are hidden and weren't removed yet
for(var i=0;i<grp.groupField.length;i++) {
if (!grp.groupColumnShow[i] && grp.visibiltyOnNextGrouping[i]) {
$($t).jqGrid('showCol', grp.groupField);
}
}
$("tr.jqgroup, tr.jqfoot","#"+$t.p.id+" tbody:first").remove();
$("tr.jqgrow:hidden","#"+$t.p.id+" tbody:first").show();
} else {
$($t).trigger("reloadGrid");
}
});
},
groupingCalculations : {
"sum" : function(v, field, rc) {
return parseFloat(v||0) + parseFloat((rc[field]||0));
},
"min" : function(v, field, rc) {
if(v==="") {
return parseFloat(rc[field]||0);
}
return Math.min(parseFloat(v),parseFloat(rc[field]||0));
},
"max" : function(v, field, rc) {
if(v==="") {
return parseFloat(rc[field]||0);
}
return Math.max(parseFloat(v),parseFloat(rc[field]||0));
},
"count" : function(v, field, rc) {
if(v==="") {v=0;}
if(rc.hasOwnProperty(field)) {
return v+1;
} else {
return 0;
}
},
"avg" : function(v, field, rc) {
// the same as sum, but at end we divide it
return parseFloat(v||0) + parseFloat((rc[field]||0));
}
}
});
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/src/grid.grouping.js | JavaScript | art | 8,895 |
/*
* jQuery UI Multiselect
*
* Authors:
* Michael Aufreiter (quasipartikel.at)
* Yanick Rochon (yanick.rochon[at]gmail[dot]com)
*
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://www.quasipartikel.at/multiselect/
*
*
* Depends:
* ui.core.js
* ui.sortable.js
*
* Optional:
* localization (http://plugins.jquery.com/project/localisation)
* scrollTo (http://plugins.jquery.com/project/ScrollTo)
*
* Todo:
* Make batch actions faster
* Implement dynamic insertion through remote calls
*/
(function($) {
$.widget("ui.multiselect", {
_init: function() {
this.element.hide();
this.id = this.element.attr("id");
this.container = $('<div class="ui-multiselect ui-helper-clearfix ui-widget"></div>').insertAfter(this.element);
this.count = 0; // number of currently selected options
this.selectedContainer = $('<div class="selected"></div>').appendTo(this.container);
this.availableContainer = $('<div class="available"></div>').appendTo(this.container);
this.selectedActions = $('<div class="actions ui-widget-header ui-helper-clearfix"><span class="count">0 '+$.ui.multiselect.locale.itemsCount+'</span><a href="#" class="remove-all">'+$.ui.multiselect.locale.removeAll+'</a></div>').appendTo(this.selectedContainer);
this.availableActions = $('<div class="actions ui-widget-header ui-helper-clearfix"><input type="text" class="search empty ui-widget-content ui-corner-all"/><a href="#" class="add-all">'+$.ui.multiselect.locale.addAll+'</a></div>').appendTo(this.availableContainer);
this.selectedList = $('<ul class="selected connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart', function(){return false;}).appendTo(this.selectedContainer);
this.availableList = $('<ul class="available connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart', function(){return false;}).appendTo(this.availableContainer);
var that = this;
// set dimensions
this.container.width(this.element.width()+1);
this.selectedContainer.width(Math.floor(this.element.width()*this.options.dividerLocation));
this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation)));
// fix list height to match <option> depending on their individual header's heights
this.selectedList.height(Math.max(this.element.height()-this.selectedActions.height(),1));
this.availableList.height(Math.max(this.element.height()-this.availableActions.height(),1));
if ( !this.options.animated ) {
this.options.show = 'show';
this.options.hide = 'hide';
}
// init lists
this._populateLists(this.element.find('option'));
// make selection sortable
if (this.options.sortable) {
$("ul.selected").sortable({
placeholder: 'ui-state-highlight',
axis: 'y',
update: function(event, ui) {
// apply the new sort order to the original selectbox
that.selectedList.find('li').each(function() {
if ($(this).data('optionLink'))
$(this).data('optionLink').remove().appendTo(that.element);
});
},
receive: function(event, ui) {
ui.item.data('optionLink').attr('selected', true);
// increment count
that.count += 1;
that._updateCount();
// workaround, because there's no way to reference
// the new element, see http://dev.jqueryui.com/ticket/4303
that.selectedList.children('.ui-draggable').each(function() {
$(this).removeClass('ui-draggable');
$(this).data('optionLink', ui.item.data('optionLink'));
$(this).data('idx', ui.item.data('idx'));
that._applyItemState($(this), true);
});
// workaround according to http://dev.jqueryui.com/ticket/4088
setTimeout(function() { ui.item.remove(); }, 1);
}
});
}
// set up livesearch
if (this.options.searchable) {
this._registerSearchEvents(this.availableContainer.find('input.search'));
} else {
$('.search').hide();
}
// batch actions
$(".remove-all").click(function() {
that._populateLists(that.element.find('option').removeAttr('selected'));
return false;
});
$(".add-all").click(function() {
that._populateLists(that.element.find('option').attr('selected', 'selected'));
return false;
});
},
destroy: function() {
this.element.show();
this.container.remove();
$.widget.prototype.destroy.apply(this, arguments);
},
_populateLists: function(options) {
this.selectedList.children('.ui-element').remove();
this.availableList.children('.ui-element').remove();
this.count = 0;
var that = this;
var items = $(options.map(function(i) {
var item = that._getOptionNode(this).appendTo(this.selected ? that.selectedList : that.availableList).show();
if (this.selected) that.count += 1;
that._applyItemState(item, this.selected);
item.data('idx', i);
return item[0];
}));
// update count
this._updateCount();
},
_updateCount: function() {
this.selectedContainer.find('span.count').text(this.count+" "+$.ui.multiselect.locale.itemsCount);
},
_getOptionNode: function(option) {
option = $(option);
var node = $('<li class="ui-state-default ui-element" title="'+option.text()+'"><span class="ui-icon"/>'+option.text()+'<a href="#" class="action"><span class="ui-corner-all ui-icon"/></a></li>').hide();
node.data('optionLink', option);
return node;
},
// clones an item with associated data
// didn't find a smarter away around this
_cloneWithData: function(clonee) {
var clone = clonee.clone();
clone.data('optionLink', clonee.data('optionLink'));
clone.data('idx', clonee.data('idx'));
return clone;
},
_setSelected: function(item, selected) {
item.data('optionLink').attr('selected', selected);
if (selected) {
var selectedItem = this._cloneWithData(item);
item[this.options.hide](this.options.animated, function() { $(this).remove(); });
selectedItem.appendTo(this.selectedList).hide()[this.options.show](this.options.animated);
this._applyItemState(selectedItem, true);
return selectedItem;
} else {
// look for successor based on initial option index
var items = this.availableList.find('li'), comparator = this.options.nodeComparator;
var succ = null, i = item.data('idx'), direction = comparator(item, $(items[i]));
// TODO: test needed for dynamic list populating
if ( direction ) {
while (i>=0 && i<items.length) {
direction > 0 ? i++ : i--;
if ( direction != comparator(item, $(items[i])) ) {
// going up, go back one item down, otherwise leave as is
succ = items[direction > 0 ? i : i+1];
break;
}
}
} else {
succ = items[i];
}
var availableItem = this._cloneWithData(item);
succ ? availableItem.insertBefore($(succ)) : availableItem.appendTo(this.availableList);
item[this.options.hide](this.options.animated, function() { $(this).remove(); });
availableItem.hide()[this.options.show](this.options.animated);
this._applyItemState(availableItem, false);
return availableItem;
}
},
_applyItemState: function(item, selected) {
if (selected) {
if (this.options.sortable)
item.children('span').addClass('ui-icon-arrowthick-2-n-s').removeClass('ui-helper-hidden').addClass('ui-icon');
else
item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon');
item.find('a.action span').addClass('ui-icon-minus').removeClass('ui-icon-plus');
this._registerRemoveEvents(item.find('a.action'));
} else {
item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon');
item.find('a.action span').addClass('ui-icon-plus').removeClass('ui-icon-minus');
this._registerAddEvents(item.find('a.action'));
}
this._registerHoverEvents(item);
},
// taken from John Resig's liveUpdate script
_filter: function(list) {
var input = $(this);
var rows = list.children('li'),
cache = rows.map(function(){
return $(this).text().toLowerCase();
});
var term = $.trim(input.val().toLowerCase()), scores = [];
if (!term) {
rows.show();
} else {
rows.hide();
cache.each(function(i) {
if (this.indexOf(term)>-1) { scores.push(i); }
});
$.each(scores, function() {
$(rows[this]).show();
});
}
},
_registerHoverEvents: function(elements) {
elements.removeClass('ui-state-hover');
elements.mouseover(function() {
$(this).addClass('ui-state-hover');
});
elements.mouseout(function() {
$(this).removeClass('ui-state-hover');
});
},
_registerAddEvents: function(elements) {
var that = this;
elements.click(function() {
var item = that._setSelected($(this).parent(), true);
that.count += 1;
that._updateCount();
return false;
})
// make draggable
.each(function() {
$(this).parent().draggable({
connectToSortable: 'ul.selected',
helper: function() {
var selectedItem = that._cloneWithData($(this)).width($(this).width() - 50);
selectedItem.width($(this).width());
return selectedItem;
},
appendTo: '.ui-multiselect',
containment: '.ui-multiselect',
revert: 'invalid'
});
});
},
_registerRemoveEvents: function(elements) {
var that = this;
elements.click(function() {
that._setSelected($(this).parent(), false);
that.count -= 1;
that._updateCount();
return false;
});
},
_registerSearchEvents: function(input) {
var that = this;
input.focus(function() {
$(this).addClass('ui-state-active');
})
.blur(function() {
$(this).removeClass('ui-state-active');
})
.keypress(function(e) {
if (e.keyCode == 13)
return false;
})
.keyup(function() {
that._filter.apply(this, [that.availableList]);
});
}
});
$.extend($.ui.multiselect, {
defaults: {
sortable: true,
searchable: true,
animated: 'fast',
show: 'slideDown',
hide: 'slideUp',
dividerLocation: 0.6,
nodeComparator: function(node1,node2) {
var text1 = node1.text(),
text2 = node2.text();
return text1 == text2 ? 0 : (text1 < text2 ? -1 : 1);
}
},
locale: {
addAll:'Add all',
removeAll:'Remove all',
itemsCount:'items selected'
}
});
})(jQuery);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/ui.multiselect.js | JavaScript | art | 10,263 |
jQuery("#listdnd").tableDnD({scrollAmount:0});
jQuery("#listdnd").jqGrid({
url:'server.php?q=1',
datatype: "xml",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pagerdnd'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"XML Example",
gridComplete: function() {
$("#_empty","#listdnd").addClass("nodrag nodrop");
jQuery("#listdnd").tableDnDUpdate();
},
editurl:"someurl.php"
}).navGrid('#pager1',{edit:false,add:false,del:false});
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/js/tablednd.js | JavaScript | art | 1,001 |
<div style="font-size:12px;">
Just like edition it is possible to check the data entered from the user. <br/>
This is done with the new property searchrules.<br/>
Try to enter non numeric value in <b>id</b> field
</div>
<br />
<table id="grps2"></table>
<div id="pgrps2"></div>
<script src="40grpsearch2.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="grps2"></table>
<div id="pgrps2"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#grps2").jqGrid({
url:'server.php?q=4',
datatype: "json",
colNames:['Inv No', 'Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id', key : true, index:'id', width:55, searchtype:"integer", searchrules:{"required":true, "number":true, "maxValue":13}},
{name:'invdate',index:'invdate', width:90},
{name:'name', index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right", searchtype:"number"},
{name:'tax',index:'tax', width:80, align:"right", searchtype:"number"},
{name:'total',index:'total', width:80,align:"right", searchtype:"number"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#pgrps2',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
jsonReader: {
repeatitems : false
},
caption: "Show query in search",
height: '100%'
});
jQuery("#grps2").jqGrid('navGrid','#pgrps2',
{edit:false,add:false,del:false},
{},
{},
{},
{multipleSearch:true, multipleGroup:true, showQuery: true}
);
</XMP>
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/40grpsearch2.html | HTML | art | 1,636 |
var mydata = [
{id:"1",invdate:"2010-05-24",name:"test",note:"note",tax:"10.00",total:"2111.00"} ,
{id:"2",invdate:"2010-05-25",name:"test2",note:"note2",tax:"20.00",total:"320.00"},
{id:"3",invdate:"2007-09-01",name:"test3",note:"note3",tax:"30.00",total:"430.00"},
{id:"4",invdate:"2007-10-04",name:"test",note:"note",tax:"10.00",total:"210.00"},
{id:"5",invdate:"2007-10-05",name:"test2",note:"note2",tax:"20.00",total:"320.00"},
{id:"6",invdate:"2007-09-06",name:"test3",note:"note3",tax:"30.00",total:"430.00"},
{id:"7",invdate:"2007-10-04",name:"test",note:"note",tax:"10.00",total:"210.00"},
{id:"8",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"21.00",total:"320.00"},
{id:"9",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"11",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"12",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"13",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"14",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"15",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"16",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"17",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"18",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"19",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"21",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"22",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"23",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"24",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"25",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"26",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"27",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"28",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"29",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}
];
jQuery("#list485").jqGrid({
data: mydata,
datatype: "local",
height: 'auto',
rowNum: 30,
rowList: [10,20,30],
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:60, sorttype:"int"},
{name:'invdate',index:'invdate', width:90, sorttype:"date", formatter:"date"},
{name:'name',index:'name', width:100, editable:true},
{name:'amount',index:'amount', width:80, align:"right",sorttype:"float", formatter:"number", editable:true},
{name:'tax',index:'tax', width:80, align:"right",sorttype:"float", editable:true},
{name:'total',index:'total', width:80,align:"right",sorttype:"float"},
{name:'note',index:'note', width:150, sortable:false}
],
pager: "#plist485",
viewrecords: true,
sortname: 'name',
grouping:true,
groupingView : {
groupField : ['name'],
groupColumnShow : [true],
groupText : ['<b>{0} - {1} Item(s)</b>'],
groupCollapse : true,
groupOrder: ['desc']
},
caption: "Initially hidden data"
}); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/38array5.js | JavaScript | art | 3,790 |
<div style="font-size:12px;">
This example show the new formatter. The example show using of the common format options <br/>
that are ajustable in the language file <br/>
<br/>
</div>
<br />
<table id="frmgrid"></table>
<div id="pfrmgrid"></div>
<script src="formatter.js" type="text/javascript"> </script>
<br /><br />
<div style="font-size:12px;">
<b> Description </b>
<br />
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#frmgrid").jqGrid({
url:'editing.php?q=1',
datatype: "xml",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Closed','Ship via','Notes'],
colModel:[
{name:'id',index:'id', width:55,formatter: 'integer'},
{name:'invdate',index:'invdate', width:80,formatter:'date'},
{name:'name',index:'name', width:90, formatter: 'link'},
{name:'amount',index:'amount', width:60, align:"right",formatter:'currency'},
{name:'tax',index:'tax', width:60, align:"right",formatter:'currency'},
{name:'total',index:'total', width:60,align:"right",formatter:'currency'},
{name:'closed',index:'closed',width:55,align:'center',formatter:'checkbox'},
{name:'ship_via',index:'ship_via',width:70},
{name:'note',index:'note', width:100, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pfrmgrid',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"Formatter Example",
height:210
});
</XMP>
</div> | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/formatter.html | HTML | art | 1,468 |
var mydata = [
{id:"1",invdate:"2010-05-24",name:"test",note:"note",tax:"10.00",total:"2111.00"} ,
{id:"2",invdate:"2010-05-25",name:"test2",note:"note2",tax:"20.00",total:"320.00"},
{id:"3",invdate:"2007-09-01",name:"test3",note:"note3",tax:"30.00",total:"430.00"},
{id:"4",invdate:"2007-10-04",name:"test",note:"note",tax:"10.00",total:"210.00"},
{id:"5",invdate:"2007-10-05",name:"test2",note:"note2",tax:"20.00",total:"320.00"},
{id:"6",invdate:"2007-09-06",name:"test3",note:"note3",tax:"30.00",total:"430.00"},
{id:"7",invdate:"2007-10-04",name:"test",note:"note",tax:"10.00",total:"210.00"},
{id:"8",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"21.00",total:"320.00"},
{id:"9",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"11",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"12",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"13",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"14",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"15",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"16",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"17",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"18",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"19",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"21",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"22",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"23",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"24",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"25",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"26",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"27",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"28",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"29",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}
];
jQuery("#list483").jqGrid({
data: mydata,
datatype: "local",
height: 'auto',
rowNum: 30,
rowList: [10,20,30],
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:60, sorttype:"int"},
{name:'invdate',index:'invdate', width:90, sorttype:"date", formatter:"date"},
{name:'name',index:'name', width:100, editable:true},
{name:'amount',index:'amount', width:80, align:"right",sorttype:"float", formatter:"number", editable:true},
{name:'tax',index:'tax', width:80, align:"right",sorttype:"float", editable:true},
{name:'total',index:'total', width:80,align:"right",sorttype:"float"},
{name:'note',index:'note', width:150, sortable:false}
],
pager: "#plist483",
viewrecords: true,
sortname: 'name',
grouping:true,
groupingView : {
groupField : ['name'],
groupColumnShow : [false],
groupText : ['<b>{0} - {1} Item(s)</b>']
},
caption: "Configure group header row"
}); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/38array3.js | JavaScript | art | 3,738 |
jQuery("#bigset").jqGrid({
url:'bigset.php',
datatype: "json",
height: 255,
colNames:['Index','Name', 'Code'],
colModel:[
{name:'item_id',index:'item_id', width:65},
{name:'item',index:'item', width:150},
{name:'item_cd',index:'item_cd', width:100}
],
rowNum:12,
// rowList:[10,20,30],
mtype: "POST",
pager: jQuery('#pagerb'),
pgbuttons: false,
pgtext: false,
pginput:false,
sortname: 'item_id',
viewrecords: true,
sortorder: "asc"
});
var timeoutHnd;
var flAuto = false;
function doSearch(ev){
if(!flAuto)
return;
// var elem = ev.target||ev.srcElement;
if(timeoutHnd)
clearTimeout(timeoutHnd)
timeoutHnd = setTimeout(gridReload,500)
}
function gridReload(){
var nm_mask = jQuery("#item_nm").val();
var cd_mask = jQuery("#search_cd").val();
jQuery("#bigset").jqGrid('setGridParam',{url:"bigset.php?nm_mask="+nm_mask+"&cd_mask="+cd_mask,page:1}).trigger("reloadGrid");
}
function enableAutosubmit(state){
flAuto = state;
jQuery("#submitButton").attr("disabled",state);
}
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/bigset.js | JavaScript | art | 1,107 |
jQuery("#newapi").jqGrid({
url:'server.jsp?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#pnewapi',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"New API Example"
});
jQuery("#newapi").jqGrid('navGrid','#pnewapi',{edit:false,add:false,del:false});
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/36newapi.js | JavaScript | art | 841 |
jQuery("#frmgrid").jqGrid({
url:'editing.php?q=1',
datatype: "xml",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Closed','Ship via','Notes'],
colModel:[
{name:'id',index:'id', width:55,formatter: 'integer'},
{name:'invdate',index:'invdate', width:80,formatter:'date'},
{name:'name',index:'name', width:90, formatter: 'link'},
{name:'amount',index:'amount', width:60, align:"right",formatter:'currency'},
{name:'tax',index:'tax', width:60, align:"right",formatter:'currency'},
{name:'total',index:'total', width:60,align:"right",formatter:'currency'},
{name:'closed',index:'closed',width:55,align:'center',formatter:'checkbox'},
{name:'ship_via',index:'ship_via',width:70},
{name:'note',index:'note', width:100, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pfrmgrid',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"Formatter Example",
height:210
}); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/formatter.js | JavaScript | art | 1,004 |
<link rel="stylesheet" type="text/css" media="screen" href="themes/redmond/jquery-ui-1.8.2.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="themes/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="themes/ui.multiselect.css" />
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="js/jquery.contextmenu.js" type="text/javascript"></script>
<script src="js/jquery.layout.js" type="text/javascript"></script>
<script src="js/jquery.tablednd.js" type="text/javascript"></script>
<div style="font-size:12px;">
Since it is not possible to meat every user requirement in the validation when we use editing<br>
we have created a possibility to create one defined from the developer<br>
This is done just with two options in colModel - custom:true (which initialize this) and custo_func which should perform validation<br>
In our example the amount value should have values between 200 and 300 when we perform editing and adding.
<br/>
<br />
<table id="custv"></table>
<div id="pcustv"></div>
<script src="36custvalid.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="custv"></table>
<div id="pcustv"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
function mycheck(value) {
if(parseFloat(value) >= 200 && parseFloat(value)<=300) {
return [true,"",""];
} else {
return [false,"The value should be between 200 and 300!",""];
}
}
jQuery("#custv").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55, editable:true},
{name:'invdate',index:'invdate', width:90,editable:true},
{name:'name',index:'name asc, invdate', width:100,editable:true},
{name:'amount',index:'amount', width:80, align:"right",editable:true,editrules:{custom:true,custom_func:mycheck}},
{name:'tax',index:'tax', width:80, align:"right",editable:true},
{name:'total',index:'total', width:80,align:"right",editable:true},
{name:'note',index:'note', width:150, sortable:false,editable:true}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pcustv',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"Custom Validation",
editurl: "server.php?q=dummy"
});
jQuery("#custv").jqGrid('navGrid','#pcustv',{del:false},{reloadAfterSubmit:false},{reloadAfterSubmit:false});
</XMP>
</div> | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/36custvalid.html | HTML | art | 2,704 |
<link rel="stylesheet" type="text/css" media="screen" href="themes/redmond/jquery-ui-1.8.2.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="themes/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="themes/ui.multiselect.css" />
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="js/jquery.contextmenu.js" type="text/javascript"></script>
<script src="js/jquery.layout.js" type="text/javascript"></script>
<script src="js/jquery.tablednd.js" type="text/javascript"></script>
<div style="font-size:12px;">
This is experimental method which resizes the grid<br>
This feature uses the jQuery UI resizable widget<br>
<br>
<table id="resize"></table>
<div id="presize"></div>
<script src="36resize.js" type="text/javascript"> </script>
<br />
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="newapi"></table>
<div id="pnewapi"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#resize").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#presize',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"New API Example"
});
jQuery("#resize").jqGrid('navGrid','#presize',{edit:false,add:false,del:false});
jQuery("#resize").jqGrid('gridResize',{minWidth:350,maxWidth:800,minHeight:80, maxHeight:350});</XMP>
</div> | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/36resize.html | HTML | art | 2,099 |
jQuery("#48remote2").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55, editable:true, sorttype:'int',summaryType:'count', summaryTpl : '({0}) total'},
{name:'invdate',index:'invdate', width:90, sorttype:'date', formatter:'date', datefmt:'d/m/Y'},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right", sorttype:'number',formatter:'number',summaryType:'sum'},
{name:'tax',index:'tax', width:80, align:"right",sorttype:'number',formatter:'number',summaryType:'sum'},
{name:'total',index:'total', width:80,align:"right",sorttype:'number',formatter:'number', summaryType:'sum'},
{name:'note',index:'note', width:150, sortable:false,editable:true}
],
rowNum:10,
rowList:[10,20,30],
height: 'auto',
pager: '#p48remote2',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"Grouping with remote data",
grouping: true,
groupingView : {
groupField : ['name'],
groupColumnShow : [true],
groupText : ['<b>{0}</b>'],
groupCollapse : false,
groupOrder: ['asc'],
groupSummary : [true],
groupDataSorted : true
},
footerrow: true,
userDataOnFooter: true
});
jQuery("#48remote2").jqGrid('navGrid','#p48remote2',{add:false,edit:false,del:false});
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/38remote2.js | JavaScript | art | 1,467 |
<div style="font-size:12px;">
This example shows the basic steps to make the grid editable. To do that we need 3 steps.<br>
1. Mark which column in the grid is editable. This is done with a new property "editable:true"<br>
By default all columns in the grid are not editable.<br>
2. Specify the url where the server accept the posted data. This is done with a option "editurl".<br>
3. Use the three new methods: editRow, saveRow, restoreRow.<br>
- <b>editRow(rowid, keys)</b> - accept two parametres:- rowid - the unique id of the row and keys - which <br>
when true - we can use Enter and Escape keys to save and cancel editing. <br>
- <b>saveRow( rowid, callback, url, extraparams)</b> <br>
rowid - unique id of the row, callback - custom function - when defined accept data returned from the server after posting, <br>
url - when specified - overwrite the editurl parameter, extraparams - additinal params that can be passed to the server.<br>
When data is posted the format is id=rowid&name=value..., where the name is the "name" from colModel.<br>
- <b>restoreRow( rowid)</b> - restores the data to original values before the editing of the row.<br>
<b>Note:</b> Due to security reasons data is not saved to this server.
</div>
<br />
<table id="rowed1"></table>
<div id="prowed1"></div>
<br />
<input type="BUTTON" id="ed1" value="Edit row 13" />
<input type="BUTTON" id="sved1" disabled='true' value="Save row 13" />
<input type="BUTTON" id="cned1" disabled='true' value="Cancel Save" />
<script src="rowedex1.js" type="text/javascript"> </script>
<br />
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
...
<table id="rowed1"></table>
<div id="prowed1"></div>
<br />
<input type="BUTTON" id="ed1" value="Edit row 13" />
<input type="BUTTON" id="sved1" disabled='true' value="Save row 13" />
<input type="BUTTON" id="cned1" disabled='true' value="Cancel Save" />
<script src="rowedex1.js" type="text/javascript"> </script>
</XMP>
<b>Java Scrpt code</b>
<XMP>
...
jQuery("#rowed1").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90, editable:true},
{name:'name',index:'name', width:100,editable:true},
{name:'amount',index:'amount', width:80, align:"right",editable:true},
{name:'tax',index:'tax', width:80, align:"right",editable:true},
{name:'total',index:'total', width:80,align:"right",editable:true},
{name:'note',index:'note', width:150, sortable:false,editable:true}
],
rowNum:10,
rowList:[10,20,30],
pager: '#prowed1',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
editurl: "server.php",
caption: "Basic Example"
});
jQuery("#rowed1").jqGrid('navGrid',"#prowed1",{edit:false,add:false,del:false});
jQuery("#ed1").click( function() {
jQuery("#rowed1").jqGrid('editRow',"13");
this.disabled = 'true';
jQuery("#sved1,#cned1").attr("disabled",false);
});
jQuery("#sved1").click( function() {
jQuery("#rowed1").jqGrid('saveRow',"13");
jQuery("#sved1,#cned1").attr("disabled",true);
jQuery("#ed1").attr("disabled",false);
});
jQuery("#cned1").click( function() {
jQuery("#rowed1").jqGrid('restoreRow',"13");
jQuery("#sved1,#cned1").attr("disabled",true);
jQuery("#ed1").attr("disabled",false);
});
</XMP>
<b>PHP with MySQL</b>
<XMP>
...
$page = $_GET['page']; // get the requested page
$limit = $_GET['rows']; // get how many rows we want to have into the grid
$sidx = $_GET['sidx']; // get index row - i.e. user click to sort
$sord = $_GET['sord']; // get the direction
if(!$sidx) $sidx =1;
// connect to the database
$db = mysql_connect($dbhost, $dbuser, $dbpassword)
or die("Connection Error: " . mysql_error());
mysql_select_db($database) or die("Error conecting to db.");
$result = mysql_query("SELECT COUNT(*) AS count FROM invheader a, clients b WHERE a.client_id=b.client_id");
$row = mysql_fetch_array($result,MYSQL_ASSOC);
$count = $row['count'];
if( $count >0 ) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) $page=$total_pages;
$start = $limit*$page - $limit; // do not put $limit*($page - 1)
$SQL = "SELECT a.id, a.invdate, b.name, a.amount,a.tax,a.total,a.note FROM invheader a, clients b WHERE a.client_id=b.client_id ORDER BY $sidx $sord LIMIT $start , $limit";
$result = mysql_query( $SQL ) or die("Couldn t execute query.".mysql_error());
$responce->page = $page;
$responce->total = $total_pages;
$responce->records = $count;
$i=0;
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
$responce->rows[$i]['id']=$row[id];
$responce->rows[$i]['cell']=array($row[id],$row[invdate],$row[name],$row[amount],$row[tax],$row[total],$row[note]);
$i++;
}
echo json_encode($responce);
...
</XMP>
</div> | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/rowedex1.html | HTML | art | 4,990 |
<?php
include("dbconfig.php");
ini_set("display_errors",1);
// coment the above lines if php 5
//include("JSON.php");
//$json = new Services_JSON();
// end comment
$examp = $_REQUEST["q"]; //query number
$page = $_REQUEST['page']; // get the requested page
$limit = $_REQUEST['rows']; // get how many rows we want to have into the grid
$sidx = $_REQUEST['sidx']; // get index row - i.e. user click to sort
$sord = $_REQUEST['sord']; // get the direction
if(!$sidx) $sidx =1;
$wh = "";
$searchOn = Strip($_REQUEST['_search']);
if($searchOn=='true') {
$searchstr = Strip($_REQUEST['filters']);
//$wh= constructWhere($searchstr);
$jsona = json_decode($searchstr,true);
$wh = " AND ".getStringForGroup($jsona);
//var_dump($wh);
//echo $ss;
}
function constructWhere($s){
$qwery = "";
//['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc']
$qopers = array(
'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 " );
if ($s) {
$jsona = json_decode($s,true);
if(is_array($jsona)){
$gopr = $jsona['groupOp'];
$rules = $jsona['rules'];
$i =0;
foreach($rules as $key=>$val) {
$field = $val['field'];
$op = $val['op'];
$v = $val['data'];
if($v && $op) {
$i++;
// ToSql in this case is absolutley needed
$v = ToSql($field,$op,$v);
if ($i == 1) $qwery = " AND ";
else $qwery .= " " .$gopr." ";
switch ($op) {
// in need other thing
case 'in' :
case 'ni' :
$qwery .= $field.$qopers[$op]." (".$v.")";
break;
default:
$qwery .= $field.$qopers[$op].$v;
}
}
}
}
}
return $qwery;
}
function getStringForGroup( $group )
{
$i_='';
$sopt = array('eq' => "=",'ne' => "<>",'lt' => "<",'le' => "<=",'gt' => ">",'ge' => ">=",'bw'=>" {$i_}LIKE ",'bn'=>" NOT {$i_}LIKE ",'in'=>' IN ','ni'=> ' NOT IN','ew'=>" {$i_}LIKE ",'en'=>" NOT {$i_}LIKE ",'cn'=>" {$i_}LIKE ",'nc'=>" NOT {$i_}LIKE ", 'nu'=>'IS NULL', 'nn'=>'IS NOT NULL');
$s = "(";
if( isset ($group['groups']) && is_array($group['groups']) && count($group['groups']) >0 )
{
for($j=0; $j<count($group['groups']);$j++ )
{
if(strlen($s) > 1 ) {
$s .= " ".$group['groupOp']." ";
}
try {
$dat = getStringForGroup($group['groups'][$j]);
$s .= $dat;
} catch (Exception $e) {
echo $e->getMessage();
}
}
}
if (isset($group['rules']) && count($group['rules'])>0 ) {
try{
foreach($group['rules'] as $key=>$val) {
if (strlen($s) > 1) {
$s .= " ".$group['groupOp']." ";
}
$field = $val['field'];
$op = $val['op'];
$v = $val['data'];
if( $op ) {
switch ($op)
{
case 'bw':
case 'bn':
$s .= $field.' '.$sopt[$op]."'$v%'";
break;
case 'ew':
case 'en':
$s .= $field.' '.$sopt[$op]."'%$v'";
break;
case 'cn':
case 'nc':
$s .= $field.' '.$sopt[$op]."'%$v%'";
break;
case 'in':
case 'ni':
$s .= $field.' '.$sopt[$op]."( '$v' )";
break;
case 'nu':
case 'nn':
$s .= $field.' '.$sopt[$op]." ";
break;
default :
$s .= $field.' '.$sopt[$op]." '$v' ";
break;
}
}
}
} catch (Exception $e) {
echo $e->getMessage();
}
}
$s .= ")";
if ($s == "()") {
//return array("",$prm); // ignore groups that don't have rules
return " 1=1 ";
} else {
return $s;;
}
}
function ToSql ($field, $oper, $val) {
// we need here more advanced checking using the type of the field - i.e. integer, string, float
switch ($field) {
case 'id':
return intval($val);
break;
case 'amount':
case 'tax':
case 'total':
return floatval($val);
break;
default :
//mysql_real_escape_string is better
if($oper=='bw' || $oper=='bn') return "'" . addslashes($val) . "%'";
else if ($oper=='ew' || $oper=='en') return "'%" . addcslashes($val) . "'";
else if ($oper=='cn' || $oper=='nc') return "'%" . addslashes($val) . "%'";
else return "'" . addslashes($val) . "'";
}
}
//echo $wh;
// connect to the database
$db = mysql_connect($dbhost, $dbuser, $dbpassword)
or die("Connection Error: " . mysql_error());
mysql_select_db($database) or die("Error conecting to db.");
switch ($examp) {
case 1:
$result = mysql_query("SELECT COUNT(*) AS count FROM invheader a, clients b WHERE a.client_id=b.client_id".$wh);
// var_dump("SELECT COUNT(*) AS count FROM invheader a, clients b WHERE a.client_id=b.client_id".$wh);
$row = mysql_fetch_array($result,MYSQL_ASSOC);
$count = $row['count'];
if( $count >0 ) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) $page=$total_pages;
$start = $limit*$page - $limit; // do not put $limit*($page - 1)
if ($start<0) $start = 0;
$SQL = "SELECT a.id, a.invdate, b.name, a.amount,a.tax,a.total,a.note FROM invheader a, clients b WHERE a.client_id=b.client_id".$wh." ORDER BY ".$sidx." ".$sord. " LIMIT ".$start." , ".$limit;
$result = mysql_query( $SQL ) or die("Could not execute query.".mysql_error());
$responce->page = $page;
$responce->total = $total_pages;
$responce->records = $count;
$i=0;
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
$responce->rows[$i]['id']=$row['id'];
$responce->rows[$i]['cell']=array($row['id'],$row['invdate'],$row['name'],$row['amount'],$row['tax'],$row['total'],$row['note']);
$i++;
}
//echo $json->encode($responce); // coment if php 5
echo json_encode($responce);
break;
case 3:
}
mysql_close($db);
function Strip($value)
{
if(get_magic_quotes_gpc() != 0)
{
if(is_array($value))
if ( array_is_associative($value) )
{
foreach( $value as $k=>$v)
$tmp_val[$k] = stripslashes($v);
$value = $tmp_val;
}
else
for($j = 0; $j < sizeof($value); $j++)
$value[$j] = stripslashes($value[$j]);
else
$value = stripslashes($value);
}
return $value;
}
function array_is_associative ($array)
{
if ( is_array($array) && ! empty($array) )
{
for ( $iterator = count($array) - 1; $iterator; $iterator-- )
{
if ( ! array_key_exists($iterator, $array) ) { return true; }
}
return ! array_key_exists(0, $array);
}
return false;
}
?>
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/search_adv.php | PHP | art | 7,025 |
<link rel="stylesheet" type="text/css" media="screen" href="themes/redmond/jquery-ui-1.8.2.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="themes/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="themes/ui.multiselect.css" />
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="js/jquery.contextmenu.js" type="text/javascript"></script>
<script src="js/jquery.layout.js" type="text/javascript"></script>
<script src="js/jquery.tablednd.js" type="text/javascript"></script>
<div style="font-size:12px;">
From this version it is possible to load a big array data at once. The only that is needed is to <br/>
set datatype to local and the new option data to the array that contain the data. <br/><br/>
Note that paging and sorting work correct. It is important to note that in order sorting to work correct a sorttype param in colModel should be set.
</div>
<br />
<table id="list47"></table>
<div id="plist47"></div>
<script src="37array.js" type="text/javascript"></script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
...
<table id="list47"></table>
<div id="plist47"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
var mydata = [
{id:"1",invdate:"2010-05-24",name:"test",note:"note",tax:"10.00",total:"2111.00"} ,
{id:"2",invdate:"2010-05-25",name:"test2",note:"note2",tax:"20.00",total:"320.00"},
{id:"3",invdate:"2007-09-01",name:"test3",note:"note3",tax:"30.00",total:"430.00"},
{id:"4",invdate:"2007-10-04",name:"test",note:"note",tax:"10.00",total:"210.00"},
{id:"5",invdate:"2007-10-05",name:"test2",note:"note2",tax:"20.00",total:"320.00"},
{id:"6",invdate:"2007-09-06",name:"test3",note:"note3",tax:"30.00",total:"430.00"},
{id:"7",invdate:"2007-10-04",name:"test",note:"note",tax:"10.00",total:"210.00"},
{id:"8",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"21.00",total:"320.00"},
{id:"9",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"11",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"12",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"13",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"14",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"15",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"16",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"17",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"18",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"19",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"21",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"22",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"23",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"24",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"25",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"26",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"27",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"28",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"29",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}
];
jQuery("#list47").jqGrid({
data: mydata,
datatype: "local",
height: 150,
rowNum: 10,
rowList: [10,20,30],
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:60, sorttype:"int"},
{name:'invdate',index:'invdate', width:90, sorttype:"date", formatter:"date"},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right",sorttype:"float", formatter:"number"},
{name:'tax',index:'tax', width:80, align:"right",sorttype:"float"},
{name:'total',index:'total', width:80,align:"right",sorttype:"float"},
{name:'note',index:'note', width:150, sortable:false}
],
pager: "#plist47",
viewrecords: true,
caption: "Manipulating Array Data"
});
</XMP>
</div> | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/37array.html | HTML | art | 4,917 |
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"
pageEncoding="GBK"%>
<%
String examp = request.getParameter("q");
System.out.println(examp);
%>
{
"page":"1",
"total":2,
"records":12,
"rows":[
{"id":"1","invdate":"invdate", "name":"name", "amount":"amount","tax":"tax","total":"total","note":"note"},
{"id":"2","invdate":"invdate", "name":"name", "amount":"amount","tax":"tax","total":"total","note":"note"},
{"id":"3","invdate":"invdate", "name":"name", "amount":"amount","tax":"tax","total":"total","note":"note"},
{"id":"4","invdate":"invdate", "name":"name", "amount":"amount","tax":"tax","total":"total","note":"note"},
{"id":"5","invdate":"invdate", "name":"name", "amount":"amount","tax":"tax","total":"total","note":"note"},
{"id":"6","invdate":"invdate", "name":"name", "amount":"amount","tax":"tax","total":"total","note":"note"},
{"id":"7","invdate":"invdate", "name":"name", "amount":"amount","tax":"tax","total":"total","note":"note"},
{"id":"8","invdate":"invdate", "name":"name", "amount":"amount","tax":"tax","total":"total","note":"note"},
{"id":"9","invdate":"invdate", "name":"name", "amount":"amount","tax":"tax","total":"total","note":"note"},
{"id":"10","invdate":"invdate", "name":"name", "amount":"amount","tax":"tax","total":"total","note":"note"},
{"id":"11","invdate":"invdate", "name":"name", "amount":"amount","tax":"tax","total":"total","note":"note"},
{"id":"12","invdate":"invdate", "name":"name", "amount":"amount","tax":"tax","total":"total","note":"note"}
]
}
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/server2.jsp | Java Server Pages | art | 1,576 |
var template1 =
{ "groupOp": "AND",
"rules": [
{ "field": "b.name", "op": "bw", "data": "Client 1" },
{ "field": "a.amount", "op": "gt", "data": "20"}
]
};
var template2 =
{ "groupOp": "AND",
"rules": [
{ "field": "b.name", "op": "eq", "data": "Client 2" },
{ "field": "a.id", "op": "le", "data": "10"}
]
} ;
jQuery("#grps3").jqGrid({
url:'search_adv.php?q=1',
datatype: "json",
colNames:['Inv No', 'Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id', key : true, index:'a.id', width:55, searchtype:"integer"},
{name:'invdate',index:'a.invdate', width:90},
{name:'name', index:'b.name', width:100},
{name:'amount',index:'a.amount', width:80, align:"right", searchtype:"number"},
{name:'tax',index:'a.tax', width:80, align:"right", searchtype:"number"},
{name:'total',index:'a.total', width:80,align:"right", searchtype:"number"},
{name:'note',index:'a.note', width:150, sortable:false}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#pgrps3',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption: "Show query in search",
height: '100%'
});
jQuery("#grps3").jqGrid('navGrid','#pgrps3',
{edit:false,add:false,del:false},
{},
{},
{},
{
multipleSearch:true,
multipleGroup:true,
showQuery: true,
// set the names of the template
"tmplNames" : ["Template One", "Template Two"],
// set the template contents
"tmplFilters": [template1, template2]
}
);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/40grpsearch3.js | JavaScript | art | 1,601 |
jQuery("#navgrid3").jqGrid({
url:'editing.php?q=1',
datatype: "xml",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Closed','Ship via','Notes'],
colModel:[
{name:'id',index:'id', width:55,editable:false,editoptions:{readonly:true,size:10}},
{name:'invdate',index:'invdate', width:80,
editable:true,
editoptions:{size:12,
dataInit:function(el){
$(el).datepicker({dateFormat:'yy-mm-dd'});
},
defaultValue: function(){
var currentTime = new Date();
var month = parseInt(currentTime.getMonth() + 1);
month = month <= 9 ? "0"+month : month;
var day = currentTime.getDate();
day = day <= 9 ? "0"+day : day;
var year = currentTime.getFullYear();
return year+"-"+month + "-"+day;
}
},
formoptions:{ rowpos:2, elmprefix:"(*)",elmsuffix:" yyyy-mm-dd" },
editrules:{required:true}
},
{name:'name',index:'name', width:90,editable:true,editoptions:{size:25}, formoptions:{ rowpos:1, label: "Name", elmprefix:"(*)"},editrules:{required:true}},
{name:'amount',index:'amount', width:60, align:"right",editable:true,editoptions:{size:10}, formoptions:{ rowpos:5,elmprefix:" "}},
{name:'tax',index:'tax', width:60, align:"right",editable:true,editoptions:{size:10},formoptions:{ rowpos:6,elmprefix:" "}},
{name:'total',index:'total', width:60,align:"right",editable:true,editoptions:{size:10}, formoptions:{ rowpos:7,elmprefix:" " }},
{name:'closed',index:'closed',width:55,align:'center',editable:true,edittype:"checkbox",editoptions:{value:"Yes:No",defaultValue:"Yes"}, formoptions:{ rowpos:4,elmprefix:" " }},
{name:'ship_via',index:'ship_via',width:70,
editable: true,
edittype:"select",
editoptions:{dataUrl:'test.txt', defaultValue:'Intime'},
formoptions:{ rowpos:3,elmprefix:" " }
},
{name:'note',index:'note', width:100, sortable:false,editable: true,edittype:"textarea", editoptions:{rows:"2",cols:"20"}, formoptions:{ rowpos:8,elmprefix:" " }}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pagernav3',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"Navigator Example",
editurl:"someurl.php",
height:210
});
jQuery("#navgrid3").jqGrid('navGrid','#pagernav3',
{view:true}, //options
{height:290,reloadAfterSubmit:false, jqModal:false, closeOnEscape:true, bottominfo:"Fields marked with (*) are required"}, // edit options
{height:290,reloadAfterSubmit:false,jqModal:false, closeOnEscape:true,bottominfo:"Fields marked with (*) are required", closeAfterAdd: true}, // add options
{reloadAfterSubmit:false,jqModal:false, closeOnEscape:true}, // del options
{closeOnEscape:true}, // search options
{height:250,jqModal:false,closeOnEscape:true} // view options
); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/navgrid3.js | JavaScript | art | 2,952 |
jQuery("#jqrtl").jqGrid({
direction: "rtl",
recordpos : "left",
url:'server.jsp?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55, editable:true},
{name:'invdate',index:'invdate', width:90,editable:true},
{name:'name',index:'name asc, invdate', width:100,editable:true},
{name:'amount',index:'amount', width:80, align:"right",editable:true},
{name:'tax',index:'tax', width:80, align:"right",editable:true},
{name:'total',index:'total', width:80,align:"right",editable:true},
{name:'note',index:'note', width:150, sortable:false,editable:true}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pjqrtl',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"RTL Example",
editurl: "server.php?q=dummy"
});
jQuery("#jqrtl").jqGrid('navGrid','#pjqrtl',{position:"right"},{reloadAfterSubmit:false},{reloadAfterSubmit:false});
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/36rtl.js | JavaScript | art | 1,032 |
jQuery("#treegrid2").jqGrid({
url: 'server.php?q=tree2',
treedatatype: "xml",
mtype: "POST",
colNames:["id","Account","Acc Num", "Debit", "Credit","Balance","Enabled"],
colModel:[
{name:'id',index:'id', width:1,hidden:true,key:true},
{name:'name1',index:'name', width:180},
{name:'num',index:'acc_num', width:80, align:"center"},
{name:'debit',index:'debit', width:80, align:"right"},
{name:'credit',index:'credit', width:80,align:"right"},
{name:'balance',index:'balance', width:80,align:"right"},
{name:'enbl', index:'enbl', width: 60, align:'center', formatter:'checkbox', editoptions:{value:'1:0'}, formatoptions:{disabled:false}}
],
height:'auto',
pager : "#ptreegrid2",
treeGrid: true,
ExpandColumn : 'name1',
caption: "Treegrid example"
});
var ci,rowid,ptr,td;
$('#treegrid2').contextMenu('myMenu1', {
bindings: {
'mchild': function(t) {
if(ptr && rowid && ci >=1) {
var gcn = $("#treegrid2").jqGrid('getFullTreeNode',ptr);
$(gcn).each(function(i,v){
$("td:eq("+ci+")",this).each(function(){
if(!$("input[type='checkbox']",this).attr("checked")) {
$(this).toggleClass("changed");
$("input[type='checkbox']",this).attr("defaultChecked",true).attr("checked","checked");
}
});
});
ptr = rowid=ci=null;
}
},
'umchild': function(t) {
if(ptr && rowid && ci >=1) {
var gcn = $("#treegrid2").jqGrid('getFullTreeNode',ptr);
$(gcn).each(function(){
$("td:eq("+ci+")",this).each(function(){
if($("input[type='checkbox']",this).attr("checked")) {
$(this).toggleClass("changed");
$("input[type='checkbox']",this).removeAttr("checked").attr("defaultChecked","");
}
});
});
ptr = rowid=ci=null;
}
}
},
onContextMenu: function(e, menu) {
td = e.target || e.srcElement;
ptr = $(td).parents("tr.jqgrow")[0];
ci = !$(td).is('td') ? $(td).parents("td:first")[0].cellIndex : td.cellIndex;
if($.browser.msie) {
ci = $.jgrid.getCellIndex(td);
}
if( ci >=1 ) {
rowid = ptr.id;
$('#treegrid2').jqGrid('setSelection',rowid,false);
return true;
} else {
//alert(ptr.id+" : "+ptr.rowIndex+" : "+ci);
return false;
}
}
});
$("#jqContextMenu").addClass("ui-widget ui-widget-content").css("font-size","12px");
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/treegridadv.js | JavaScript | art | 2,460 |
<div style="font-size:12px;">
This example demonstartes how we can control the error from the server.In this case we <br/>
point to not existing file on the server.
</div>
<b>Response:</b> <span id="rsperror" style="color:red"></span>
<br/>
<br/>
<table id="loaderr"></table>
<div id="ploaderr"></div>
<script src="loaderror.js" type="text/javascript"> </script>
<br />
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
...
<b>Response:</b> <span id="rsperror" style="color:red"></span>
<br/>
<br/>
<table id="loaderr"></table>
<div id="ploaderr"></div>
<script src="loaderror.js" type="text/javascript"> </script>
</XMP>
<b>Java Scrpt code</b>
<XMP>
...
jQuery("#loaderr").jqGrid({
url:'server_bad.php?q=1',
datatype: "xml",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#ploaderr',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"Server Errors",
loadError : function(xhr,st,err) {
jQuery("#rsperror").html("Type: "+st+"; Response: "+ xhr.status + " "+xhr.statusText);
}
});
jQuery("#loaderr").jqGrid('navGrid','#pmethod',{edit:false,add:false,del:false});
</XMP>
<b>PHP with MySQL</b>
<XMP>
...
$page = $_GET['page']; // get the requested page
$limit = $_GET['rows']; // get how many rows we want to have into the grid
$sidx = $_GET['sidx']; // get index row - i.e. user click to sort
$sord = $_GET['sord']; // get the direction
if(!$sidx) $sidx =1;
// connect to the database
$db = mysql_connect($dbhost, $dbuser, $dbpassword)
or die("Connection Error: " . mysql_error());
mysql_select_db($database) or die("Error conecting to db.");
$result = mysql_query("SELECT COUNT(*) AS count FROM invheader a, clients b WHERE a.client_id=b.client_id");
$row = mysql_fetch_array($result,MYSQL_ASSOC);
$count = $row['count'];
if( $count >0 ) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) $page=$total_pages;
$start = $limit*$page - $limit; // do not put $limit*($page - 1)
$SQL = "SELECT a.id, a.invdate, b.name, a.amount,a.tax,a.total,a.note FROM invheader a, clients b WHERE a.client_id=b.client_id ORDER BY $sidx $sord LIMIT $start , $limit";
$result = mysql_query( $SQL ) or die("Couldnt execute query.".mysql_error());
if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {
header("Content-type: application/xhtml+xml;charset=utf-8"); } else {
header("Content-type: text/xml;charset=utf-8");
}
$et = ">";
echo "<?xml version='1.0' encoding='utf-8'?$et\n";
echo "<rows>";
echo "<page>".$page."</page>";
echo "<total>".$total_pages."</total>";
echo "<records>".$count."</records>";
// be sure to put text data in CDATA
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
echo "<row id='". $row[id]."'>";
echo "<cell>". $row[id]."</cell>";
echo "<cell>". $row[invdate]."</cell>";
echo "<cell><![CDATA[". $row[name]."]]></cell>";
echo "<cell>". $row[amount]."</cell>";
echo "<cell>". $row[tax]."</cell>";
echo "<cell>". $row[total]."</cell>";
echo "<cell><![CDATA[". $row[note]."]]></cell>";
echo "</row>";
}
echo "</rows>";
...
</XMP>
</div> | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/loaderror.html | HTML | art | 3,679 |
jQuery("#resize").jqGrid({
url:'server.jsp?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#presize',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"New API Example"
});
jQuery("#resize").jqGrid('navGrid','#presize',{edit:false,add:false,del:false});
jQuery("#resize").jqGrid('gridResize',{minWidth:350,maxWidth:800,minHeight:100, maxHeight:350}); | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/36resize.js | JavaScript | art | 937 |
jQuery("#list16").jqGrid({
url:'server.php?q=2&nd='+new Date().getTime(),
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55, resizable:false},
{name:'invdate',index:'invdate', width:90,resizable:false},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right",resizable:false},
{name:'tax',index:'tax', width:80, align:"right",resizable:false},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false,resizable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pager16',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption: "Resizable columns"
});
jQuery("#list16").jqGrid('navGrid',"#pager16",{edit:false,add:false,del:false});
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/resizecol.js | JavaScript | art | 913 |
jQuery("#list2s").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pager2s',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"JSON Example",
width:700,
viewsortcols: [true,'horizontal',false]
});
jQuery("#list2s").jqGrid('navGrid','#pager2',{edit:false,add:false,del:false});
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/sortcols.js | JavaScript | art | 878 |
<div style="font-size:12px;">
This example demonstartes a diffrent input types. This is achieved via two new options: <br>
<b>edittype :</b> where the possible values are text(default), checkbox, textarea and select<br>
<b>editoptions : </b> array which contain diffretnt options for the control. <br>
Try to click on some row. <br>
</div>
<br />
<table id="rowed5"></table>
<script src="rowedex5.js" type="text/javascript"></script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
...
<table id="rowed5"></table>
</XMP>
<b>Java Scrpt code</b>
<XMP>
var lastsel2
jQuery("#rowed5").jqGrid({
datatype: "local",
height: 250,
colNames:['ID Number','Name', 'Stock', 'Ship via','Notes'],
colModel:[
{name:'id',index:'id', width:90, sorttype:"int", editable: true},
{name:'name',index:'name', width:150,editable: true,editoptions:{size:"20",maxlength:"30"}},
{name:'stock',index:'stock', width:60, editable: true,edittype:"checkbox",editoptions: {value:"Yes:No"}},
{name:'ship',index:'ship', width:90, editable: true,edittype:"select",editoptions:{value:"FE:FedEx;IN:InTime;TN:TNT;AR:ARAMEX"}},
{name:'note',index:'note', width:200, sortable:false,editable: true,edittype:"textarea", editoptions:{rows:"2",cols:"10"}}
],
onSelectRow: function(id){
if(id && id!==lastsel2){
jQuery('#rowed5').jqGrid('restoreRow',lastsel2);
jQuery('#rowed5').jqGrid('editRow',id,true);
lastsel2=id;
}
},
editurl: "server.php",
caption: "Input Types"
});
var mydata2 = [
{id:"12345",name:"Desktop Computer",note:"note",stock:"Yes",ship:"FedEx"},
{id:"23456",name:"Laptop",note:"Long text ",stock:"Yes",ship:"InTime"},
{id:"34567",name:"LCD Monitor",note:"note3",stock:"Yes",ship:"TNT"},
{id:"45678",name:"Speakers",note:"note",stock:"No",ship:"ARAMEX"},
{id:"56789",name:"Laser Printer",note:"note2",stock:"Yes",ship:"FedEx"},
{id:"67890",name:"Play Station",note:"note3",stock:"No", ship:"FedEx"},
{id:"76543",name:"Mobile Telephone",note:"note",stock:"Yes",ship:"ARAMEX"},
{id:"87654",name:"Server",note:"note2",stock:"Yes",ship:"TNT"},
{id:"98765",name:"Matrix Printer",note:"note3",stock:"No", ship:"FedEx"}
];
for(var i=0;i < mydata2.length;i++)
jQuery("#rowed5").jqGrid('addRowData',mydata2[i].id,mydata2[i]);
</XMP>
</div> | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/rowedex5.html | HTML | art | 2,352 |
<div style="font-size:12px;">
It is possible to define default options for all columns when they are created.<br/>
In the example we demonstrate how all fields can not be sortable.<br/>
By default all fields are sortable.
</div>
<br />
<table id="cmtmpl"></table>
<div id="pcmtmpl"></div>
<script src="40cmtmpl.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="cmtmpl"></table>
<div id="pcmtmpl"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#cmtmpl").jqGrid({
url:'server.php?q=4',
datatype: "json",
colNames:['Inv No', 'Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id', key : true, index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name', index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150}
],
// define a model where all fields are not sortable,
// this setting overwrite the deafult one for all fields
cmTemplate: {sortable:false},
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#pcmtmpl',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
jsonReader: {
repeatitems : false
},
caption: "Column model templates",
height: '100%'
});
jQuery("#cmtmpl").jqGrid('navGrid','#pcmtmpl',{edit:false,add:false,del:false});
</XMP>
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/40cmtmpl.html | HTML | art | 1,564 |
var lastsel2
jQuery("#rowed5").jqGrid({
datatype: "local",
height: 250,
colNames:['ID Number','Name', 'Stock', 'Ship via','Notes'],
colModel:[
{name:'id',index:'id', width:90, sorttype:"int", editable: true},
{name:'name',index:'name', width:150,editable: true,editoptions:{size:"20",maxlength:"30"}},
{name:'stock',index:'stock', width:60, editable: true,edittype:"checkbox",editoptions: {value:"Yes:No"}},
{name:'ship',index:'ship', width:90, editable: true,edittype:"select",editoptions:{value:"FE:FedEx;IN:InTime;TN:TNT;AR:ARAMEX"}},
{name:'note',index:'note', width:200, sortable:false,editable: true,edittype:"textarea", editoptions:{rows:"2",cols:"10"}}
],
onSelectRow: function(id){
if(id && id!==lastsel2){
jQuery('#rowed5').jqGrid('restoreRow',lastsel2);
jQuery('#rowed5').jqGrid('editRow',id,true);
lastsel2=id;
}
},
editurl: "server.php",
caption: "Input Types"
});
var mydata2 = [
{id:"12345",name:"Desktop Computer",note:"note",stock:"Yes",ship:"FedEx"},
{id:"23456",name:"Laptop",note:"Long text ",stock:"Yes",ship:"InTime"},
{id:"34567",name:"LCD Monitor",note:"note3",stock:"Yes",ship:"TNT"},
{id:"45678",name:"Speakers",note:"note",stock:"No",ship:"ARAMEX"},
{id:"56789",name:"Laser Printer",note:"note2",stock:"Yes",ship:"FedEx"},
{id:"67890",name:"Play Station",note:"note3",stock:"No", ship:"FedEx"},
{id:"76543",name:"Mobile Telephone",note:"note",stock:"Yes",ship:"ARAMEX"},
{id:"87654",name:"Server",note:"note2",stock:"Yes",ship:"TNT"},
{id:"98765",name:"Matrix Printer",note:"note3",stock:"No", ship:"FedEx"}
];
for(var i=0;i<mydata2.length;i++)
jQuery("#rowed5").jqGrid('addRowData',mydata2[i].id,mydata2[i]);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/rowedex5.js | JavaScript | art | 1,755 |
<div style="font-size:12px;">
This example demonstartes how we can change the view of the group header row.<br/>
This is done with the groupText option. Actually this a templeate with two posiible values: <br/>
{0} which mean the grouped text and {1} which mean how many items we have on this group.
</div>
<br />
<table id="list483"></table>
<div id="plist483"></div>
<script src="38array3.js" type="text/javascript"></script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
...
<table id="list47"></table>
<div id="plist47"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
var mydata = [
{id:"1",invdate:"2010-05-24",name:"test",note:"note",tax:"10.00",total:"2111.00"} ,
{id:"2",invdate:"2010-05-25",name:"test2",note:"note2",tax:"20.00",total:"320.00"},
{id:"3",invdate:"2007-09-01",name:"test3",note:"note3",tax:"30.00",total:"430.00"},
{id:"4",invdate:"2007-10-04",name:"test",note:"note",tax:"10.00",total:"210.00"},
{id:"5",invdate:"2007-10-05",name:"test2",note:"note2",tax:"20.00",total:"320.00"},
{id:"6",invdate:"2007-09-06",name:"test3",note:"note3",tax:"30.00",total:"430.00"},
{id:"7",invdate:"2007-10-04",name:"test",note:"note",tax:"10.00",total:"210.00"},
{id:"8",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"21.00",total:"320.00"},
{id:"9",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"11",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"12",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"13",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"14",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"15",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"16",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"17",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"18",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"19",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"21",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"22",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"23",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"24",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"25",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"26",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"27",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"28",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"29",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}
];
jQuery("#list483").jqGrid({
data: mydata,
datatype: "local",
height: 'auto',
rowNum: 30,
rowList: [10,20,30],
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:60, sorttype:"int"},
{name:'invdate',index:'invdate', width:90, sorttype:"date", formatter:"date"},
{name:'name',index:'name', width:100, editable:true},
{name:'amount',index:'amount', width:80, align:"right",sorttype:"float", formatter:"number", editable:true},
{name:'tax',index:'tax', width:80, align:"right",sorttype:"float", editable:true},
{name:'total',index:'total', width:80,align:"right",sorttype:"float"},
{name:'note',index:'note', width:150, sortable:false}
],
pager: "#plist483",
viewrecords: true,
sortname: 'name',
grouping:true,
groupingView : {
groupField : ['name'],
groupColumnShow : [false],
groupText : ['<b>{0} - {1} Item(s)</b>']
},
caption: "Configure group header row"
});
</XMP>
</div> | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/38array3.html | HTML | art | 4,370 |
jQuery("#grps2").jqGrid({
url:'search_adv.php?q=1',
datatype: "json",
colNames:['Inv No', 'Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id', key : true, index:'a.id', width:55, searchtype:"integer"},
{name:'invdate',index:'a.invdate', width:90},
{name:'name', index:'b.name', width:100},
{name:'amount',index:'a.amount', width:80, align:"right", searchtype:"number"},
{name:'tax',index:'a.tax', width:80, align:"right", searchtype:"number"},
{name:'total',index:'a.total', width:80,align:"right", searchtype:"number"},
{name:'note',index:'a.note', width:150, sortable:false}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#pgrps2',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption: "Show query in search",
height: '100%'
});
jQuery("#grps2").jqGrid('navGrid','#pgrps2',
{edit:false,add:false,del:false},
{},
{},
{},
{multipleSearch:true, multipleGroup:true, showQuery: true}
);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/40grpsearch2.js | JavaScript | art | 1,037 |
jQuery("#cmtmpl").jqGrid({
url:'server.php?q=4',
datatype: "json",
colNames:['Inv No', 'Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id', key : true, index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name', index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150}
],
// define a model where all fields are not sortable,
// this setting overwrite the deafult one for all fields
cmTemplate: {sortable:false},
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#pcmtmpl',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
jsonReader: {
repeatitems : false
},
caption: "Column model templates",
height: '100%'
});
jQuery("#cmtmpl").jqGrid('navGrid','#pcmtmpl',{edit:false,add:false,del:false});
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/40cmtmpl.js | JavaScript | art | 1,051 |
<div style="font-size:12px;">
This example demonstartes new methods for posing data using postData array (thanks to Paul Tiseo).
<br/>
If you have FireBug Installed you can see what data is posted.
</div>
<b>Request: </b> <span id="postdata"></span>
<br/>
<br/>
<table id="pdata"></table>
<div id="ppdata"></div>
<br />
<a href="javascript:void(0)" id="ps1">Set Post Data</a>
<br />
<a href="javascript:void(0)" id="ps2">Get Post Data</a>
<br />
<a href="javascript:void(0)" id="ps3" >Append Post Data</a>
<br />
<a href="javascript:void(0)" id="ps4" >Set Post Data Item</a>
<br />
<a href="javascript:void(0)" id="ps5" >Get Post Data Item</a>
<br />
<a href="javascript:void(0)" id="ps6" >Remove Post Data Item</a>
<script src="postdata.js" type="text/javascript"> </script>
<br />
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
...
<b>Request: </b> <span id="postdata"></span>
<br/>
<br/>
<table id="pdata"></table>
<div id="ppdata"></div>
<br />
<a href="javascript:void(0)" id="ps1">Set Post Data</a>
<br />
<a href="javascript:void(0)" id="ps2">Get Post Data</a>
<br />
<a href="javascript:void(0)" id="ps3" >Append Post Data</a>
<br />
<a href="javascript:void(0)" id="ps4" >Set Post Data Item</a>
<br />
<a href="javascript:void(0)" id="ps5" >Get Post Data Item</a>
<br />
<a href="javascript:void(0)" id="ps6" >Remove Post Data Item</a>
<script src="postdata.js" type="text/javascript"> </script>
</XMP>
<b>Java Scrpt code</b>
<XMP>
...
jQuery("#pdata").jqGrid({
url:'server.php',
datatype: "xml",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#ppdata',
sortname: 'id',
mtype: "POST",
postData:{q:1},
viewrecords: true,
sortorder: "desc",
caption:"New Methods",
multiselect: true
});
jQuery("#pdata").jqGrid('navGrid','#ppdata',{edit:false,add:false,del:false});
jQuery("#ps1").click( function() {
$("#pdata").jqGrid('setPostData',{q:1,param1:"p1"});
$("#pdata").trigger("reloadGrid");
});
jQuery("#ps2").click( function() {
var pd =$("#pdata").jqGrid('getPostData');
var r ="";
$.each(pd,function(i){
r += i+": "+pd[i]+",";
})
$("#postdata").html(r).css("background-color","yellow");
});
jQuery("#ps3").click( function() {
$("#pdata").jqGrid('appendPostData',{param2:"p2"});
$("#pdata").trigger("reloadGrid");
var pd =$("#pdata").jqGrid('getPostData');
var r ="";
$.each(pd,function(i){
r += i+": "+pd[i]+",";
})
$("#postdata").html(r).css("background-color","yellow");
});
jQuery("#ps4").click( function() {
$("#pdata").jqGrid('setPostDataItem',"param2","I'w new value");
$("#pdata").trigger("reloadGrid");
var pd =$("#pdata").jqGrid('getPostData');
var r ="";
$.each(pd,function(i){
r += i+": "+pd[i]+",";
})
$("#postdata").html(r).css("background-color","yellow");
});
jQuery("#ps5").click( function() {
alert( "rows : "+$("#pdata").jqGrid('getPostDataItem',"rows"));
});
jQuery("#ps6").click( function() {
$("#pdata").jqGrid('removePostDataItem',"param1");
$("#pdata").trigger("reloadGrid");
var pd =$("#pdata").jqGrid('getPostData');
var r ="";
$.each(pd,function(i){
r += i+": "+pd[i]+",";
})
$("#postdata").html(r).css("background-color","yellow");
});
</XMP>
<b>PHP with MySQL</b>
<XMP>
...
$page = $_GET['page']; // get the requested page
$limit = $_GET['rows']; // get how many rows we want to have into the grid
$sidx = $_GET['sidx']; // get index row - i.e. user click to sort
$sord = $_GET['sord']; // get the direction
if(!$sidx) $sidx =1;
// connect to the database
$db = mysql_connect($dbhost, $dbuser, $dbpassword)
or die("Connection Error: " . mysql_error());
mysql_select_db($database) or die("Error conecting to db.");
$result = mysql_query("SELECT COUNT(*) AS count FROM invheader a, clients b WHERE a.client_id=b.client_id");
$row = mysql_fetch_array($result,MYSQL_ASSOC);
$count = $row['count'];
if( $count >0 ) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) $page=$total_pages;
$start = $limit*$page - $limit; // do not put $limit*($page - 1)
$SQL = "SELECT a.id, a.invdate, b.name, a.amount,a.tax,a.total,a.note FROM invheader a, clients b WHERE a.client_id=b.client_id ORDER BY $sidx $sord LIMIT $start , $limit";
$result = mysql_query( $SQL ) or die("Couldnt execute query.".mysql_error());
if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {
header("Content-type: application/xhtml+xml;charset=utf-8"); } else {
header("Content-type: text/xml;charset=utf-8");
}
$et = ">";
echo "<?xml version='1.0' encoding='utf-8'?$et\n";
echo "<rows>";
echo "<page>".$page."</page>";
echo "<total>".$total_pages."</total>";
echo "<records>".$count."</records>";
// be sure to put text data in CDATA
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
echo "<row id='". $row[id]."'>";
echo "<cell>". $row[id]."</cell>";
echo "<cell>". $row[invdate]."</cell>";
echo "<cell><![CDATA[". $row[name]."]]></cell>";
echo "<cell>". $row[amount]."</cell>";
echo "<cell>". $row[tax]."</cell>";
echo "<cell>". $row[total]."</cell>";
echo "<cell><![CDATA[". $row[note]."]]></cell>";
echo "</row>";
}
echo "</rows>";
...
</XMP>
</div> | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/postdata.html | HTML | art | 5,782 |
jQuery("#scroll37").jqGrid({
url:'server.jsp',//url:'localset.php',
datatype: "json",
height: 255,
width: 600,
colNames:['Index','Name', 'Code'],
colModel:[
{name:'item_id',index:'item_id', width:65, sorttype:'int'},
{name:'item',index:'item', width:150},
{name:'item_cd',index:'item_cd', width:100}
],
rowNum:50,
rowTotal: 2000,
rowList : [20,30,50],
scroll:1,
loadonce:true,
mtype: "GET",
rownumbers: true,
rownumWidth: 40,
gridview: true,
pager: '#pscroll37',
sortname: 'item_id',
viewrecords: true,
sortorder: "asc",
caption: "Virtual scrolling on local data"
});
jQuery("#scroll37").jqGrid('navGrid','#pscroll37',{del:false,add:false,edit:false},{},{},{},{multipleSearch:true});
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/37scroll.js | JavaScript | art | 780 |
jQuery("#list9").jqGrid({
url:'server.php?q=2&nd='+new Date().getTime(),
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pager9',
sortname: 'id',
recordpos: 'left',
viewrecords: true,
sortorder: "desc",
multiselect: true,
caption: "Multi Select Example"
});
jQuery("#list9").jqGrid('navGrid','#pager9',{add:false,del:false,edit:false,position:'right'});
jQuery("#m1").click( function() {
var s;
s = jQuery("#list9").jqGrid('getGridParam','selarrrow');
alert(s);
});
jQuery("#m1s").click( function() {
jQuery("#list9").jqGrid('setSelection',"13");
});
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/multiex.js | JavaScript | art | 1,099 |
jQuery("#jsonmap").jqGrid({
url:'server.php?q=4',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90, jsonmap:"invdate"},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pjmap',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
jsonReader: {
repeatitems : false,
id: "0"
},
caption: "JSON Mapping",
height: '100%'
});
jQuery("#jsonmap").jqGrid('navGrid','#pjmap',{edit:false,add:false,del:false});
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/jsonmap.js | JavaScript | art | 914 |
<link rel="stylesheet" type="text/css" media="screen" href="themes/redmond/jquery-ui-1.8.2.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="themes/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="themes/ui.multiselect.css" />
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="js/jquery.contextmenu.js" type="text/javascript"></script>
<script src="js/jquery.layout.js" type="text/javascript"></script>
<script src="js/jquery.tablednd.js" type="text/javascript"></script>
<div style="font-size:12px;">
Another great feature in 3.6 version is supporting of Right To Left languages<br>
This is done just with one option direction in jqGrid options. <br>
Note that in a page one grid can have direction set to rtl, while another can have direction set to ltr.<br>
Support of RTL is provided only in FireFox 3.x, Internet Explorer 7/8 and partially in Opera > 9.x browsers. <br>
To enjoy the full of this feature we have created a demo page with all the examples <a href="http://www.trirand.com/jqgrid/rtl/jqgrid.html" target="_blank">here</a><br>
<br />
<table id="jqrtl"></table>
<div id="pjqrtl"></div>
<script src="36rtl.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="jqrtl"></table>
<div id="pjqrtl"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#jqrtl").jqGrid({
direction: "rtl",
recordpos : "left",
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55, editable:true},
{name:'invdate',index:'invdate', width:90,editable:true},
{name:'name',index:'name asc, invdate', width:100,editable:true},
{name:'amount',index:'amount', width:80, align:"right",editable:true},
{name:'tax',index:'tax', width:80, align:"right",editable:true},
{name:'total',index:'total', width:80,align:"right",editable:true},
{name:'note',index:'note', width:150, sortable:false,editable:true}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pjqrtl',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"RTL Example",
editurl: "server.php?q=dummy"
});
jQuery("#jqrtl").jqGrid('navGrid','#pjqrtl',{position:"right"},{reloadAfterSubmit:false},{reloadAfterSubmit:false});
</XMP>
</div> | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/36rtl.html | HTML | art | 2,627 |
jQuery("#list19").jqGrid({
url: 'books.xml',
datatype: "xml",
colNames:["Author","Title", "Price", "Published Date"],
colModel:[
{name:"Author",index:"Author", width:120, xmlmap:"ItemAttributes>Author"},
{name:"Title",index:"Title", width:180,xmlmap:"ItemAttributes>Title"},
{name:"Price",index:"Manufacturer", width:100, align:"right",xmlmap:"ItemAttributes>Price", sorttype:"float"},
{name:"DatePub",index:"ProductGroup", width:130,xmlmap:"ItemAttributes>DatePub",sorttype:"date"}
],
height:250,
rowNum:10,
rowList:[10,20,30],
viewrecords: true,
loadonce: true,
xmlReader: {
root : "Items",
row: "Item",
repeatitems: false,
id: "ASIN"
},
caption: "XML Mapping example"
});
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/xmlmap.js | JavaScript | art | 764 |
jQuery("#hidengrid").jqGrid({
url:'server.php?q=1',
datatype: "xml",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#phidengrid',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"Initial Hidden Grid",
multiselect: false,
hiddengrid: true
});
jQuery("#hidengrid").jqGrid('navGrid','#phidengrid',{edit:false,add:false,del:false});
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/hiddengrid.js | JavaScript | art | 878 |
jQuery("#list14").jqGrid({
url:'server.php?q=2',
datatype: "json",
height: 200,
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pager14',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
multiselect: false,
subGrid : true,
subGridUrl: 'subgrid.php?q=3',
subGridModel: [{ name : ['No','Item','Qty','Unit','Line Total'],
width : [55,200,80,80,80],
params:['invdate']}
]
,
caption: "Subgrid with JSON Data"
});
jQuery("#list14").jqGrid('navGrid','#pager14',{edit:false,add:false,del:false});
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/jsubgrid.js | JavaScript | art | 1,058 |
jQuery("#list27").jqGrid({
url:'localset.php',
datatype: "json",
height: 255,
width: 600,
colNames:['Index','Name', 'Code'],
colModel:[
{name:'item_id',index:'item_id', width:65, sorttype:'int'},
{name:'item',index:'item', width:150},
{name:'item_cd',index:'item_cd', width:100}
],
rowNum:50,
rowTotal: 2000,
rowList : [20,30,50],
loadonce:true,
mtype: "GET",
rownumbers: true,
rownumWidth: 40,
gridview: true,
pager: '#pager27',
sortname: 'item_id',
viewrecords: true,
sortorder: "asc",
caption: "Loading data from server at once"
});
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/37server.js | JavaScript | art | 629 |
jQuery("#sg3").jqGrid({
url:'server.php?q=1',
datatype: "xml",
height: 190,
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:8,
rowList:[8,10,20,30],
pager: '#psg3',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
multiselect: false,
subGrid: true,
caption: "Custom Icons in Subgrid",
// define the icons in subgrid
subGridOptions: {
"plusicon" : "ui-icon-triangle-1-e",
"minusicon" : "ui-icon-triangle-1-s",
"openicon" : "ui-icon-arrowreturn-1-e",
// load the subgrid data only once
// and the just show/hide
"reloadOnExpand" : false,
// select the row when the expand column is clicked
"selectOnExpand" : true
},
subGridRowExpanded: function(subgrid_id, row_id) {
var subgrid_table_id, pager_id;
subgrid_table_id = subgrid_id+"_t";
pager_id = "p_"+subgrid_table_id;
$("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table><div id='"+pager_id+"' class='scroll'></div>");
jQuery("#"+subgrid_table_id).jqGrid({
url:"subgrid.php?q=2&id="+row_id,
datatype: "xml",
colNames: ['No','Item','Qty','Unit','Line Total'],
colModel: [
{name:"num",index:"num",width:80,key:true},
{name:"item",index:"item",width:130},
{name:"qty",index:"qty",width:70,align:"right"},
{name:"unit",index:"unit",width:70,align:"right"},
{name:"total",index:"total",width:70,align:"right",sortable:false}
],
rowNum:20,
pager: pager_id,
sortname: 'num',
sortorder: "asc",
height: '100%'
});
jQuery("#"+subgrid_table_id).jqGrid('navGrid',"#"+pager_id,{edit:false,add:false,del:false})
}
});
jQuery("#sg3").jqGrid('navGrid','#psg3',{add:false,edit:false,del:false});
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/40subgrid3.js | JavaScript | art | 2,207 |
jQuery("#s4list").jqGrid({
url:'search_adv.php?q=1',
datatype: "json",
width: 700,
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:65, searchoptions:{sopt:['eq','ne','lt','le','gt','ge']}},
{name:'invdate',index:'invdate', width:90, searchoptions:{dataInit:function(el){$(el).datepicker({dateFormat:'yy-mm-dd'});} }},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right",searchoptions:{sopt:['eq','ne','lt','le','gt','ge']}},
{name:'tax',index:'tax', width:80, align:"right", stype:'select', editoptions:{value:":All;0.00:0.00;12:12.00;20:20.00;40:40.00;60:60.00;120:120.00"}},
{name:'total',index:'total', width:80,align:"right",searchoptions:{sopt:['eq','ne','lt','le','gt','ge']}},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
mtype: "POST",
rowList:[10,20,30],
pager: '#s4pager',
sortname: 'id',
viewrecords: true,
rownumbers: true,
gridview : true,
sortorder: "desc",
caption:"Advanced Search Example"
});
jQuery("#s4list").jqGrid('navGrid','#s3pager',
{
edit:false,add:false,del:false,search:true,refresh:true
},
{}, // edit options
{}, // add options
{}, //del options
{multipleSearch:true} // search options
);
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/search4.js | JavaScript | art | 1,369 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" media="screen" href="http://www.trirand.com/jqgrid35/themes/redmond/jquery-ui-1.7.1.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="http://www.trirand.com/jqgrid35/themes/ui.jqgrid.css" />
<script src="http://www.trirand.com/jqgrid35/js/jquery.js" type="text/javascript"></script>
<script src="http://www.trirand.com/jqgrid35/js/jquery-ui-1.7.1.custom.min.js" type="text/javascript"></script>
<script src="http://www.trirand.com/jqgrid35/js/jquery.layout.js" type="text/javascript"></script>
<script src="http://www.trirand.com/jqgrid35/js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="http://www.trirand.com/jqgrid35/js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="http://www.trirand.com/jqgrid35/js/jquery.tablednd.js" type="text/javascript"></script>
<script src="http://www.trirand.com/jqgrid35/js/jquery.contextmenu.js" type="text/javascript"></script>
<script src="http://www.trirand.com/jqgrid35/js/jquery.contextmenu.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#celltbl").jqGrid({
datatype: "json",
url: 'server.php?q=2',
colNames: ['Inv No', 'Date', 'Client', 'Amount', 'Tax', 'Total', 'Notes'],
colModel: [{ name: 'id', index: 'id', width: 55 }, { name: 'invdate', index: 'invdate', width: 90 }, { name: 'name', index: 'name asc, invdate', width: 100 }, { name: 'amount', index: 'amount', width: 80, align: "right" }, { name: 'tax', index: 'tax', width: 80, align: "right" }, { name: 'total', index: 'total', width: 80, align: "right" }, { name: 'note', index: 'note', width: 150, sortable: false}],
rowNum: 10,
rowList: [10, 20, 30],
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption: "Cell Edit Example",
multiselect: true,
pager: "#mpager"
});
$("#hidemcol").click(function(){
$("#celltbl").hideCol("cb");
return false;
});
});
</script>
</head>
<body>
<h1>Multiselect Bug</h1>
<table id="celltbl"></table>
<div id="mpager"></div>
<a href id="hidemcol"> Hide the multicol</a>
</body>
</html> | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/multibug.html | HTML | art | 2,439 |
<link rel="stylesheet" type="text/css" media="screen" href="themes/redmond/jquery-ui-1.8.2.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="themes/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="themes/ui.multiselect.css" />
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="js/jquery.contextmenu.js" type="text/javascript"></script>
<script src="js/jquery.layout.js" type="text/javascript"></script>
<script src="js/jquery.tablednd.js" type="text/javascript"></script>
<p style="font-size:12px;">
Thanks again to Mark Williams creating this wonderfull feature - loading data while scrolling <br>
Note how the data is loaded and the requests to the server!<br>
Enjoy the feature and speed!
<table id="scrolling"></table>
<div id="pscrolling"></div>
<script src="36scrolling.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
...
<table id="scrolling"></table>
<div id="pscrolling"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#scrolling").jqGrid({
scroll: 1,
url:'bigset.php',
datatype: "json",
height: 255,
width: 600,
colNames:['Index','Name', 'Code'],
colModel:[
{name:'item_id',index:'item_id', width:65},
{name:'item',index:'item', width:150},
{name:'item_cd',index:'item_cd', width:100}
],
rowNum:100,
mtype: "GET",
rownumbers: true,
rownumWidth: 40,
gridview: true,
pager: '#pscrolling',
sortname: 'item_id',
viewrecords: true,
sortorder: "asc",
caption: "Loading data while scrolling"
});</XMP>
</div> | zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/36scrolling.html | HTML | art | 1,821 |
jQuery("#listsg11").jqGrid({
url:'server.php?q=1',
datatype: "xml",
height: 190,
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:8,
rowList:[8,10,20,30],
pager: '#pagersg11',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
multiselect: false,
subGrid: true,
caption: "Grid as Subgrid",
subGridRowExpanded: function(subgrid_id, row_id) {
// we pass two parameters
// subgrid_id is a id of the div tag created whitin a table data
// the id of this elemenet is a combination of the "sg_" + id of the row
// the row_id is the id of the row
// If we wan to pass additinal parameters to the url we can use
// a method getRowData(row_id) - which returns associative array in type name-value
// here we can easy construct the flowing
var subgrid_table_id, pager_id;
subgrid_table_id = subgrid_id+"_t";
pager_id = "p_"+subgrid_table_id;
$("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table><div id='"+pager_id+"' class='scroll'></div>");
jQuery("#"+subgrid_table_id).jqGrid({
url:"subgrid.php?q=2&id="+row_id,
datatype: "xml",
colNames: ['No','Item','Qty','Unit','Line Total'],
colModel: [
{name:"num",index:"num",width:80,key:true},
{name:"item",index:"item",width:130},
{name:"qty",index:"qty",width:70,align:"right"},
{name:"unit",index:"unit",width:70,align:"right"},
{name:"total",index:"total",width:70,align:"right",sortable:false}
],
rowNum:20,
pager: pager_id,
sortname: 'num',
sortorder: "asc",
height: '100%'
});
jQuery("#"+subgrid_table_id).jqGrid('navGrid',"#"+pager_id,{edit:false,add:false,del:false})
},
subGridRowColapsed: function(subgrid_id, row_id) {
// this function is called before removing the data
//var subgrid_table_id;
//subgrid_table_id = subgrid_id+"_t";
//jQuery("#"+subgrid_table_id).remove();
}
});
jQuery("#listsg11").jqGrid('navGrid','#pagersg11',{add:false,edit:false,del:false});
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/subgrid_grid.js | JavaScript | art | 2,470 |
jQuery("#toolbar").jqGrid({
url:'localset.php',
datatype: "json",
height: 255,
width: 600,
colNames:['Index','Name', 'Code'],
colModel:[
{name:'item_id',index:'item_id', width:65, sorttype:'int'},
{name:'item',index:'item', width:150},
{name:'item_cd',index:'item_cd', width:100}
],
rowNum:50,
rowTotal: 2000,
rowList : [20,30,50],
loadonce:true,
mtype: "GET",
rownumbers: true,
rownumWidth: 40,
gridview: true,
pager: '#ptoolbar',
sortname: 'item_id',
viewrecords: true,
sortorder: "asc",
caption: "Toolbar Searching"
});
jQuery("#toolbar").jqGrid('navGrid','#ptoolbar',{del:false,add:false,edit:false,search:false});
jQuery("#toolbar").jqGrid('filterToolbar',{searchOnEnter : false});
| zzh-simple-hr | ZJs/webapp/grid/jqgrid/demo40/37toolbar.js | JavaScript | art | 782 |