Add version files and new GIF images for UI components
This commit is contained in:
@ -0,0 +1,85 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
/**
|
||||
* @desc: skined checkbox editor
|
||||
* @returns: dhtmlxGrid cell editor object
|
||||
* @type: public
|
||||
*/
|
||||
function eXcell_acheck(cell){
|
||||
try{
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
this.cell.obj = this;
|
||||
}catch(er){}
|
||||
this.changeState = function(){
|
||||
//nb:
|
||||
if ((!this.grid.isEditable)||(this.cell.parentNode._locked)||(this.isDisabled())) return;
|
||||
if(this.grid.callEvent("onEditCell",[0,this.cell.parentNode.idd,this.cell._cellIndex])!=false){
|
||||
this.val = this.getValue()
|
||||
if(this.val=="1")
|
||||
this.setValue("<checkbox state='false'>")
|
||||
else
|
||||
this.setValue("<checkbox state='true'>")
|
||||
|
||||
this.cell.wasChanged=true;
|
||||
//nb:
|
||||
this.grid.callEvent("onEditCell",[1,this.cell.parentNode.idd,this.cell._cellIndex]);
|
||||
this.grid.callEvent("onCheck",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!='1')]);
|
||||
this.grid.callEvent("onCheckbox",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!='1')]);
|
||||
|
||||
}else{//preserve editing (not tested thoroughly for this editor)
|
||||
this.editor=null;
|
||||
}
|
||||
}
|
||||
this.getValue = function(){
|
||||
try{
|
||||
return this.cell.chstate.toString();
|
||||
}catch(er){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
this.isCheckbox = function(){
|
||||
return true;
|
||||
}
|
||||
this.isChecked = function(){
|
||||
if(this.getValue()=="1")
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
this.setChecked = function(fl){
|
||||
this.setValue(fl.toString())
|
||||
}
|
||||
this.detach = function(){
|
||||
return this.val!=this.getValue();
|
||||
}
|
||||
this.drawCurrentState=function(){
|
||||
if (this.cell.chstate==1)
|
||||
return "<div onclick='(new eXcell_acheck(this.parentNode)).changeState(); (arguments[0]||event).cancelBubble=true;' style='cursor:pointer; font-weight:bold; text-align:center; '><span style='height:8px; width:8px; background:green; display:inline-block;'></span> Yes</div>";
|
||||
else
|
||||
return "<div onclick='(new eXcell_acheck(this.parentNode)).changeState(); (arguments[0]||event).cancelBubble=true;' style='cursor:pointer; text-align:center; '><span style='height:8px; width:8px; background:red; display:inline-block;'></span> No</div>";
|
||||
}
|
||||
}
|
||||
eXcell_acheck.prototype = new eXcell;
|
||||
eXcell_acheck.prototype.setValue = function(val){
|
||||
//val can be int
|
||||
val=(val||"").toString();
|
||||
if(val.indexOf("1")!=-1 || val.indexOf("true")!=-1){
|
||||
val = "1";
|
||||
this.cell.chstate = "1";
|
||||
}else{
|
||||
val = "0";
|
||||
this.cell.chstate = "0"
|
||||
}
|
||||
var obj = this;
|
||||
this.setCValue(this.drawCurrentState(),this.cell.chstate);
|
||||
}
|
||||
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
@ -0,0 +1,151 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
/**
|
||||
* @desc: calculator editor
|
||||
* @returns: dhtmlxGrid cell editor object
|
||||
* @type: public
|
||||
*/
|
||||
function eXcell_calck(cell){
|
||||
try{
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
}catch(er){}
|
||||
this.edit = function(){
|
||||
this.val = this.getValue();
|
||||
|
||||
var arPos = this.grid.getPosition(this.cell);
|
||||
this.obj = new calcX(arPos[0],arPos[1]+this.cell.offsetHeight,this,this.val);
|
||||
|
||||
}
|
||||
this.getValue = function(){
|
||||
//this.grid.editStop();
|
||||
return this.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(),this.cell._cellIndex);
|
||||
}
|
||||
this.detach = function(){
|
||||
if (this.obj) {
|
||||
this.setValue(this.obj.inputZone.value);
|
||||
this.obj.removeSelf();
|
||||
}
|
||||
this.obj=null;
|
||||
return this.val!=this.getValue();
|
||||
}
|
||||
}
|
||||
eXcell_calck.prototype = new eXcell;
|
||||
eXcell_calck.prototype.setValue = function(val){
|
||||
if(!val || val.toString()._dhx_trim()=="")
|
||||
val="0"
|
||||
this.setCValue(this.grid._aplNF(val,this.cell._cellIndex),val);
|
||||
}
|
||||
|
||||
function calcX(left,top,onReturnSub,val){
|
||||
this.top=top||0;
|
||||
this.left=left||0;
|
||||
this.onReturnSub=onReturnSub||null;
|
||||
|
||||
this.operandA=0;
|
||||
this.operandB=0;
|
||||
this.operatorA="";
|
||||
this.state=0;
|
||||
this.dotState=0;
|
||||
|
||||
|
||||
this.calckGo=function(){
|
||||
return (eval(this.operandA+"*1"+this.operatorA+this.operandB+"*1"));
|
||||
};
|
||||
|
||||
this.isNumeric=function(str){
|
||||
return ((str.search(/[^1234567890]/gi)==-1)?(true):(false));
|
||||
};
|
||||
this.isOperation=function(str){
|
||||
return ((str.search(/[^\+\*\-\/]/gi)==-1)?(true):(false));
|
||||
}
|
||||
this.onCalcKey=function(e)
|
||||
{
|
||||
that=this.calk;
|
||||
var z=this.innerHTML;
|
||||
var rZone=that.inputZone;
|
||||
if (((that.state==0)||(that.state==2))&&(that.isNumeric(z))) if (rZone.value!="0") rZone.value+=z; else rZone.value=z;
|
||||
if ((((that.state==0)||(that.state==2))&&(z=='.'))&&(that.dotState==0)) { that.dotState=1; rZone.value+=z; }
|
||||
if ((z=="C")) { rZone.value=0; that.dotState=0; that.state=0; }
|
||||
if ((that.state==0)&&(that.isOperation(z))) { that.operatorA=z; that.operandA=rZone.value; that.state=1; }
|
||||
if ((that.state==2)&&(that.isOperation(z))) { that.operandB=rZone.value; rZone.value=that.calckGo(); that.operatorA=z; that.operandA=rZone.value; that.state=1; }
|
||||
if ((that.state==2)&&(z=="=")) { that.operandB=rZone.value; rZone.value=that.calckGo(); that.operatorA=z; that.operandA=rZone.value; that.state=3; }
|
||||
if ((that.state==1)&&(that.isNumeric(z))) { rZone.value=z; that.state=2; that.dotState=0 }
|
||||
if ((that.state==3)&&(that.isNumeric(z))) { rZone.value=z; that.state=0; }
|
||||
if ((that.state==3)&&(that.isOperation(z))) { that.operatorA=z; that.operandA=rZone.value; that.state=1; }
|
||||
if (z=="e") { rZone.value=Math.E; if (that.state==1) that.state=2; that.dotState=0 }
|
||||
if (z=="p") { rZone.value=Math.PI; if (that.state==1) that.state=2; that.dotState=0 }
|
||||
if (z=="Off") that.topNod.parentNode.removeChild(that.topNod);
|
||||
|
||||
if (e||event) (e||event).cancelBubble=true;
|
||||
}
|
||||
this.sendResult=function(){
|
||||
that=this.calk;
|
||||
if (that.state==2){
|
||||
var rZone=that.inputZone;
|
||||
that.operandB=rZone.value;
|
||||
rZone.value=that.calckGo();
|
||||
that.operatorA=z;
|
||||
that.operandA=rZone.value;
|
||||
that.state=3; }
|
||||
var z=that.inputZone.value;
|
||||
|
||||
that.topNod.parentNode.removeChild(that.topNod);
|
||||
that.onReturnSub.grid.editStop(false);
|
||||
};
|
||||
this.removeSelf=function(){
|
||||
if (this.topNod.parentNode)
|
||||
this.topNod.parentNode.removeChild(this.topNod);
|
||||
}
|
||||
this.keyDown=function(){ this.className="calcPressed"; };
|
||||
this.keyUp=function(){ this.className="calcButton"; };
|
||||
this.init_table=function(){
|
||||
var table=this.topNod.childNodes[0];
|
||||
if ((!table)||(table.tagName!="TABLE")) return;
|
||||
for (i=1; i<table.childNodes[0].childNodes.length; i++)
|
||||
for (j=0; j<table.childNodes[0].childNodes[i].childNodes.length; j++)
|
||||
{
|
||||
table.childNodes[0].childNodes[i].childNodes[j].onclick=this.onCalcKey;
|
||||
table.childNodes[0].childNodes[i].childNodes[j].onmousedown=this.keyDown;
|
||||
table.childNodes[0].childNodes[i].childNodes[j].onmouseout=this.keyUp;
|
||||
table.childNodes[0].childNodes[i].childNodes[j].onmouseup=this.keyUp;
|
||||
table.childNodes[0].childNodes[i].childNodes[j].calk=this;
|
||||
}
|
||||
this.inputZone=this.topNod.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0];
|
||||
if (this.onReturnSub)
|
||||
{
|
||||
this.topNod.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[1].onclick=this.sendResult;
|
||||
this.topNod.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[1].calk=this;
|
||||
}
|
||||
else this.topNod.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[1].innerHTML="";
|
||||
}
|
||||
this.drawSelf=function(){
|
||||
var div=document.createElement("div");
|
||||
div.className="calcTable";
|
||||
div.style.position="absolute";
|
||||
div.style.top=this.top+"px";
|
||||
div.style.left=this.left+"px";
|
||||
div.innerHTML="<table cellspacing='0' id='calc_01' class='calcTable'><tr><td colspan='4'><table cellpadding='1' cellspacing='0' width='100%'><tr><td width='100%' style='overflow:hidden;'><input style='width:100%' class='calcInput' value='0' align='right' readonly='true' style='text-align:right'></td><td class='calkSubmit'>=</td></tr></table></td></tr><tr><td class='calcButton' width='25%'>Off</td><td class='calcButton' width='25%'>p</td><td class='calcButton' width='25%'>e</td><td class='calcButton' width='25%'>/</td></tr><tr><td class='calcButton'>7</td><td class='calcButton'>8</td><td class='calcButton'>9</td><td class='calcButton'>*</td></tr><tr><td class='calcButton'>4</td><td class='calcButton'>5</td><td class='calcButton'>6</td><td class='calcButton'>+</td></tr><tr><td class='calcButton'>1</td><td class='calcButton'>2</td><td class='calcButton'>3</td><td class='calcButton'>-</td></tr><tr><td class='calcButton'>0</td><td class='calcButton'>.</td><td class='calcButton'>C</td><td class='calcButton'>=</td></tr></table>";
|
||||
div.onclick=function(e){ (e||event).cancelBubble=true; };
|
||||
document.body.appendChild(div);
|
||||
this.topNod=div;
|
||||
}
|
||||
|
||||
this.drawSelf();
|
||||
this.init_table();
|
||||
|
||||
if (val){
|
||||
var rZone=this.inputZone;
|
||||
rZone.value=val*1;
|
||||
this.operandA=val*1;
|
||||
this.state=3;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
@ -0,0 +1,109 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
/**
|
||||
* @desc: multi select list editor
|
||||
* @returns: dhtmlxGrid cell editor object
|
||||
* @type: public
|
||||
*/
|
||||
function eXcell_clist(cell){
|
||||
try{
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
}catch(er){}
|
||||
this.edit = function(){
|
||||
this.val = this.getValue();
|
||||
var a=(this.cell._combo||this.grid.clists[this.cell._cellIndex]);
|
||||
if (!a) return;
|
||||
this.obj = document.createElement("DIV");
|
||||
var b=this.val.split(",");
|
||||
var text="";
|
||||
|
||||
for (var i=0; i<a.length; i++){
|
||||
var fl=false;
|
||||
for (var j=0; j<b.length; j++)
|
||||
if (a[i]==b[j]) fl=true;
|
||||
if (fl)
|
||||
text+="<div><input type='checkbox' id='dhx_clist_"+i+"' checked='true' /><label for='dhx_clist_"+i+"'>"+a[i]+"</label></div>";
|
||||
else
|
||||
text+="<div><input type='checkbox' id='dhx_clist_"+i+"'/><label for='dhx_clist_"+i+"'>"+a[i]+"</label></div>";
|
||||
}
|
||||
text+="<div><input type='button' value='"+(this.grid.applyButtonText||"Apply")+"' style='width:100px; font-size:8pt;' onclick='this.parentNode.parentNode.editor.grid.editStop();'/></div>"
|
||||
|
||||
this.obj.editor=this;
|
||||
this.obj.innerHTML=text;
|
||||
document.body.appendChild(this.obj);
|
||||
this.obj.style.position="absolute";
|
||||
this.obj.className="dhx_clist";
|
||||
this.obj.onclick=function(e){ (e||event).cancelBubble=true; return true; };
|
||||
var arPos = this.grid.getPosition(this.cell);
|
||||
this.obj.style.left=arPos[0]+"px";
|
||||
this.obj.style.top=arPos[1]+this.cell.offsetHeight+"px";
|
||||
|
||||
this.obj.getValue=function(){
|
||||
var text="";
|
||||
for (var i=0; i<this.childNodes.length-1; i++)
|
||||
if (this.childNodes[i].childNodes[0].checked){
|
||||
if (text) text+=", ";
|
||||
text+=this.childNodes[i].childNodes[1].innerHTML;
|
||||
}
|
||||
return text.replace(/&/g,"&");
|
||||
}
|
||||
}
|
||||
this.getValue = function(){
|
||||
//this.grid.editStop();
|
||||
if (this.cell._clearCell) return "";
|
||||
return this.cell.innerHTML.toString()._dhx_trim().replace(/&/g,"&").replace(/, /g, ",");
|
||||
}
|
||||
|
||||
this.detach = function(val){
|
||||
if (this.obj){
|
||||
this.setValue(this.obj.getValue());
|
||||
this.obj.editor=null;
|
||||
this.obj.parentNode.removeChild(this.obj);
|
||||
this.obj=null;
|
||||
}
|
||||
return this.val!=this.getValue();
|
||||
}
|
||||
}
|
||||
eXcell_clist.prototype = new eXcell;
|
||||
|
||||
eXcell_clist.prototype.setValue = function(val){
|
||||
if (typeof(val)=="object"){
|
||||
var optCol=dhx4.ajax.xpath("./option",val);
|
||||
if (optCol.length)
|
||||
this.cell._combo=[];
|
||||
for (var j=0;j<optCol.length; j++)
|
||||
this.cell._combo.push(optCol[j].firstChild?optCol[j].firstChild.data:"");
|
||||
val=val.firstChild.data;
|
||||
}
|
||||
if (val==="" || val === this.undefined){
|
||||
this.setCTxtValue(" ",val);
|
||||
this.cell._clearCell=true;
|
||||
}
|
||||
else{
|
||||
val = val.replace(/,[ ]*/g, ", ");
|
||||
this.setCTxtValue(val);
|
||||
this.cell._clearCell=false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc: register list of values for CList cell
|
||||
* @param: col - index of CList collumn
|
||||
* @param: list - array of list data
|
||||
* @type: public
|
||||
* @edition: Professional
|
||||
*/
|
||||
dhtmlXGridObject.prototype.registerCList=function(col,list){
|
||||
if (!this.clists) this.clists=new Array();
|
||||
if (typeof(list)!="object") list=list.split(",");
|
||||
this.clists[col]=list;
|
||||
}
|
||||
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
@ -0,0 +1,71 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
/**
|
||||
* @desc: auto counter editor
|
||||
* @returns: dhtmlxGrid cell editor object
|
||||
* @type: public
|
||||
*/
|
||||
function eXcell_cntr(cell){
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
if (!this.grid._ex_cntr_ready && !this._realfake){
|
||||
this.grid._ex_cntr_ready=true;
|
||||
if (this.grid._h2)
|
||||
this.grid.attachEvent("onOpenEn",function(id){
|
||||
this.resetCounter(cell._cellIndex);
|
||||
});
|
||||
var fix_cnt = function(){
|
||||
var that=this;
|
||||
window.setTimeout(function(){
|
||||
if (!that.resetCounter) return;
|
||||
if (that._fake && !that._realfake && cell._cellIndex<that._fake._cCount)
|
||||
that._fake.resetCounter(cell._cellIndex);
|
||||
else
|
||||
that.resetCounter(cell._cellIndex);
|
||||
},1);
|
||||
return true;
|
||||
};
|
||||
|
||||
this.grid.attachEvent("onBeforeSorting", fix_cnt);
|
||||
this.grid.attachEvent("onFilterEnd", fix_cnt);
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.edit = function(){}
|
||||
this.getValue = function(){
|
||||
return this.cell.innerHTML;
|
||||
}
|
||||
this.setValue = function(val){
|
||||
this.cell.style.paddingRight = "2px";
|
||||
var cell=this.cell;
|
||||
|
||||
window.setTimeout(function(){
|
||||
if (!cell.parentNode) return;
|
||||
var val=cell.parentNode.rowIndex;
|
||||
if (cell.parentNode.grid.currentPage || val<0 || cell.parentNode.grid._srnd) val=cell.parentNode.grid.rowsBuffer._dhx_find(cell.parentNode)+1;
|
||||
if (val<=0) return;
|
||||
cell.innerHTML = val;
|
||||
if (cell.parentNode.grid._fake && cell._cellIndex<cell.parentNode.grid._fake._cCount && cell.parentNode.grid._fake.rowsAr[cell.parentNode.idd]) cell.parentNode.grid._fake.cells(cell.parentNode.idd,cell._cellIndex).setCValue(val);
|
||||
cell=null;
|
||||
},100);
|
||||
}
|
||||
}
|
||||
dhtmlXGridObject.prototype.resetCounter=function(ind){
|
||||
if (this._fake && !this._realfake && ind < this._fake._cCount) this._fake.resetCounter(ind,this.currentPage);
|
||||
var i=arguments[0]||0;
|
||||
if (this.currentPage)
|
||||
i=(this.currentPage-1)*this.rowsBufferOutSize;
|
||||
for (i=0; i<this.rowsBuffer.length; i++)
|
||||
if (this.rowsBuffer[i] && this.rowsBuffer[i].tagName == "TR" && this.rowsAr[this.rowsBuffer[i].idd])
|
||||
this.rowsAr[this.rowsBuffer[i].idd].childNodes[ind].innerHTML=i+1;
|
||||
}
|
||||
eXcell_cntr.prototype = new eXcell;
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
|
||||
@ -0,0 +1,377 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
dhx4.attachEvent("onGridCreated", function(grid){
|
||||
if (!window.dhx_globalImgPath) window.dhx_globalImgPath = grid.imgURL;
|
||||
|
||||
grid._col_combos = [];
|
||||
for (var i=0; i<grid._cCount; i++) {
|
||||
if(grid.cellType[i].indexOf("combo") == 0) {
|
||||
grid._col_combos[i] = eXcell_combo.prototype.initCombo.call({grid:grid},i);
|
||||
}
|
||||
}
|
||||
|
||||
if (!grid._loading_handler_set) {
|
||||
grid._loading_handler_set = grid.attachEvent("onXLE", function(a,b,c,xml,type){
|
||||
if (type != "xml") return;
|
||||
eXcell_combo.prototype.fillColumnCombos(this,xml);
|
||||
this.detachEvent(this._loading_handler_set);
|
||||
this._loading_handler_set = null;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function eXcell_combo(cell) {
|
||||
|
||||
if (!cell) return;
|
||||
|
||||
this.cell = cell;
|
||||
this.grid = cell.parentNode.grid;
|
||||
this._combo_pre = "";
|
||||
|
||||
this.edit = function(){
|
||||
if (!window.dhx_globalImgPath) window.dhx_globalImgPath = this.grid.imgURL;
|
||||
|
||||
this.val = this.getValue();
|
||||
var val = this.getText();
|
||||
if (this.cell._clearCell) val="";
|
||||
this.cell.innerHTML = "";
|
||||
|
||||
if (!this.cell._brval) {
|
||||
this.combo = (this.grid._realfake?this.grid._fake:this.grid)._col_combos[this.cell._cellIndex];
|
||||
} else {
|
||||
this.combo = this.cell._brval;
|
||||
}
|
||||
this.cell.appendChild(this.combo.DOMParent);
|
||||
|
||||
this.combo.DOMParent.style.margin = "0";
|
||||
|
||||
this.combo.DOMelem_input.focus();
|
||||
this.combo.setSize(this.cell.offsetWidth-2);
|
||||
|
||||
var index = -1;
|
||||
if (!this.combo._xml) {
|
||||
if (this.combo.getIndexByValue(this.cell.combo_value)!=-1) {
|
||||
index = this.combo.getIndexByValue(this.cell.combo_value);
|
||||
this.combo.selectOption(index);
|
||||
} else {
|
||||
if (this.combo.getOptionByLabel(val)) {
|
||||
index = this.combo.getIndexByValue(this.combo.getOptionByLabel(val).value);
|
||||
this.combo.selectOption(index);
|
||||
} else {
|
||||
if (this.combo.conf.f_url){
|
||||
this.combo.setComboText(val);
|
||||
} else {
|
||||
this.combo.unSelectOption();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.combo.setComboText(val);
|
||||
}
|
||||
|
||||
this.combo.conf.f_server_last = NaN;
|
||||
if (!this.combo.conf.ro_mode)
|
||||
this.combo._filterOpts();
|
||||
this.combo.openSelect();
|
||||
|
||||
if (index >= 0)
|
||||
this.combo.list.scrollTop = index * 32;
|
||||
}
|
||||
|
||||
this.selectComboOption = function(val,obj){
|
||||
obj.selectOption(obj.getIndexByValue(obj.getOptionByLabel(val).value));
|
||||
}
|
||||
|
||||
this.getValue = function(val){
|
||||
return this.cell.combo_value||"";
|
||||
}
|
||||
|
||||
this.getText = function(val){
|
||||
var c = this.cell;
|
||||
if (this._combo_pre == "" && c.childNodes[1]) {
|
||||
c = c.childNodes[1];
|
||||
} else {
|
||||
c.childNodes[0].childNodes[1];
|
||||
}
|
||||
return (_isIE ? c.innerText : c.textContent);
|
||||
}
|
||||
|
||||
this.setValue = function(val){
|
||||
if (typeof(val) == "object"){
|
||||
|
||||
this.cell._brval = this.initCombo();
|
||||
var index = this.cell._cellIndex;
|
||||
var idd = this.cell.parentNode.idd;
|
||||
if (!val.firstChild) {
|
||||
this.cell.combo_value = " ";
|
||||
this.cell._clearCell = true;
|
||||
} else {
|
||||
this.cell.combo_value = val.firstChild.data;
|
||||
}
|
||||
this.setComboOptions(this.cell._brval, val, this.grid, index, idd);
|
||||
|
||||
} else {
|
||||
this.cell.combo_value = val;
|
||||
var cm = null;
|
||||
if ((cm = this.cell._brval) && (typeof(this.cell._brval) == "object")) {
|
||||
val = (cm.getOption(val)||{}).text||val;
|
||||
} else if (cm = this.grid._col_combos[this.cell._cellIndex]||((this.grid._fake) && (cm = this.grid._fake._col_combos[this.cell._cellIndex]))) {
|
||||
var option = cm.getOption(val)||{};
|
||||
val = (cm.getOption(val)||{}).text||val;
|
||||
if (typeof val === "object"){
|
||||
val = option.text_input;
|
||||
}
|
||||
}
|
||||
|
||||
if ((val||"").toString()._dhx_trim()=="") val = null;
|
||||
|
||||
if (val !== null) {
|
||||
this.setComboCValue(val);
|
||||
} else {
|
||||
this.setComboCValue(" ", "");
|
||||
this.cell._clearCell = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.detach = function(){
|
||||
var p = this.combo.getParent();
|
||||
if (p.parentNode == this.cell) {
|
||||
this.cell.removeChild(p);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
var val = this.cell.combo_value;
|
||||
this.combo._confirmSelect("blur");
|
||||
|
||||
if (!this.combo.getComboText() || this.combo.getComboText().toString()._dhx_trim()=="") {
|
||||
this.setComboCValue(" ");
|
||||
this.cell._clearCell=true;
|
||||
} else {
|
||||
this.setComboCValue(this.combo.getComboText().replace(/\&/g,"&").replace(/</g,"<").replace(/>/g,">"),this.combo.getActualValue());
|
||||
this.cell._clearCell = false;
|
||||
}
|
||||
|
||||
this.cell.combo_value = this.combo.getActualValue();
|
||||
this.combo.closeAll();
|
||||
this.grid._still_active=true;
|
||||
this.grid.setActive(1);
|
||||
return val!=this.cell.combo_value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
eXcell_combo.prototype = new eXcell;
|
||||
eXcell_combo_v = function(cell){
|
||||
var combo = new eXcell_combo(cell);
|
||||
combo._combo_pre = "<img src='"+(window.dhx_globalImgPath?window.dhx_globalImgPath:this.grid.imgURL)+"combo_select.gif' class='dhxgrid_combo_icon'/>";
|
||||
return combo;
|
||||
};
|
||||
|
||||
eXcell_combo.prototype.initCombo = function(index){
|
||||
|
||||
var container = document.createElement("DIV");
|
||||
container.className = "dhxcombo_in_grid_parent";
|
||||
var type = this.grid.defVal[arguments.length?index:this.cell._cellIndex];
|
||||
var combo = new dhtmlXCombo(container, "combo", 0, type);
|
||||
this.grid.defVal[arguments.length?index:this.cell._cellIndex] = "";
|
||||
|
||||
var grid = this.grid;
|
||||
combo.DOMelem.onmousedown = combo.DOMelem.onclick = function(e){
|
||||
e = e||event;
|
||||
e.cancelBubble = true;
|
||||
};
|
||||
combo.DOMelem.onselectstart = function(e){
|
||||
e = e||event;
|
||||
e.cancelBubble = true;
|
||||
return true;
|
||||
};
|
||||
|
||||
this.grid.attachEvent("onScroll", function(){
|
||||
if (combo._isListVisible()) combo._hideList();
|
||||
});
|
||||
|
||||
combo.attachEvent("onKeyPressed",function(ev){
|
||||
if (ev==13 || ev==27) {
|
||||
grid.editStop();
|
||||
if (grid._fake) grid._fake.editStop();
|
||||
}
|
||||
});
|
||||
|
||||
return combo;
|
||||
|
||||
};
|
||||
|
||||
eXcell_combo.prototype.fillColumnCombos = function(grid,xml){
|
||||
if (!xml) return;
|
||||
var top = dhx4.ajax.xmltop("rows", xml, -1);
|
||||
if (top && top.tagName !== "DIV"){
|
||||
grid.combo_columns = grid.combo_columns||[];
|
||||
columns = dhx4.ajax.xpath("//column", top);
|
||||
for (var i=0; i<columns.length; i++) {
|
||||
if ((columns[i].getAttribute("type")||"").indexOf("combo") == 0) {
|
||||
grid.combo_columns[grid.combo_columns.length] = i;
|
||||
this.setComboOptions(grid._col_combos[i], columns[i], grid, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
eXcell_combo.prototype.setComboCValue = function(value, value2) {
|
||||
if (this._combo_pre != "") {
|
||||
var height = (this.cell.offsetHeight?this.cell.offsetHeight+"px":0);
|
||||
value = "<div style='width:100%;position:relative;height:100%;overflow:hidden;'>"+this._combo_pre+"<span>"+value+"</span></div>";
|
||||
}
|
||||
if (arguments.length > 1) {
|
||||
this.setCValue(value,value2);
|
||||
} else {
|
||||
this.setCValue(value);
|
||||
}
|
||||
};
|
||||
|
||||
eXcell_combo.prototype.setComboOptions = function(combo, obj, grid, index, idd) {
|
||||
|
||||
if (window.dhx4.s2b(obj.getAttribute("xmlcontent"))) {
|
||||
|
||||
if (!obj.getAttribute("source")) {
|
||||
options = obj.childNodes;
|
||||
var _optArr = [];
|
||||
for (var i=0; i < options.length; i++){
|
||||
if(options[i].tagName =="option"){
|
||||
var text_opt = options[i].firstChild? options[i].firstChild.data:"";
|
||||
_optArr[_optArr.length]= [options[i].getAttribute("value"),text_opt, (options[i].getAttribute("css")||"")];
|
||||
}
|
||||
}
|
||||
combo.addOption(_optArr)
|
||||
if(arguments.length == 4){
|
||||
grid.forEachRowA(function(id){
|
||||
var c = grid.cells(id,index);
|
||||
if(!c.cell._brval&&!c.cell._cellType&&(c.cell._cellIndex==index)){
|
||||
if(c.cell.combo_value=="") c.setComboCValue(" ","");
|
||||
else{
|
||||
if(!combo.getOption(c.cell.combo_value))
|
||||
c.setComboCValue(c.cell.combo_value);
|
||||
else c.setComboCValue(combo.getOption(c.cell.combo_value).text, c.cell.combo_value);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
var c = (this.cell)?this:grid.cells(idd,index);
|
||||
if(obj.getAttribute("text")) {
|
||||
if(obj.getAttribute("text")._dhx_trim()=="") c.setComboCValue(" ","");
|
||||
else c.setComboCValue(obj.getAttribute("text"));
|
||||
}
|
||||
else{
|
||||
if((!c.cell.combo_value)||(c.cell.combo_value._dhx_trim()=="")) c.setComboCValue(" ","");
|
||||
else{
|
||||
if(!combo.getOption(c.cell.combo_value))
|
||||
c.setComboCValue(c.cell.combo_value);
|
||||
else c.setComboCValue(combo.getOption(c.cell.combo_value).text, c.cell.combo_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (obj.getAttribute("source")) {
|
||||
if (obj.getAttribute("auto") && window.dhx4.s2b(obj.getAttribute("auto"))) {
|
||||
|
||||
if (obj.getAttribute("xmlcontent")) {
|
||||
var c = (this.cell)?this:grid.cells(idd,index);
|
||||
if (obj.getAttribute("text")) c.setComboCValue(obj.getAttribute("text"));
|
||||
} else {
|
||||
grid.forEachRowA(function(id){
|
||||
var c = grid.cells(id,index);
|
||||
if (!c.cell._brval && !c.cell._cellType) {
|
||||
var str = c.cell.combo_value.toString();
|
||||
if (str.indexOf("^") != -1) {
|
||||
var arr = str.split("^");
|
||||
c.cell.combo_value = arr[0];
|
||||
c.setComboCValue(arr[1]);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
combo.enableFilteringMode(true, obj.getAttribute("source"), window.dhx4.s2b(obj.getAttribute("cache")||true), window.dhx4.s2b(obj.getAttribute("sub")||false));
|
||||
|
||||
} else {
|
||||
|
||||
var that = this;
|
||||
var length = arguments.length;
|
||||
combo.load(obj.getAttribute("source"), function(){
|
||||
if (length == 4) {
|
||||
grid.forEachRow(function(id){
|
||||
var c = grid.cells(id,index);
|
||||
if (!c.cell._brval && !c.cell._cellType) {
|
||||
if (combo.getOption(c.cell.combo_value)) {
|
||||
c.setComboCValue(combo.getOption(c.cell.combo_value).text, c.cell.combo_value);
|
||||
} else {
|
||||
if ((c.cell.combo_value||"").toString()._dhx_trim() == "") {
|
||||
c.setComboCValue(" ","");
|
||||
c.cell._clearCell=true;
|
||||
} else {
|
||||
c.setComboCValue(c.cell.combo_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//var c = (that.cell)? that : grid.cells(idd,index);
|
||||
var c = grid.cells(idd,index);
|
||||
//c.setCValue(obj.getAttribute("text"));
|
||||
if (combo.getOption(c.cell.combo_value)) {
|
||||
c.setComboCValue(combo.getOption(c.cell.combo_value).text, c.cell.combo_value);
|
||||
} else {
|
||||
c.setComboCValue(c.cell.combo_value);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
combo.enableFilteringMode(true);
|
||||
|
||||
}
|
||||
}
|
||||
if (!obj.getAttribute("auto") || !window.dhx4.s2b(obj.getAttribute("auto"))) {
|
||||
if (obj.getAttribute("editable") && !window.dhx4.s2b(obj.getAttribute("editable"))) combo.readonly(true);
|
||||
if (obj.getAttribute("filter") && window.dhx4.s2b(obj.getAttribute("filter"))) combo.enableFilteringMode(true);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
eXcell_combo.prototype.getCellCombo = function() {
|
||||
|
||||
if (this.cell._brval) return this.cell._brval;
|
||||
|
||||
this.cell._brval = this.initCombo();
|
||||
return this.cell._brval;
|
||||
|
||||
};
|
||||
|
||||
eXcell_combo.prototype.refreshCell = function() {
|
||||
this.setValue(this.getValue());
|
||||
};
|
||||
|
||||
dhtmlXGridObject.prototype.getColumnCombo = function(index) {
|
||||
if (this._col_combos && this._col_combos[index]) return this._col_combos[index];
|
||||
|
||||
if (!this._col_combos) this._col_combos = [];
|
||||
this._col_combos[index] = eXcell_combo.prototype.initCombo.call({grid:this},index);
|
||||
return this._col_combos[index];
|
||||
|
||||
};
|
||||
|
||||
dhtmlXGridObject.prototype.refreshComboColumn = function(index) {
|
||||
this.forEachRow(function(id){
|
||||
if (this.cells(id,index).refreshCell) this.cells(id,index).refreshCell();
|
||||
});
|
||||
};
|
||||
|
||||
@ -0,0 +1,64 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
function eXcell_context(cell){
|
||||
if (cell){
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
|
||||
if (!this.grid._sub_context) return;
|
||||
this._sub=this.grid._sub_context[cell._cellIndex];
|
||||
if (!this._sub) return;
|
||||
this._sindex=this._sub[1];
|
||||
this._sub=this._sub[0];
|
||||
}
|
||||
|
||||
this.getValue = function(){
|
||||
return _isIE?this.cell.innerText:this.cell.textContent;
|
||||
}
|
||||
this.setValue = function(val){
|
||||
this.cell._val=val;
|
||||
var item = this._sub.itemPull[this._sub.idPrefix+this.cell._val];
|
||||
val = item?item.title:val;
|
||||
this.setCValue((val||" "),val);
|
||||
}
|
||||
this.edit = function(){
|
||||
var arPos = this.grid.getPosition(this.cell);//,this.grid.objBox
|
||||
|
||||
this._sub.showContextMenu(arPos[0]+this.cell.offsetWidth,arPos[1]);
|
||||
var a=this.grid.editStop;
|
||||
this.grid.editStop=function(){};
|
||||
this.grid.editStop=a;
|
||||
}
|
||||
this.detach=function(){
|
||||
if (this.grid._sub_id != null) {
|
||||
var old=this.cell._val;
|
||||
this.setValue(this.grid._sub_id);
|
||||
this.grid._sub_id = null;
|
||||
return this.cell._val!=old;
|
||||
}
|
||||
this._sub.hideContextMenu();
|
||||
}
|
||||
}
|
||||
eXcell_context.prototype = new eXcell;
|
||||
|
||||
|
||||
dhtmlXGridObject.prototype.setSubContext=function(ctx,s_index,t_index){
|
||||
var that=this;
|
||||
ctx.attachEvent("onClick",function(id,value){
|
||||
that._sub_id = id;
|
||||
that.editStop();
|
||||
ctx.hideContextMenu();
|
||||
return true;
|
||||
});
|
||||
if (!this._sub_context)
|
||||
this._sub_context=[];
|
||||
this._sub_context[s_index]=[ctx,t_index];
|
||||
ctx.hideContextMenu();
|
||||
};
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
@ -0,0 +1,163 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
//Combobox
|
||||
function eXcell_cor(cell){
|
||||
if (cell){
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
this.combo = this.grid.getCombo(this.cell._cellIndex);
|
||||
this.editable = true
|
||||
}
|
||||
this.shiftNext=function(){
|
||||
|
||||
var z=this.list.options[this.list.selectedIndex+1];
|
||||
if (z) z.selected=true;
|
||||
this.obj.value=this.list.value;
|
||||
|
||||
return true;
|
||||
}
|
||||
this.shiftPrev=function(){
|
||||
|
||||
var z=this.list.options[this.list.selectedIndex-1];
|
||||
if (z) z.selected=true;
|
||||
|
||||
this.obj.value=this.list.value;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
this.edit = function(){
|
||||
this.val = this.getValue();
|
||||
this.text = this.cell.innerHTML._dhx_trim();
|
||||
var arPos = this.grid.getPosition(this.cell)//,this.grid.objBox)
|
||||
|
||||
this.obj = document.createElement("TEXTAREA");
|
||||
this.obj.className="dhx_combo_edit";
|
||||
this.obj.style.height=(this.cell.offsetHeight-4)+"px";
|
||||
|
||||
this.obj.wrap = "soft";
|
||||
this.obj.style.textAlign = this.cell.align;
|
||||
this.obj.onclick = function(e){(e||event).cancelBubble = true}
|
||||
this.obj.value = this.text
|
||||
|
||||
this.list = document.createElement("SELECT");
|
||||
this.list.editor_obj = this;
|
||||
this.list.className='dhx_combo_select';
|
||||
this.list.style.width=this.cell.offsetWidth+"px";
|
||||
this.list.style.left = arPos[0]+"px";//arPos[0]
|
||||
this.list.style.top = arPos[1]+this.cell.offsetHeight+"px";//arPos[1]+this.cell.offsetHeight;
|
||||
this.list.onclick = function(e){
|
||||
var ev = e||window.event;
|
||||
var cell = ev.target||ev.srcElement
|
||||
//tbl.editor_obj.val=cell.combo_val;
|
||||
if (cell.tagName=="OPTION") cell=cell.parentNode;
|
||||
if (cell.value!=-1){
|
||||
cell.editor_obj._byClick=true;
|
||||
// cell.editor_obj.setValue(cell.value);
|
||||
cell.editor_obj.editable=false;
|
||||
cell.editor_obj.grid.editStop();
|
||||
}
|
||||
else {
|
||||
ev.cancelBubble=true;
|
||||
cell.editor_obj.obj.value="";
|
||||
cell.editor_obj.obj.focus();
|
||||
}
|
||||
}
|
||||
var comboKeys = this.combo.getKeys();
|
||||
|
||||
var selOptId=0;
|
||||
|
||||
this.list.options[0]=new Option(this.combo.get(comboKeys[0]),comboKeys[0]);
|
||||
this.list.options[0].selected=true;
|
||||
|
||||
for(var i=1;i<comboKeys.length;i++){
|
||||
var val = this.combo.get(comboKeys[i])
|
||||
this.list.options[this.list.options.length]=new Option(val,comboKeys[i]);
|
||||
if(comboKeys[i]==this.val)
|
||||
selOptId=this.list.options.length-1;
|
||||
}
|
||||
|
||||
document.body.appendChild(this.list)//nb:this.grid.objBox.appendChild(this.listBox);
|
||||
this.list.size="6";
|
||||
this.cstate=1;
|
||||
if(this.editable){
|
||||
this.cell.innerHTML = "";
|
||||
}
|
||||
else {
|
||||
this.obj.style.width="1px";
|
||||
this.obj.style.height="1px";
|
||||
}
|
||||
this.cell.appendChild(this.obj);
|
||||
this.list.options[selOptId].selected=true;
|
||||
//fix for coro - FF scrolls grid in incorrect position
|
||||
if (this.editable){
|
||||
this.obj.focus();
|
||||
this.obj.focus();
|
||||
}
|
||||
if (!this.editable)
|
||||
this.obj.style.visibility="hidden";
|
||||
}
|
||||
|
||||
this.getValue = function(){
|
||||
return ((this.cell.combo_value==window.undefined)?"":this.cell.combo_value);
|
||||
}
|
||||
this.getText = function(){
|
||||
return this.cell.innerHTML;
|
||||
}
|
||||
this.getState=function(){
|
||||
return {prev:this.cell.__prev,now:this.cell.__now};
|
||||
}
|
||||
this.detach = function(){
|
||||
if(this.val!=this.getValue()){
|
||||
this.cell.wasChanged = true;
|
||||
}
|
||||
|
||||
if(this.list.parentNode!=null){
|
||||
if ((this.obj.value._dhx_trim()!=this.text)||(this._byClick)){
|
||||
//cell data was changed
|
||||
var cval=this.list.value;
|
||||
if (!this._byClick)
|
||||
this.combo.values[this.combo.keys._dhx_find(cval)]=this.obj.value;
|
||||
this.setValue(cval);
|
||||
}else{
|
||||
this.setValue(this.val);
|
||||
}
|
||||
}
|
||||
if(this.list.parentNode)
|
||||
this.list.parentNode.removeChild(this.list);
|
||||
if(this.obj.parentNode)
|
||||
this.obj.parentNode.removeChild(this.obj);
|
||||
|
||||
return this.val!=this.getValue();
|
||||
}
|
||||
}
|
||||
eXcell_cor.prototype = new eXcell;
|
||||
eXcell_cor.prototype.setValue = function(val){
|
||||
if ((val||"").toString()._dhx_trim()=="")
|
||||
val=null
|
||||
|
||||
var viVal=this.grid.getCombo(this.cell._cellIndex).get(val);
|
||||
if ((val==-1)&&(viVal=="")){
|
||||
this.combo.values[this.combo.keys._dhx_find(-1)]="Create new value";
|
||||
val=null;
|
||||
}
|
||||
|
||||
|
||||
if (val!==null)
|
||||
this.setCValue( viVal,val);
|
||||
else
|
||||
this.setCValue(" ",val);
|
||||
|
||||
this.cell.__prev=this.cell.__now;
|
||||
this.cell.__now={key:val,value:viVal};
|
||||
|
||||
this.cell.combo_value = val;
|
||||
}
|
||||
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
@ -0,0 +1,60 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
/*
|
||||
Decimal value (10,000.00) eXcell for dhtmlxGrid
|
||||
(c)DHTMLX LTD. 2005
|
||||
|
||||
|
||||
The corresponding cell value in XML should be valid number
|
||||
|
||||
Samples:
|
||||
<cell>123.01</cell>
|
||||
<cell>1234.09356</cell>
|
||||
<cell>12345</cell>
|
||||
<cell>0</cell>
|
||||
<cell>-100</cell>
|
||||
*/
|
||||
function eXcell_dec(cell){
|
||||
if (cell){
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
}
|
||||
this.getValue = function(){
|
||||
return parseFloat(this.cell.innerHTML.replace(/,/g,""));
|
||||
}
|
||||
|
||||
this.setValue = function(val){
|
||||
var format = "0,000.00";
|
||||
if(val=="0"){
|
||||
this.setCValue(format.replace(/.*(0\.[0]+)/,"$1"),val);
|
||||
return;
|
||||
}
|
||||
var z = format.substr(format.indexOf(".")+1).length
|
||||
val = Math.round(val*Math.pow(10,z)).toString();
|
||||
var out = "";
|
||||
var cnt=0;
|
||||
var fl = false;
|
||||
for(var i=val.length-1;i>=0;i--){
|
||||
cnt++;
|
||||
out = val.charAt(i)+out;
|
||||
if(!fl && cnt==z){
|
||||
out = "."+out;
|
||||
cnt=0;
|
||||
fl = true;
|
||||
}
|
||||
if(fl && cnt==3 && i!=0 && val.charAt(i-1)!='-'){
|
||||
out = ","+out;
|
||||
cnt=0;
|
||||
}
|
||||
}
|
||||
this.setCValue(out,val);
|
||||
}
|
||||
}
|
||||
eXcell_dec.prototype = new eXcell_ed;
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
@ -0,0 +1,261 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
function eXcell_dhxCalendar(cell) {
|
||||
if (cell) {
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
|
||||
if (!this.grid._grid_calendarA) {
|
||||
|
||||
var cal = this.grid._grid_calendarA = new dhtmlxCalendarObject();
|
||||
this.grid.callEvent("onDhxCalendarCreated", [cal]);
|
||||
|
||||
var sgrid = this.grid;
|
||||
cal.attachEvent("onClick",function(){
|
||||
this._last_operation_calendar=true;
|
||||
window.setTimeout(function(){sgrid.editStop()},1);
|
||||
return true;
|
||||
});
|
||||
|
||||
var zFunc = function(e){ (e||event).cancelBubble=true; }
|
||||
dhtmlxEvent(cal.base, "click", zFunc);
|
||||
cal = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
eXcell_dhxCalendar.prototype = new eXcell;
|
||||
|
||||
eXcell_dhxCalendar.prototype.edit = function() {
|
||||
|
||||
var arPos = this.grid.getPosition(this.cell);
|
||||
|
||||
this.grid._grid_calendarA._show(false, false);
|
||||
var yPosition = 0;
|
||||
if(!window.innerHeight || (arPos[1] + this.grid._grid_calendarA.base.offsetHeight + this.cell.offsetHeight < window.innerHeight)) {
|
||||
// Enough space to show dhxCalendar below date
|
||||
yPosition = arPos[1]+this.cell.offsetHeight;
|
||||
} else {
|
||||
// Show dhxCalendar above date
|
||||
yPosition = arPos[1]-(this.grid._grid_calendarA.base.offsetHeight);
|
||||
}
|
||||
var xPosition = arPos[0];
|
||||
if (window.innerWidth && (xPosition+this.grid._grid_calendarA.base.clientWidth+ this.cell.offsetWidth>window.innerWidth)) {
|
||||
xPosition = window.innerWidth-this.grid._grid_calendarA.base.clientWidth;
|
||||
}
|
||||
this.grid._grid_calendarA.setPosition(xPosition, yPosition);
|
||||
this.grid._grid_calendarA._last_operation_calendar = false;
|
||||
|
||||
|
||||
this.grid.callEvent("onCalendarShow", [this.grid._grid_calendarA, this.cell.parentNode.idd, this.cell._cellIndex]);
|
||||
this.cell._cediton = true;
|
||||
this.val = this.cell.val;
|
||||
this._val = this.cell.innerHTML;
|
||||
var t = this.grid._grid_calendarA.draw;
|
||||
this.grid._grid_calendarA.draw = function(){};
|
||||
this.grid._grid_calendarA.setDateFormat((this.grid._dtmask||"%d/%m/%Y"));
|
||||
this.grid._grid_calendarA.setDate(this.val||(new Date()));
|
||||
this.grid._grid_calendarA.draw = t;
|
||||
}
|
||||
eXcell_dhxCalendar.prototype.getDate = function() {
|
||||
if (this.cell.val) return this.cell.val;
|
||||
return null;
|
||||
}
|
||||
|
||||
eXcell_dhxCalendar.prototype.getValue = function() {
|
||||
if (this.cell._clearCell) return "";
|
||||
if (this.grid._dtmask_inc && this.cell.val) return this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask_inc, this.cell.val).toString();
|
||||
return this.cell.innerHTML.toString()._dhx_trim()
|
||||
}
|
||||
|
||||
eXcell_dhxCalendar.prototype.detach = function() {
|
||||
if (!this.grid._grid_calendarA) return;
|
||||
this.grid._grid_calendarA.hide();
|
||||
if (this.cell._cediton) this.cell._cediton = false; else return;
|
||||
|
||||
if (this.grid._grid_calendarA._last_operation_calendar) {
|
||||
var z1=this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"));
|
||||
var z2=this.grid._grid_calendarA.getDate();
|
||||
this.cell.val=new Date(z2);
|
||||
this.setCValue(z1,z2);
|
||||
this.cell._clearCell = !z1;
|
||||
return (this.cell.val.valueOf()!=(this.val||"").valueOf());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
eXcell_dhxCalendar.prototype.getOldValue = function(val) {
|
||||
if (this.val && this.val !== "%nbsp;")
|
||||
return this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask_inc||this.grid._dtmask||"%d/%m/%Y"),this.val);
|
||||
return this.val;
|
||||
}
|
||||
|
||||
|
||||
eXcell_dhxCalendar.prototype.setValue = function(val) {
|
||||
|
||||
if (val && typeof val == "object") {
|
||||
this.cell.val=val;
|
||||
this.cell._clearCell=false;
|
||||
this.setCValue(this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),val).toString(),this.cell.val);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!val || val.toString()._dhx_trim()=="") {
|
||||
val=" ";
|
||||
this.cell._clearCell=true;
|
||||
this.cell.val="";
|
||||
} else{
|
||||
this.cell._clearCell=false;
|
||||
this.cell.val=new Date(this.grid._grid_calendarA.setFormatedDate((this.grid._dtmask_inc||this.grid._dtmask||"%d/%m/%Y"),val.toString(),null,true));
|
||||
if (this.grid._dtmask_inc)
|
||||
val = this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),this.cell.val);
|
||||
}
|
||||
|
||||
if ((this.cell.val=="NaN")||(this.cell.val=="Invalid Date")) {
|
||||
this.cell._clearCell=true;
|
||||
this.cell.val=new Date();
|
||||
this.setCValue(" ",0);
|
||||
} else {
|
||||
this.setCValue((val||"").toString(),this.cell.val);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function eXcell_dhxCalendarA(cell) {
|
||||
if (cell) {
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
|
||||
if (!this.grid._grid_calendarA) {
|
||||
|
||||
var cal = this.grid._grid_calendarA = new dhtmlxCalendarObject();
|
||||
this.grid.callEvent("onDhxCalendarCreated",[cal]);
|
||||
|
||||
var sgrid=this.grid;
|
||||
cal.attachEvent("onClick",function() {
|
||||
this._last_operation_calendar=true;
|
||||
window.setTimeout(function() {sgrid.editStop()},1);
|
||||
return true;
|
||||
});
|
||||
|
||||
var zFunc=function(e) { (e||event).cancelBubble=true; }
|
||||
dhtmlxEvent(cal.base,"click",zFunc);
|
||||
}
|
||||
}
|
||||
}
|
||||
eXcell_dhxCalendarA.prototype = new eXcell;
|
||||
|
||||
eXcell_dhxCalendarA.prototype.edit = function() {
|
||||
var arPos = this.grid.getPosition(this.cell);
|
||||
|
||||
this.grid._grid_calendarA._show(false, false);
|
||||
this.grid._grid_calendarA.setPosition(arPos[0]*1+this.cell.offsetWidth,arPos[1]*1);
|
||||
this.grid.callEvent("onCalendarShow",[this.grid._grid_calendarA,this.cell.parentNode.idd,this.cell._cellIndex]);
|
||||
this.grid._grid_calendarA._last_operation_calendar=false;
|
||||
|
||||
this.cell._cediton=true;
|
||||
this.val=this.cell.val;
|
||||
this._val=this.cell.innerHTML;
|
||||
|
||||
var t=this.grid._grid_calendarA.draw; this.grid._grid_calendarA.draw=function() {};
|
||||
this.grid._grid_calendarA.setDateFormat((this.grid._dtmask||"%d/%m/%Y"));
|
||||
this.grid._grid_calendarA.setDate(this.val);
|
||||
this.grid._grid_calendarA.draw=t;
|
||||
|
||||
this.cell.atag=((!this.grid.multiLine)&&(_isKHTML||_isMacOS||_isFF))?"INPUT":"TEXTAREA";
|
||||
|
||||
this.obj = document.createElement(this.cell.atag);
|
||||
this.obj.style.height = (this.cell.offsetHeight-4)+"px";
|
||||
this.obj.className="dhx_combo_edit";
|
||||
this.obj.wrap = "soft";
|
||||
this.obj.style.textAlign = this.cell.align;
|
||||
this.obj.onclick = function(e) {(e||event).cancelBubble = true}
|
||||
this.obj.onmousedown = function(e) {(e||event).cancelBubble = true}
|
||||
this.obj.value = this.getValue();
|
||||
this.cell.innerHTML = "";
|
||||
this.cell.appendChild(this.obj);
|
||||
if (window.dhx4.isIE) {
|
||||
this.obj.style.overflow = "visible";
|
||||
if ((this.grid.multiLine)&&(this.obj.offsetHeight>=18)&&(this.obj.offsetHeight<40)) {
|
||||
this.obj.style.height = "36px";
|
||||
this.obj.style.overflow = "scroll";
|
||||
}
|
||||
}
|
||||
this.obj.onselectstart=function(e) {
|
||||
if (!e) e=event;
|
||||
e.cancelBubble = true;
|
||||
return true;
|
||||
};
|
||||
this.obj.focus()
|
||||
this.obj.focus()
|
||||
|
||||
}
|
||||
|
||||
eXcell_dhxCalendarA.prototype.getDate = function() {
|
||||
if (this.cell.val) return this.cell.val;
|
||||
return null;
|
||||
}
|
||||
|
||||
eXcell_dhxCalendarA.prototype.getValue = function() {
|
||||
if (this.cell._clearCell) return "";
|
||||
if (this.grid._dtmask_inc && this.cell.val)
|
||||
return this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask_inc, this.cell.val).toString();
|
||||
return this.cell.innerHTML.toString()._dhx_trim()
|
||||
}
|
||||
|
||||
eXcell_dhxCalendarA.prototype.detach = function() {
|
||||
if (!this.grid._grid_calendarA) return;
|
||||
this.grid._grid_calendarA.hide();
|
||||
if (this.cell._cediton) this.cell._cediton=false; else return;
|
||||
if (this.grid._grid_calendarA._last_operation_calendar) {
|
||||
this.grid._grid_calendarA._last_operation_calendar=false;
|
||||
var z1=this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask||"%d/%m/%Y");
|
||||
var z2=this.grid._grid_calendarA.getDate();
|
||||
this.cell.val=new Date(z2);
|
||||
this.setCValue(z1,z2);
|
||||
this.cell._clearCell = !z1;
|
||||
var t = this.val;
|
||||
this.val=this._val;
|
||||
return (this.cell.val.valueOf()!=(t||"").valueOf());
|
||||
}
|
||||
this.setValue(this.obj.value);
|
||||
var t = this.val;
|
||||
this.val = this._val;
|
||||
return (this.cell.val.valueOf()!=(t||"").valueOf());
|
||||
}
|
||||
|
||||
eXcell_dhxCalendarA.prototype.setValue = function(val) {
|
||||
if (val && typeof val == "object") {
|
||||
this.cell.val=val;
|
||||
this.cell._clearCell=false;
|
||||
this.setCValue(this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),val).toString(),this.cell.val);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!val || val.toString()._dhx_trim()=="") {
|
||||
val=" ";
|
||||
this.cell._clearCell=true;
|
||||
this.cell.val="";
|
||||
} else {
|
||||
this.cell._clearCell = false;
|
||||
this.cell.val = new Date(this.grid._grid_calendarA.setFormatedDate((this.grid._dtmask_inc||this.grid._dtmask||"%d/%m/%Y"),val.toString(),null,true));
|
||||
if (this.grid._dtmask_inc)
|
||||
val = this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),this.cell.val);
|
||||
}
|
||||
|
||||
if ((this.cell.val=="NaN")||(this.cell.val=="Invalid Date")) {
|
||||
this.cell.val=new Date();
|
||||
this.cell._clearCell=true;
|
||||
this.setCValue(" ",0);
|
||||
} else {
|
||||
this.setCValue((val||"").toString(),this.cell.val);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,80 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
function eXcell_grid(cell){
|
||||
if (cell){
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
|
||||
if (!this.grid._sub_grids) return;
|
||||
this._sub=this.grid._sub_grids[cell._cellIndex];
|
||||
if (!this._sub) return;
|
||||
this._sindex=this._sub[1];
|
||||
this._sub=this._sub[0];
|
||||
}
|
||||
|
||||
this.getValue = function(){
|
||||
return this.cell.val;
|
||||
}
|
||||
this.setValue = function(val){
|
||||
this.cell.val=val;
|
||||
|
||||
if (this._sub.getRowById(val)) {
|
||||
val=this._sub.cells(val,this._sindex);
|
||||
if (val) val=val.getValue();
|
||||
else val="";
|
||||
}
|
||||
|
||||
this.setCValue((val||" "),val);
|
||||
|
||||
}
|
||||
this.edit = function(){
|
||||
this.val = this.cell.val;
|
||||
|
||||
this._sub.entBox.style.display='block';
|
||||
var arPos = this.grid.getPosition(this.cell);//,this.grid.objBox
|
||||
this._sub.entBox.style.top=arPos[1]+"px";
|
||||
this._sub.entBox.style.left=arPos[0]+"px";
|
||||
this._sub.entBox.style.position="absolute";
|
||||
this._sub.setSizes();
|
||||
|
||||
var a=this.grid.editStop;
|
||||
this.grid.editStop=function(){};
|
||||
if (this._sub.getRowById(this.cell.val))
|
||||
this._sub.setSelectedRow(this.cell.val);
|
||||
this._sub.setActive(true)
|
||||
|
||||
this.grid.editStop=a;
|
||||
}
|
||||
this.detach=function(){
|
||||
var old=this.cell.val;
|
||||
this._sub.entBox.style.display='none';
|
||||
if (this._sub.getSelectedId()===null) return false;
|
||||
this.setValue(this._sub.getSelectedId());
|
||||
this.grid.setActive(true)
|
||||
return this.cell.val!=old;
|
||||
}
|
||||
}
|
||||
eXcell_grid.prototype = new eXcell;
|
||||
|
||||
|
||||
dhtmlXGridObject.prototype.setSubGrid=function(grid,s_index,t_index){
|
||||
if (!this._sub_grids)
|
||||
this._sub_grids=[];
|
||||
this._sub_grids[s_index]=[grid,t_index];
|
||||
grid.entBox.style.display="none";
|
||||
var that=this;
|
||||
|
||||
grid.entBox.onclick = function(event) { (event || window.event).cancelBubble = true;return false; }
|
||||
grid.attachEvent("onRowSelect",function(id){
|
||||
that.editStop();
|
||||
return true;
|
||||
});
|
||||
grid._chRRS=false;
|
||||
};
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
@ -0,0 +1,68 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
function eXcell_limit(cell){
|
||||
|
||||
if (cell){
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
}
|
||||
this.edit = function(){
|
||||
this.cell.atag=((!this.grid.multiLine)&&(_isKHTML||_isMacOS||_isFF))?"INPUT":"TEXTAREA";
|
||||
this.val = this.getValue();
|
||||
this.obj = document.createElement(this.cell.atag);
|
||||
this.obj.style.height = (this.cell.offsetHeight-(_isIE?6:4))+"px";
|
||||
this.obj.className="dhx_combo_edit";
|
||||
this.obj.wrap = "soft";
|
||||
this.obj.style.textAlign = this.cell.align;
|
||||
this.obj.onclick = function(e){(e||event).cancelBubble = true}
|
||||
this.obj.onmousedown = function(e){(e||event).cancelBubble = true}
|
||||
this.obj.value = this.val
|
||||
this.cell.innerHTML = "";
|
||||
this.cell.appendChild(this.obj);
|
||||
if (_isFF) {
|
||||
this.obj.style.overflow="visible";
|
||||
if ((this.grid.multiLine)&&(this.obj.offsetHeight>=18)&&(this.obj.offsetHeight<40)){
|
||||
this.obj.style.height="36px";
|
||||
this.obj.style.overflow="scroll";
|
||||
}
|
||||
}
|
||||
|
||||
this.obj.onkeypress =function(e){
|
||||
if(this.value.length>=15){
|
||||
return false
|
||||
}
|
||||
}
|
||||
this.obj.onselectstart=function(e){ if (!e) e=event; e.cancelBubble=true; return true; };
|
||||
this.obj.focus()
|
||||
this.obj.focus()
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.getValue = function(){
|
||||
if ((this.cell.firstChild)&&((this.cell.atag)&&(this.cell.firstChild.tagName==this.cell.atag)))
|
||||
return this.cell.firstChild.value;
|
||||
else
|
||||
return this.cell.innerHTML.toString()._dhx_trim();
|
||||
}
|
||||
this.setValue = function(val){
|
||||
if(val.length > 15) this.cell.innerHTML = val.substring(0,14)
|
||||
else this.cell.innerHTML = val
|
||||
|
||||
|
||||
}
|
||||
|
||||
this.detach = function(){
|
||||
this.setValue(this.obj.value);
|
||||
return this.val!=this.getValue();
|
||||
}
|
||||
|
||||
}
|
||||
eXcell_limit.prototype = new eXcell;
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
@ -0,0 +1,78 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
HTML Link eXcell v.1.0 for dhtmlxGrid
|
||||
(c)DHTMLX LTD. 2005
|
||||
|
||||
|
||||
The corresponding cell value in XML should be a "^" delimited list of following values:
|
||||
1st - Link Text
|
||||
2nd - URL (optional)
|
||||
3rd - target (optional, default is _blank)
|
||||
|
||||
Samples:
|
||||
<cell>Stephen King</cell>
|
||||
<cell>Stephen King^http://www.stephenking.com/</cell>
|
||||
<cell>Stephen King^http://www.stephenking.com/^_self</cell>
|
||||
*/
|
||||
|
||||
/**
|
||||
* @desc: link editor
|
||||
* @returns: dhtmlxGrid cell editor object
|
||||
* @type: public
|
||||
*/
|
||||
|
||||
function eXcell_link(cell){
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
this.isDisabled=function(){return true;}
|
||||
this.edit = function(){}
|
||||
this.getValue = function(){
|
||||
if(this.cell.firstChild.getAttribute){
|
||||
var target = this.cell.firstChild.getAttribute("target")
|
||||
return this.cell.firstChild.innerHTML+"^"+this.cell.firstChild.getAttribute("href")+(target?("^"+target):"");
|
||||
}
|
||||
|
||||
else
|
||||
return "";
|
||||
}
|
||||
this.setValue = function(val){
|
||||
if((typeof(val)!="number") && (!val || val.toString()._dhx_trim()=="")){
|
||||
this.setCValue(" ",valsAr);
|
||||
return (this.cell._clearCell=true);
|
||||
}
|
||||
var valsAr = val.split("^");
|
||||
if(valsAr.length==1)
|
||||
valsAr[1] = "";
|
||||
else{
|
||||
if(valsAr.length>1){
|
||||
valsAr[1] = "href='"+valsAr[1]+"'";
|
||||
if(valsAr.length==3)
|
||||
valsAr[1]+= " target='"+valsAr[2]+"'";
|
||||
else
|
||||
valsAr[1]+= " target='_blank'";
|
||||
}
|
||||
}
|
||||
|
||||
this.setCValue("<a "+valsAr[1]+" onclick='(_isIE?event:arguments[0]).cancelBubble = true;'>"+valsAr[0]+"</a>",valsAr);
|
||||
}
|
||||
}
|
||||
|
||||
eXcell_link.prototype = new eXcell;
|
||||
eXcell_link.prototype.getTitle=function(){
|
||||
var z=this.cell.firstChild;
|
||||
return ((z&&z.tagName)?z.getAttribute("href"):"");
|
||||
}
|
||||
eXcell_link.prototype.getContent=function(){
|
||||
var z=this.cell.firstChild;
|
||||
return ((z&&z.tagName)?z.innerHTML:"");
|
||||
}
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
|
||||
@ -0,0 +1,74 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
function eXcell_liveedit(cell)
|
||||
{
|
||||
if (cell) {
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
}
|
||||
|
||||
this.edit = function()
|
||||
{
|
||||
this.cell.inputObj.focus();
|
||||
this.cell.inputObj.focus();
|
||||
}
|
||||
|
||||
this.detach = function()
|
||||
{
|
||||
this.setValue(this.cell.inputObj.value); }
|
||||
|
||||
this.getValue = function()
|
||||
{
|
||||
return this.cell.inputObj ? this.cell.inputObj.value : '';
|
||||
}
|
||||
this.destructor = function() {}
|
||||
|
||||
this.onFocus = function()
|
||||
{
|
||||
var res = this.grid.callEvent('onEditCell', [0, this.cell.parentNode.idd, this.cell._cellIndex]);
|
||||
if (res === false)
|
||||
this.cell.inputObj.blur();
|
||||
}
|
||||
|
||||
this.onBlur = function()
|
||||
{
|
||||
var res = this.grid.callEvent('onEditCell', [2, this.cell.parentNode.idd, this.cell._cellIndex]);
|
||||
this.detach();
|
||||
}
|
||||
|
||||
this.onChange = function()
|
||||
{
|
||||
var res = this.grid.callEvent( "onCellChanged", [this.cell.parentNode.idd, this.cell._cellIndex, this.cell.inputObj.value] );
|
||||
this.detach();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
eXcell_liveedit.prototype = new eXcell_ed;
|
||||
eXcell_liveedit.prototype.setValue = function(val)
|
||||
{
|
||||
var self = this;
|
||||
this.cell.innerHTML = '<input type="text" value="" style="width:100%;" />';
|
||||
|
||||
this.cell.inputObj = this.cell.firstChild;
|
||||
this.cell.inputObj = this.cell.firstChild;
|
||||
// this.inputObj.style.border = '1px solid ';
|
||||
this.cell.inputObj.value = val;
|
||||
this.cell.inputObj.onfocus = function() {self.onFocus()}
|
||||
|
||||
|
||||
this.cell.inputObj.onblur = function() {self.onFocus()}
|
||||
this.cell.inputObj.onchange = function() {self.onChange()}
|
||||
}
|
||||
if (window.eXcell_math){
|
||||
eXcell_liveedit.prototype.setValueA=eXcell_liveedit.prototype.setValue;
|
||||
eXcell_liveedit.prototype.setValue=eXcell_math.prototype._NsetValue;
|
||||
}
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
@ -0,0 +1,33 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
|
||||
//readonly
|
||||
function eXcell_mro(cell){
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
this.edit = function(){}
|
||||
}
|
||||
eXcell_mro.prototype = new eXcell;
|
||||
eXcell_mro.prototype.getValue = function(){
|
||||
return this.cell.childNodes[0].innerHTML._dhx_trim();//innerText;
|
||||
}
|
||||
eXcell_mro.prototype.setValue = function(val){
|
||||
if (!this.cell.childNodes.length){
|
||||
this.cell.style.whiteSpace='normal';
|
||||
this.cell.innerHTML="<div style='height:100%; white-space:nowrap; overflow:hidden;'></div>";
|
||||
}
|
||||
|
||||
if(!val || val.toString()._dhx_trim()=="")
|
||||
val=" "
|
||||
this.cell.childNodes[0].innerHTML = val;
|
||||
}
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
function eXcell_num(cell){
|
||||
try{
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
}catch(er){}
|
||||
this.edit = function(){
|
||||
this.val = this.getValue();
|
||||
this.obj = document.createElement(_isKHTML?"INPUT":"TEXTAREA");
|
||||
this.obj.className="dhx_combo_edit";
|
||||
this.obj.style.height = (this.cell.offsetHeight-4)+"px";
|
||||
this.obj.wrap = "soft";
|
||||
this.obj.style.textAlign = this.cell.align;
|
||||
this.obj.onclick = function(e){(e||event).cancelBubble = true}
|
||||
this.obj.value = this.val;
|
||||
this.cell.innerHTML = "";
|
||||
this.cell.appendChild(this.obj);
|
||||
this.obj.onselectstart=function(e){ if (!e) e=event; e.cancelBubble=true; return true; };
|
||||
this.obj.focus()
|
||||
this.obj.focus()
|
||||
}
|
||||
this.getValue = function(){
|
||||
|
||||
if ((this.cell.firstChild)&&(this.cell.firstChild.tagName=="TEXTAREA"))
|
||||
return this.cell.firstChild.value;
|
||||
else
|
||||
return this.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(),this.cell._cellIndex);
|
||||
}
|
||||
this.setValue = function(val){
|
||||
var re = new RegExp("[a-z]|[A-Z]","i")
|
||||
if(val.match(re)) val = " ";
|
||||
|
||||
this.cell.innerHTML = val;
|
||||
|
||||
}
|
||||
|
||||
this.detach = function(){
|
||||
var tv=this.obj.value;
|
||||
this.setValue(tv);
|
||||
return this.val!=this.getValue();
|
||||
}
|
||||
}
|
||||
eXcell_num.prototype = new eXcell;
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
@ -0,0 +1,62 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
function eXcell_passw(cell){
|
||||
|
||||
if (cell){
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
}
|
||||
|
||||
this.edit = function(){
|
||||
this.cell.innerHTML = "";
|
||||
this.cell.atag="INPUT";
|
||||
this.val = this.getValue();
|
||||
this.obj = document.createElement(this.cell.atag);
|
||||
this.obj.style.height = (this.cell.offsetHeight-(_isIE?6:4))+"px";
|
||||
this.obj.className="dhx_combo_edit";
|
||||
this.obj.type = "password";
|
||||
this.obj.wrap = "soft";
|
||||
this.obj.style.textAlign = this.cell.align;
|
||||
this.obj.onclick = function(e){(e||event).cancelBubble = true}
|
||||
this.obj.onmousedown = function(e){(e||event).cancelBubble = true}
|
||||
this.obj.value = this.cell._rval||"";
|
||||
this.cell.appendChild(this.obj);
|
||||
if (_isFF) {
|
||||
this.obj.style.overflow="visible";
|
||||
if ((this.grid.multiLine)&&(this.obj.offsetHeight>=18)&&(this.obj.offsetHeight<40)){
|
||||
this.obj.style.height="36px";
|
||||
this.obj.style.overflow="scroll";
|
||||
}
|
||||
}
|
||||
this.obj.onselectstart=function(e){ if (!e) e=event; e.cancelBubble=true; return true; };
|
||||
this.obj.focus()
|
||||
this.obj.focus()
|
||||
|
||||
|
||||
|
||||
}
|
||||
this.getValue = function(){
|
||||
return this.cell._rval;
|
||||
}
|
||||
this.setValue = function(val){
|
||||
var str = "*****";
|
||||
this.cell.innerHTML = str;
|
||||
this.cell._rval=val;
|
||||
|
||||
|
||||
}
|
||||
|
||||
this.detach = function(){
|
||||
this.setValue(this.obj.value);
|
||||
return this.val!=this.getValue();
|
||||
}
|
||||
|
||||
}
|
||||
eXcell_passw.prototype = new eXcell;
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
@ -0,0 +1,46 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
/**
|
||||
* @desc: radio editor
|
||||
* @returns: dhtmlxGrid cell editor object
|
||||
* @type: public
|
||||
*/
|
||||
function eXcell_ra_str(cell){
|
||||
if (cell){
|
||||
this.base = eXcell_ra;
|
||||
this.base(cell)
|
||||
this.grid = cell.parentNode.grid;
|
||||
}
|
||||
}
|
||||
eXcell_ra_str.prototype = new eXcell_ch;
|
||||
eXcell_ra_str.prototype.setValue = function(val){
|
||||
this.cell.style.verticalAlign = "middle";//nb:to center checkbox in line
|
||||
if (val){
|
||||
val=val.toString()._dhx_trim();
|
||||
if ((val=="false")||(val=="0")) val="";
|
||||
}
|
||||
if(val){
|
||||
if (this.grid.rowsAr[this.cell.parentNode.idd])
|
||||
for (var i=0;i<this.grid._cCount;i++) {
|
||||
if (i!==this.cell._cellIndex) {
|
||||
var cell = this.grid.cells(this.cell.parentNode.idd,i);
|
||||
if ((cell.cell._cellType||this.grid.cellType[cell.cell._cellIndex])!="ra_str") continue;
|
||||
if (cell.getValue())
|
||||
cell.setValue("0");
|
||||
}
|
||||
}
|
||||
val = "1";
|
||||
this.cell.chstate = "1";
|
||||
}else{
|
||||
val = "0";
|
||||
this.cell.chstate = "0"
|
||||
}
|
||||
this.setCValue("<img src='"+this.grid.imgURL+"radio_chk"+val+".gif' onclick='new eXcell_ra_str(this.parentNode).changeState()'>",this.cell.chstate);
|
||||
}
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
@ -0,0 +1,306 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
function eXcell_sub_row(cell){
|
||||
if (cell){
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
}
|
||||
|
||||
this.getValue = function(){
|
||||
return this.grid.getUserData(this.cell.parentNode.idd,"__sub_row");
|
||||
}
|
||||
this._setState = function(m,v){
|
||||
(v||this.cell).innerHTML="<img src='"+this.grid.imgURL+m+"' width='18' height='18' />";
|
||||
(v||this.cell).firstChild.onclick=this.grid._expandMonolite;
|
||||
}
|
||||
this.open = function (){
|
||||
this.cell.firstChild.onclick(null,true)
|
||||
}
|
||||
this.close = function (){
|
||||
this.cell.firstChild.onclick(null,false,true)
|
||||
}
|
||||
this.isOpen = function(){
|
||||
return !!this.cell.parentNode._expanded;
|
||||
}
|
||||
this.setValue = function(val){
|
||||
if (val)
|
||||
this.grid.setUserData(this.cell.parentNode.idd,"__sub_row",val);
|
||||
this._setState(val?"plus.gif":"blank.gif");
|
||||
}
|
||||
this.setContent = function(val){
|
||||
if (this.cell.parentNode._expanded){
|
||||
this.cell.parentNode._expanded.innerHTML=val;
|
||||
this.resize();
|
||||
}
|
||||
else{
|
||||
this.cell._previous_content=null;
|
||||
this.setValue(val);
|
||||
this.cell._sub_row_type=null
|
||||
}
|
||||
|
||||
}
|
||||
this.resize = function(){
|
||||
this.grid._detectHeight(this.cell.parentNode._expanded,this.cell,this.cell.parentNode._expanded.scrollHeight);
|
||||
},
|
||||
this.isDisabled = function(){ return true; }
|
||||
this.getTitle = function(){ return this.grid.getUserData(this.cell.parentNode.idd,"__sub_row")?"click to expand|collapse":""; }
|
||||
}
|
||||
eXcell_sub_row.prototype = new eXcell;
|
||||
|
||||
function eXcell_sub_row_ajax(cell){
|
||||
this.base=eXcell_sub_row;
|
||||
this.base(cell);
|
||||
|
||||
this.setValue = function(val){
|
||||
if (val)
|
||||
this.grid.setUserData(this.cell.parentNode.idd,"__sub_row",val);
|
||||
this.cell._sub_row_type="ajax";
|
||||
this.cell._previous_content = null;
|
||||
this._setState(val?"plus.gif":"blank.gif");
|
||||
}
|
||||
}
|
||||
eXcell_sub_row_ajax.prototype = new eXcell_sub_row;
|
||||
|
||||
function eXcell_sub_row_grid(cell){
|
||||
this.base=eXcell_sub_row;
|
||||
this.base(cell);
|
||||
|
||||
this.setValue = function(val){
|
||||
if (val)
|
||||
this.grid.setUserData(this.cell.parentNode.idd,"__sub_row",val);
|
||||
this.cell._sub_row_type="grid";
|
||||
this._setState(val?"plus.gif":"blank.gif");
|
||||
}
|
||||
this.getSubGrid = function(){
|
||||
if (!cell._sub_grid) return null;
|
||||
return cell._sub_grid;
|
||||
}
|
||||
}
|
||||
eXcell_sub_row_grid.prototype = new eXcell_sub_row;
|
||||
|
||||
dhtmlXGridObject.prototype._expandMonolite=function(n,show,hide){
|
||||
var td=this.parentNode;
|
||||
var row=td.parentNode;
|
||||
var that=row.grid;
|
||||
|
||||
if (n||window.event){
|
||||
if (!hide && !row._expanded) that.editStop();
|
||||
(n||event).cancelBubble=true;
|
||||
}
|
||||
|
||||
var c=that.getUserData(row.idd,"__sub_row");
|
||||
|
||||
if (!that._sub_row_editor)
|
||||
that._sub_row_editor=new eXcell_sub_row(td);
|
||||
|
||||
if (!c) return;
|
||||
|
||||
if (row._expanded && !show){
|
||||
that._sub_row_editor._setState("plus.gif",td);
|
||||
td._previous_content=row._expanded;
|
||||
that.objBox.removeChild(row._expanded);
|
||||
row._expanded=false;
|
||||
row.style.height=(row.oldHeight||20)+"px";
|
||||
td.style.height=(row.oldHeight||20)+"px";
|
||||
|
||||
if (that._fake){
|
||||
that._fake.rowsAr[row.idd].style.height=(row.oldHeight||20)+"px";
|
||||
that._fake.rowsAr[row.idd].firstChild.style.height=(row.oldHeight||20)+"px";
|
||||
}
|
||||
|
||||
for (var i=0; i<row.cells.length; i++)
|
||||
row.cells[i].style.verticalAlign="middle";
|
||||
|
||||
delete that._flow[row.idd];
|
||||
that._correctMonolite();
|
||||
row._expanded.ctrl=null;
|
||||
}else if (!row._expanded && !hide){
|
||||
that._sub_row_editor._setState("minus.gif",td);
|
||||
row.oldHeight=td.offsetHeight-4;
|
||||
if (td._previous_content){
|
||||
var d=td._previous_content;
|
||||
d.ctrl=td;
|
||||
that.objBox.appendChild(d);
|
||||
that._detectHeight(d,td,parseInt(d.style.height))
|
||||
}
|
||||
else {
|
||||
var d=document.createElement("DIV");
|
||||
d.ctrl=td;
|
||||
if (td._sub_row_type)
|
||||
that._sub_row_render[td._sub_row_type](that,d,td,c);
|
||||
else
|
||||
d.innerHTML=c;
|
||||
d.style.cssText="position:absolute; left:0px; top:0px; overflow:auto; font-family:Tahoma; font-size:8pt; margin-top:2px; margin-left:4px;";
|
||||
d.className="dhx_sub_row";
|
||||
that.objBox.appendChild(d);
|
||||
that._detectHeight(d,td)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (!that._flow) {
|
||||
that.attachEvent("onGridReconstructed",function(){
|
||||
if ((this.pagingOn && !this.parentGrid) || this._srnd) this._collapsMonolite();
|
||||
else this._correctMonolite();
|
||||
});
|
||||
that.attachEvent("onResizeEnd",function(){ this._correctMonolite(true); });
|
||||
that.attachEvent("onAfterCMove",function(){ this._correctMonolite(true); });
|
||||
that.attachEvent("onDrop",function(){ this._correctMonolite(true); });
|
||||
that.attachEvent("onBeforePageChanged",function(){ this._collapsMonolite(); return true; });
|
||||
that.attachEvent("onGroupStateChanged",function(){ this._correctMonolite(); return true; });
|
||||
that.attachEvent("onFilterEnd",function(){ this._collapsMonolite(); });
|
||||
that.attachEvent("onUnGroup",function(){ this._collapsMonolite(); });
|
||||
that.attachEvent("onPageChanged",function(){ this._collapsMonolite(); });
|
||||
|
||||
that.attachEvent("onXLE",function(){ this._collapsMonolite(); });
|
||||
that.attachEvent("onClearAll",function(){ for (var i in this._flow) {
|
||||
if (this._flow[i] && this._flow[i].parentNode) this._flow[i].parentNode.removeChild(this._flow[i]);
|
||||
}; this._flow=[]; });
|
||||
that.attachEvent("onEditCell",function(a,b,c){ if ((a!==2) && this._flow[b] && this.cellType[c]!="ch" && this.cellType[c]!="ra") this._expandMonolite.apply(this._flow[b].ctrl.firstChild,[0,false,true]); return true; });
|
||||
that.attachEvent("onCellChanged",function(id,ind){ if (!this._flow[id]) return;
|
||||
var c=this.cells(id,ind).cell;
|
||||
c.style.verticalAlign="top";
|
||||
});
|
||||
|
||||
that._flow=[];
|
||||
}
|
||||
that._flow[row.idd]=d;
|
||||
that._correctMonolite();
|
||||
//d.style.top=row.offsetTop+20+"px";
|
||||
|
||||
var padtop = that._srdh > 30 ? 11:3;
|
||||
if (that.multiLine) padtop = 0;
|
||||
|
||||
for (var i=0; i<row.cells.length; i++)
|
||||
row.cells[i].style.verticalAlign="top";
|
||||
if (that._fake){
|
||||
var frow=that._fake.rowsAr[row.idd];
|
||||
for (var i=0; i<frow.cells.length; i++){
|
||||
frow.cells[i].style.verticalAlign="top";
|
||||
}
|
||||
}
|
||||
row._expanded=d;
|
||||
}
|
||||
if (that._ahgr)
|
||||
that.setSizes()
|
||||
if (that.parentGrid)
|
||||
that.callEvent("onGridReconstructed",[]);
|
||||
that.callEvent("onSubRowOpen",[row.idd,(!!row._expanded)]);
|
||||
}
|
||||
dhtmlXGridObject.prototype._sub_row_render={
|
||||
"ajax":function(that,d,td,c){
|
||||
d.innerHTML="Loading...";
|
||||
//d.innerHTML=that.i18n.loading;
|
||||
dhx4.ajax.get(c, function(xml){
|
||||
d.innerHTML=xml.xmlDoc.responseText;
|
||||
var z=xml.xmlDoc.responseText.match(/<script[^>]*>([^\f]+?)<\/script>/g);
|
||||
if (z)
|
||||
for (var i=0; i<z.length; i++)
|
||||
eval(z[i].replace(/<([\/]{0,1})s[^>]*>/g,""));
|
||||
|
||||
that._detectHeight(d,td)
|
||||
that._correctMonolite();
|
||||
that.setUserData(td.parentNode.idd,"__sub_row",xml.xmlDoc.responseText);
|
||||
td._sub_row_type=null;
|
||||
if (that._ahgr)
|
||||
that.setSizes()
|
||||
that.callEvent("onSubAjaxLoad",[td.parentNode.idd,xml.xmlDoc.responseText]);
|
||||
});
|
||||
},
|
||||
"grid":function(that,d,td,c){
|
||||
td._sub_grid= new dhtmlXGridObject(d);
|
||||
if (that.skin_name)
|
||||
td._sub_grid.setSkin(that.skin_name);
|
||||
|
||||
td._sub_grid.parentGrid=that;
|
||||
td._sub_grid.setImagePath(that._imgURL);
|
||||
td._sub_grid.iconURL = that.iconURL;
|
||||
td._sub_grid.enableAutoHeight(true);
|
||||
td._sub_grid._delta_x = td._sub_grid._delta_y = null;
|
||||
td._sub_grid.attachEvent("onGridReconstructed",function(){
|
||||
that._detectHeight(d,td,td._sub_grid.objBox.scrollHeight+td._sub_grid.hdr.offsetHeight+(this.ftr?this.ftr.offsetHeight:0));
|
||||
that._correctMonolite();
|
||||
this.setSizes();
|
||||
if (that.parentGrid) that.callEvent("onGridReconstructed",[]);
|
||||
})
|
||||
if (!that.callEvent("onSubGridCreated",[td._sub_grid,td.parentNode.idd,td._cellIndex,c])){
|
||||
td._sub_grid.objBox.style.overflow="hidden";
|
||||
td._sub_row_type=null;
|
||||
} else {
|
||||
td._sub_grid.load(c,function(){
|
||||
that._detectHeight(d,td,td._sub_grid.objBox.scrollHeight+td._sub_grid.hdr.offsetHeight+(td._sub_grid.ftr?td._sub_grid.ftr.offsetHeight:0));
|
||||
td._sub_grid.objBox.style.overflow="hidden";
|
||||
that._correctMonolite();
|
||||
td._sub_row_type=null;
|
||||
if (!that.callEvent("onSubGridLoaded",[td._sub_grid,td.parentNode.idd,td._cellIndex,c])) return;
|
||||
if (that._ahgr) that.setSizes();
|
||||
if (that.parentGrid) that.callEvent("onGridReconstructed",[]);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dhtmlXGridObject.prototype._detectHeight=function(d,td,h){
|
||||
var l=td.offsetLeft+td.offsetWidth;
|
||||
d.style.left=l+"px";
|
||||
d.style.width=Math.max(0,td.parentNode.offsetWidth-l-4)+"px"
|
||||
var h=h||d.scrollHeight;
|
||||
d.style.overflow="hidden";
|
||||
d.style.height=h+"px";
|
||||
var row=td.parentNode;
|
||||
td.parentNode.style.height=(row.oldHeight||20)+h*1+"px";
|
||||
td.style.height=(row.oldHeight||20)+h*1+"px";
|
||||
if (this._fake){
|
||||
var tr=this._fake.rowsAr[td.parentNode.idd];
|
||||
tr.style.height=(row.oldHeight||20)+h*1+"px";
|
||||
tr.firstChild.style.height=(row.oldHeight||20)+h*1+"px";
|
||||
}
|
||||
}
|
||||
dhtmlXGridObject.prototype._correctMonolite=function(mode){
|
||||
if (this._in_correction) return;
|
||||
this._in_correction=true;
|
||||
|
||||
for (var a in this._flow)
|
||||
if (this._flow[a] && this._flow[a].tagName=="DIV")
|
||||
if (this.rowsAr[a]){
|
||||
if (this.rowsAr[a].style.display=="none") {
|
||||
this.cells4(this._flow[a].ctrl).close();
|
||||
continue;
|
||||
}
|
||||
this._flow[a].style.top=this.rowsAr[a].offsetTop+(this.rowsAr[a].oldHeight||20)+"px";
|
||||
if (mode) {
|
||||
var l=this._flow[a].ctrl.offsetLeft+this._flow[a].ctrl.offsetWidth;
|
||||
this._flow[a].style.left=l+"px";
|
||||
this._flow[a].style.width=this.rowsAr[a].offsetWidth-l-4+"px"
|
||||
}
|
||||
}
|
||||
else{
|
||||
this._flow[a].ctrl=null;
|
||||
this.objBox.removeChild(this._flow[a]);
|
||||
delete this._flow[a];
|
||||
}
|
||||
|
||||
this._in_correction=false;
|
||||
}
|
||||
dhtmlXGridObject.prototype._collapsMonolite=function(){
|
||||
for (var a in this._flow){
|
||||
var line = this._flow[a];
|
||||
if (line && line.tagName=="DIV")
|
||||
if (this.rowsAr[a])
|
||||
this.cells4(line.ctrl).close();
|
||||
else if (line.parentNode){
|
||||
line.parentNode.removeChild(line);
|
||||
delete this._flow[a];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
|
||||
@ -0,0 +1,75 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
function eXcell_time(cell){
|
||||
|
||||
this.base = eXcell_ed;
|
||||
this.base(cell)
|
||||
this.getValue = function(){
|
||||
return this.cell.innerHTML.toString();
|
||||
}
|
||||
this.setValue = function(val){
|
||||
var re = new RegExp(" ","i")
|
||||
val = val.replace(re,":")
|
||||
if((val=="")) val = "00:00"
|
||||
else
|
||||
{
|
||||
var re = new RegExp("[a-zA-Z]","i")
|
||||
var res = val.match(re)
|
||||
|
||||
if(res) val = "00:00";
|
||||
else{
|
||||
var re = new RegExp("[0-9]+[\\.\\/;\\-,_\\]\\[\\?\\: ][0-9]+","i")
|
||||
var res = val.search(re)
|
||||
if(res!=-1){
|
||||
var re = new RegExp("[\\./\\;\\-\\,\\_\\]\\[ \\?]","i")
|
||||
val = val.replace(re,":")
|
||||
}
|
||||
else
|
||||
{
|
||||
var re = new RegExp("[^0-9]","i")
|
||||
res1 = val.search(re)
|
||||
if(res = val.match(re) ) { val = "00:00";}
|
||||
else
|
||||
{
|
||||
if(val.length == 1)
|
||||
{
|
||||
val = "00:0"+val;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(parseInt(val) < 60) val = "00:"+val;
|
||||
else
|
||||
if(val.length < 5)
|
||||
{
|
||||
var minutes = parseInt(val);
|
||||
var hours = Math.floor(minutes/60);
|
||||
minutes = minutes - 60*hours;
|
||||
var hours = hours.toString();
|
||||
var minutes = minutes.toString();
|
||||
while(hours.length < 2){
|
||||
hours = "0" + hours;
|
||||
}
|
||||
while(minutes.length < 2){
|
||||
minutes = "0" + minutes;
|
||||
}
|
||||
val = hours+":"+minutes;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
this.cell.innerHTML = val;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
eXcell_time.prototype = new eXcell_ed;
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
@ -0,0 +1,70 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
|
||||
function eXcell_stree(cell){
|
||||
if (cell){
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
|
||||
if (!this.grid._sub_trees) return;
|
||||
this._sub=this.grid._sub_trees[cell._cellIndex];
|
||||
if (!this._sub) return;
|
||||
this._sub=this._sub[0];
|
||||
}
|
||||
|
||||
this.getValue = function(){
|
||||
return this.cell._val;
|
||||
}
|
||||
this.setValue = function(val){
|
||||
this.cell._val=val;
|
||||
val = this._sub.getItemText(this.cell._val);
|
||||
this.setCValue((val||" "),val);
|
||||
}
|
||||
this.edit = function(){
|
||||
this._sub.parentObject.style.display='block';
|
||||
var arPos = this.grid.getPosition(this.cell);//,this.grid.objBox
|
||||
this._sub.parentObject.style.top=arPos[1]+"px";
|
||||
this._sub.parentObject.style.left=arPos[0]+"px";
|
||||
this._sub.parentObject.style.position="absolute";
|
||||
|
||||
var a=this.grid.editStop;
|
||||
this.grid.editStop=function(){};
|
||||
|
||||
this.grid.editStop=a;
|
||||
}
|
||||
this.detach=function(){
|
||||
this._sub.parentObject.style.display='none';
|
||||
if (this.grid._sub_id != null) {
|
||||
var old=this.cell._val;
|
||||
this.setValue(this._sub.getSelectedItemId());
|
||||
this.grid._sub_id = null;
|
||||
return this.cell._val!=old;
|
||||
}
|
||||
}
|
||||
}
|
||||
eXcell_stree.prototype = new eXcell;
|
||||
|
||||
|
||||
dhtmlXGridObject.prototype.setSubTree=function(tree,s_index){
|
||||
if (!this._sub_trees)
|
||||
this._sub_trees=[];
|
||||
this._sub_trees[s_index]=[tree];
|
||||
tree.parentObject.style.display="none";
|
||||
var that=this;
|
||||
tree.parentObject.onclick = function(event) {(event || window.event).cancelBubble = true;return false;}
|
||||
tree.ev_onDblClick=null;
|
||||
tree.attachEvent("onDblClick",function(id){
|
||||
that._sub_id = id;
|
||||
that.editStop();
|
||||
return true;
|
||||
});
|
||||
tree._chRRS=true;
|
||||
};
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
|
||||
@ -0,0 +1,87 @@
|
||||
/*
|
||||
Product Name: dhtmlxSuite
|
||||
Version: 5.2.0
|
||||
Edition: Professional
|
||||
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
|
||||
Copyright UAB Dinamenta http://www.dhtmlx.com
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
Textfield with Button eXcell v.1.0 for dhtmlxGrid
|
||||
(c)DHTMLX LTD. 2005
|
||||
|
||||
|
||||
The corresponding cell value in XML should be
|
||||
|
||||
Samples:
|
||||
|
||||
<cell>IN637237-23</cell>
|
||||
<cell>158</cell>
|
||||
*/
|
||||
|
||||
|
||||
function eXcell_wbut(cell){
|
||||
this.cell = cell;
|
||||
this.grid = this.cell.parentNode.grid;
|
||||
this.edit = function(){
|
||||
var val = this.getValue().toString();
|
||||
this.obj = document.createElement("INPUT");
|
||||
this.obj.readOnly = true;
|
||||
this.obj.style.width = "60px";
|
||||
this.obj.style.height = (this.cell.offsetHeight-(this.grid.multiLine?5:4))+"px";
|
||||
this.obj.style.border = "0px";
|
||||
this.obj.style.margin = "0px";
|
||||
this.obj.style.padding = "0px";
|
||||
this.obj.style.overflow = "hidden";
|
||||
this.obj.style.fontSize = _isKHTML?"10px":"12px";
|
||||
this.obj.style.fontFamily = "Arial";
|
||||
this.obj.wrap = "soft";
|
||||
this.obj.style.textAlign = this.cell.align;
|
||||
this.obj.onclick = function(e){(e||event).cancelBubble = true}
|
||||
this.cell.innerHTML = "";
|
||||
this.cell.appendChild(this.obj);
|
||||
this.obj.onselectstart=function(e){ if (!e) e=event; e.cancelBubble=true; return true; };
|
||||
this.obj.style.textAlign = this.cell.align;
|
||||
this.obj.value=val;
|
||||
this.obj.focus()
|
||||
this.obj.focus()
|
||||
this.cell.appendChild(document.createTextNode(" ")); // Create space between text box and button
|
||||
var butElem = document.createElement('input'); // This is the button DOM code
|
||||
if(_isIE){
|
||||
butElem.style.height = (this.cell.offsetHeight-(this.grid.multiLine?5:4))+"px";
|
||||
butElem.style.lineHeight = "5px";
|
||||
}else{
|
||||
butElem.style.fontSize = "8px";
|
||||
butElem.style.width = "10px";
|
||||
butElem.style.marginTop = "-5px"
|
||||
}
|
||||
|
||||
butElem.type='button'
|
||||
butElem.name='Lookup'
|
||||
butElem.value='...'
|
||||
var inObj = this.obj;
|
||||
var inCellIndex = this.cell.cellIndex
|
||||
var inRowId = this.cell.parentNode.idd
|
||||
var inGrid = this.grid
|
||||
var inCell = this;
|
||||
this.dhx_m_func=this.grid.getWButFunction(this.cell._cellIndex);
|
||||
butElem.onclick = function (e){inCell.dhx_m_func(inCell,inCell.cell.parentNode.idd,inCell.cell._cellIndex,val)};
|
||||
this.cell.appendChild(butElem);
|
||||
}
|
||||
this.detach = function(){
|
||||
this.setValue(this.obj.value);
|
||||
return this.val!=this.getValue();
|
||||
}
|
||||
}
|
||||
eXcell_wbut.prototype = new eXcell;
|
||||
|
||||
dhtmlXGridObject.prototype.getWButFunction=function(index){
|
||||
if (this._wbtfna) return this._wbtfna[index];
|
||||
else return (function(){});
|
||||
}
|
||||
dhtmlXGridObject.prototype.setWButFunction=function(index,func){
|
||||
if (!this._wbtfna) this._wbtfna=new Array();
|
||||
this._wbtfna[index]=func;
|
||||
}
|
||||
//(c)dhtmlx ltd. www.dhtmlx.com
|
||||
Reference in New Issue
Block a user