ext에서 jspTable 액세스

3028 단어 jspexttable
	Ext.Ajax.request({
												url:__ctxPath+'/medical/getDetailMedicalMedicalPackage.do?typeid='+node.id,
												method:'post',
												success:function(response,options){													
												    var total ;
												    var rowIndex;
													var object=response.responseText;
													var oTBODY  =  Ext.getDom("targetTable").tBodies.item(0);	
											           var oTBODYData = Ext.getDom("sourceTable").tBodies.item(0);
											           eval("var tree = " + object);
														for(var i=0;i<tree.length;i++){
															  var node = tree[i];
															  if (checked) {
															  	  oTBODYData.rows[0].cells[0].innerHTML="<input id = 'deletehidden_"+node.medicalid+"' type= 'hidden' value='"+node.medicalid+"' />";
															  	  oTBODYData.rows[0].cells[1].innerHTML=node.typeparenname;
															  	  oTBODYData.rows[0].cells[2].innerHTML=node.medicalname;
																  oTBODYData.rows[0].cells[3].innerHTML="<input name = 'deleteButton' type= 'checkbox' checked= 'checked' />";//onclick= 'deleteRow(this,\"targetTable\")' 
																  oTBODYData.rows[0].cells[4].innerHTML=node.medicalconter;
																  oTBODYData.rows[0].cells[5].innerHTML=node.manprice;
																  oTBODYData.rows[0].cells[6].innerHTML=node.femaleprice;
																  oTBODYData.rows[0].cells[7].innerHTML=node.otherprice;
																  oTBODY.appendChild(oTBODYData.rows[0].cloneNode(true));
																  oTBODYData.rows[0].cells[0].innerHTML="";
															  }else{
																    total = Ext.getDom("deletehidden_"+node.medicalid);
																    rowIndex = total.parentNode.parentNode;
																    oTBODY.removeChild(rowIndex);
															  }
														}
														var tab = Ext.getDom("targetTable");//$("targetTable");
														var rows=tab.rows;
														var manprice = 0; 
														var femaleprice = 0;
														var otherprice = 0;
														for(var i=0;i<rows.length;i++){
															var cells=rows[i].cells;
															if(i>0){
																manprice = (manprice+parseInt(cells[5].innerHTML));
																femaleprice = (femaleprice+parseInt(cells[6].innerHTML));
																otherprice = (otherprice+parseInt(cells[6].innerHTML));
															}
														}
														 Ext.getDom("manpricetext").value=manprice;
														 Ext.getDom("femalepricetext").value=femaleprice;
														 Ext.getDom("otherpricetext").value=otherprice;
												}
										});

좋은 웹페이지 즐겨찾기