Add Del Rows

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Add Del Rows as PDF for free.

More details

  • Words: 375
  • Pages: 5
function addrow(len) { var tbl = document.getelementbyid('dynamictable'); var lastrow = tbl.rows.length; var iteration = lastrow; var row; var post_fix=new array('fabric_no' , 'size' ,'color_name', 'rollqty', 'meter', 'unit_price', 'jpn_yen','amt_percentage', 'amount', 'remark'); if(document.forms[0].colno.value=="")

{

document.forms[0].colno.value= len; } else { len=document.forms[0].colno.value } var row = tbl.insertrow(lastrow); row.id=iteration;

for(var i=0;i
el.onfocus= setvalue; cellright.appendchild(el); } } } function setvalue( obj) { var rowid; if (obj != null) { rowid = obj.id2; } else { rowid = this.id2; } // alert(rowid); var no=rowid.substring(6,rowid.indexof("_")); // alert("==================="+no); no=( no * 1 ) - 1 ; document.forms[0].rowno.value= no; }

function delrow() { var tbl = document.getelementbyid('dynamictable'); var lastrow = tbl.rows.length; if(lastrow==2) { tbl.deleterow(); return ; } var col_no=document.forms[0].colno.value; var row_no=document.forms[0].rowno.value var post_fix=new array('fabric_no', 'size' ,'color_name', 'rollqty', 'meter', 'unit_price', 'jpn_yen','amt_percentage', 'amount', 'remark'); if((row_no*1)>=((lastrow*1)-1)) { alert("no down row exist"); return false; } var up_row_no=row_no; var down_row_no=((lastrow * 1)- 2);

for(var i=0;i<post_fix.length;i++) { var component_up='txt_'+post_fix[i]+"["+row_no+"]"; var component_down='txt_'+post_fix[i]+"["+down_row_no+"]"; var down=eval("document.forms[0]."+component_down); var up=eval("document.forms[0]."+component_up); var tmp=down.value; down.value=up.value; up.value=tmp; } component_up='txt_'+post_fix[1]+"["+row_no+"]"; up=eval("document.forms[0]."+component_up); up.focus(); tbl.deleterow(); var j=0; for( ;j< (lastrow * 1) ;j++) { var tbl = document.getelementbyid('dynamictable'); var lastrow = tbl.rows.length; var col_no=document.forms[0].colno.value; var row_no=document.forms[0].rowno.value var post_fix=new array('fabric_no', 'size' ,'color_name', 'rollqty', 'meter', 'unit_price', 'jpn_yen','amt_percentage', 'amount', 'remark'); if((row_no*1)>=((lastrow*1)-1)) { alert("no down row exist"); return false; } var up_row_no=row_no; var down_row_no=(row_no*1)+1; for(var i=0;i<post_fix.length;i++) { var component_up='txt_'+post_fix[i]+"["+row_no+"]"; var component_down='txt_'+post_fix[i]+"["+down_row_no+"]"; var down=eval("document.forms[0]."+component_down); var up=eval("document.forms[0]."+component_up); var tmp=down.value; down.value=up.value; up.value=tmp;

} component_down='txt_'+post_fix[1]+"["+down_row_no+"]"; down=eval("document.forms[0]."+component_down); down.focus(); alert(j); } }

function downrow() { var tbl = document.getelementbyid('dynamictable'); var lastrow = tbl.rows.length; var col_no=document.forms[0].colno.value; var row_no=document.forms[0].rowno.value var post_fix=new array( 'size' ,'color_name', 'rollqty', 'meter', 'unit_price', 'jpn_yen','amt_percentage', 'amount', 'remark'); if((row_no*1)>=((lastrow*1)-1)) { alert("no down row exist"); return false; } var up_row_no=row_no; var down_row_no=(row_no*1)+1; for(var i=0;i<post_fix.length;i++) { //alert(row_no); var component_up='txt_'+post_fix[i]+"["+row_no+"]"; var component_down='txt_'+post_fix[i]+"["+down_row_no+"]"; //alert(component_up); //alert(component_down); //alert(eval("document.forms[0]."+component_down)); var down=eval("document.forms[0]."+component_down); var up=eval("document.forms[0]."+component_up); var tmp=down.value; //alert("1111"); down.value=up.value; //alert("2222"); up.value=tmp;

//alert("3333"); } component_down='txt_'+post_fix[0]+"["+down_row_no+"]"; down=eval("document.forms[0]."+component_down); down.focus(); }

Related Documents

Add Del Rows
November 2019 4
Perfecting The Rows
May 2020 6
Perl Calc Sum Rows
December 2019 2
Add
October 2019 32
Export Rows Oracle
May 2020 0
Add
June 2020 12