国产探花免费观看_亚洲丰满少妇自慰呻吟_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});
  
   },



發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 西和县| 和平区| 雅安市| 安仁县| 尚义县| 白玉县| 山丹县| 科尔| 宜城市| 翁牛特旗| 海口市| 清徐县| 永顺县| 阿巴嘎旗| 高雄县| 景东| 沧州市| 延庆县| 延安市| 团风县| 朔州市| 年辖:市辖区| 轮台县| 丰城市| 海丰县| 肥东县| 聂荣县| 临漳县| 宁波市| 云安县| 墨脱县| 小金县| 平武县| 宜良县| 赤水市| 阿拉善左旗| 邢台市| 莱芜市| 罗定市| 泸州市| 建水县|