[Vtigercrm-commits] [vtiger-commits] r3977 - /vtigercrm/trunk/include/js/general.js
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue Feb 28 01:08:05 EST 2006
Author: richie
Date: Mon Feb 27 23:08:01 2006
New Revision: 3977
Log:
Added two function "fnAddRow & fnDel" in the general.js for the Product Details block.
Modified:
vtigercrm/trunk/include/js/general.js
Modified: vtigercrm/trunk/include/js/general.js
==============================================================================
--- vtigercrm/trunk/include/js/general.js (original)
+++ vtigercrm/trunk/include/js/general.js Mon Feb 27 23:08:01 2006
@@ -1349,3 +1349,38 @@
tagName.style.visibility = 'visible';
}
+
+// Add & Delete Row in a Table
+
+function fnAddRow(){
+ var tableName = document.getElementById('proTab');
+ var prev = tableName.rows.length;
+ var count = prev;
+ var row = tableName.insertRow(prev);
+ if(count%2)
+ row.className = "dvtCellLabel";
+ else
+ row.className = "dvtCellInfo";
+ var colone = row.insertCell(0);
+ var coltwo = row.insertCell(1);
+ var colthree = row.insertCell(2);
+ var colfour = row.insertCell(3);
+ var colfive = row.insertCell(4);
+ var colsix = row.insertCell(5);
+ var colseven = row.insertCell(6);
+ colone.innerHTML="<input type='text' name='txtProduct'+count class='detailedViewProdTextBox' readonly/> <img src='themes/blue/images/search.gif' align='absmiddle' />";
+ coltwo.innerHTML=" ";
+ colthree.innerHTML="<input type='text' name='txtQty'+count class='detailedViewTextBox' onfocus='this.className=\"detailedViewTextBoxOn\"' onblur='this.className=\"detailedViewTextBox\"'/> ";
+ colfour.innerHTML=" ";
+ colfive.innerHTML="<input type='text' name='txtListPrice'+count class='detailedViewProdTextBox' readonly/> <img src='themes/blue/images/pricebook.gif' align='absmiddle' /> ";
+ colsix.innerHTML=" ";
+ colseven.innerHTML="<span class='delTxt' onclick=\"deleteRow(this.parentNode.parentNode.rowIndex)\">Del</span>";
+
+}
+
+
+function deleteRow(i)
+{
+ document.getElementById('proTab').deleteRow(i);
+}
+
More information about the vtigercrm-commits
mailing list