国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

用.Net實現基于CSS的AJAX開發(4)

2024-07-10 13:12:46
字體:
來源:轉載
供稿:網友
  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.getattribute('columnid') || td.cellindex;
   var otr = tr.innerhtml;
   if(tr.rowindex == 1) ...{
   alert("已經是第一行了");
   return false;
   }
   else ...{
   table.moverow(tr.rowindex,tr.rowindex-1);
   this.isodd = true;
   var rows = table.tbodies[0].rows;
  
   // 重新隔行換色
   for (var i=1;i<rows.length;i++) ...{
   if (!this.isodd) ...{
   css.addclasstoelement(rows[i], 'odd');
   } else ...{
   css.removeclassfromelement(rows[i], 'odd');
   }
   this.isodd = !this.isodd;
   }
  
   }
  
   // 實現ajax調用處理上移
   var pars = "pars=";
   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 +"|";
   }
   }
   }
   var pars2 = "&pars2=";
   var uprow = table.rows[tr.rowindex+1];
   for(y=0;y<uprow.cells.length;y++) ...{
   if(!css.elementhasclass(uprow.cells[y],'editbtn')&&!css.elementhasclass(uprow.cells[y],'delbtn')
   &&!css.elementhasclass(uprow.cells[y],'updownbtn')) ...{
   var colid = uprow.cells[y].getattribute('columnid');
   if(uprow.cells[y].firstchild.value!=null) ...{
   pars2 += y +"^"+ uprow.cells[y].firstchild.value +"|";
   }
   else ...{
   pars2 += y +"^"+ uprow.cells[y].innertext +"|";
   }
   }
   }
   pars3 = "&command=moveupdown&callback=afterupdate&table="+table.id;
   new ajax.updater('result','dispatcher.ajax?'+pars+pars2+pars3,...{evalscripts: true});
  
   },



發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 沁源县| 西城区| 石景山区| 肥乡县| 长宁县| 新兴县| 张家口市| 濮阳市| 马鞍山市| 南陵县| 吴堡县| 潢川县| 重庆市| 辛集市| 苏尼特右旗| 巩留县| 嫩江县| 水富县| 滦平县| 贵港市| 准格尔旗| 丰台区| 新蔡县| 雷波县| 东台市| 福泉市| 密山市| 岳阳市| 本溪| 拜泉县| 东阿县| 六枝特区| 石河子市| 剑河县| 涟水县| 吴堡县| 张家口市| 上蔡县| 黔江区| 宁乡县| 伊通|