else
...{
// 如果已经点击了确定
var pars = "pars=";
if(tr.getAttribute('editing')!=0) ...{
td.childNodes[0].removeNode(true);
td.childNodes[0].removeNode(true);
td.childNodes[0].removeNode(true);
var linkEl2 = createElement('a');
linkEl2.href="#";
linkEl2.onclick = that.editRow;
linkEl2.innerText = "修改";
td.appendChild(linkEl2);
for(h=0;h<tr.cells.length;h++) ...{
if(!css.elementHasClass(tr.cells[h],'editbtn')&&!css.elementHasClass(tr.cells[h],'delbtn')
&&!css.elementHasClass(tr.cells[h],'updownbtn')) ...{
var colid = tr.cells[h].getAttribute('columnId');
if(tr.cells[h].firstChild.value!=null)
pars += h +"^"+ tr.cells[h].firstChild.value +"|";
else
pars += h +"^"+ tr.cells[h].innerText +"|";
}
if(!css.elementHasClass(tr.cells[h],'editbtn')&&!css.elementHasClass(tr.cells[h],'delbtn')
&&!css.elementHasClass(tr.cells[h],'updownbtn') &&!css.elementHasClass(tr.cells[h],'noedit')) ...{
tr.cells[h].innerHTML = tr.cells[h].firstChild.value;
}
}
pars = pars.substr(0,pars.length-1);
tr.setAttribute('editing',0);
pars += "&command=editrow&callback=afterUpdate&table="+table.id;
new Ajax.Updater('result','Dispatcher.ajax?'+pars,...{evalScripts: true});
}
}
},
/**//**
* 取消修改
**/
cancelRow : function(e) ...{
var that = crudbtn.that;
var target = getEventTarget(e);
var td = target.parentNode;
var tr = td.parentNode;
var thead = tr.parentNode;
var table = thead.parentNode;
var column = target.getAttribute('columnId') || td.cellIndex;
for(var o=0;o<tr.cells.length-1;o++) ...{
// 如果该列含有修改样式、删除样式或其他类似样式,则忽略该列
if(!css.elementHasClass(tr.cells[o],'editbtn')&&!css.elementHasClass(tr.cells[o],'delbtn')
&&!css.elementHasClass(tr.cells[o],'updownbtn') &&!css.elementHasClass(tr.cells[o],'noedit')) ...{
tr.cells[o].innerHTML = tr.cells[o].firstChild.getAttribute('oldValue');
tr.setAttribute('editing',0);
target.innerText = target.getAttribute('oldValue');
}
}
var linkEl = createElement('a');
linkEl.href = '#';
linkEl.onclick = that.editRow;
td.firstChild.removeNode(true);
td.firstChild.removeNode(true);
td.firstChild.removeNode(true);
var innerEls = td.childNodes;
linkEl.innerText = "修改";
td.appendChild(linkEl);
td.setAttribute('columnId', column);
},
/**//**
* 上移按钮
**/
upRow : function(e) ...{
var that = crudbtn.that;
var linkEl = getEventTarget(e);
var td = linkEl.parentNode;
var tr = td.parentNode;
var thead = tr.parentNode;
var table = thead.parentNode;
// var column = linkEl.getAttribut