Hi,
On a button click, i’m dynamically adding rows to my table. In my table
My code goes here,
<table id="Group">
<tr>
<td>
<div id="grp_code">
<script>
var itemgrp=new dhtmlXCombo("grp_code","grp_code",275);
itemgrp.enableFilteringMode(true);
itemgrp.loadXML(ItemGroup.jsp);
</script>
</div>
</td>
<td>
<input type="text" name="text1" id="text1" value="">
</td>
</tr>
</table>
My function for adding rows goes here.
function addRow(tableID)
{
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
var next_cnt = Number(document.frmratecard.p_no_of_records.value)+1;
var colCount=table.rows[0].cells.length;
var row=table.insertRow(rowCount);
for(var i=0; i<colCount; i++)
{
var newcell = row.insertCell(i);
newcell.innerHTML = table.rows[0].cells[i].innerHTML;
switch(newcell.childNodes[0].type)
{
case "text":
newcell.childNodes[0].value="";
newcell.childNodes[0].name=newcell.childNodes[0].name+(next_cnt);
newcell.childNodes[0].id=newcell.childNodes[0].id+(next_cnt);
break;
case "select-one":
newcell.childNodes[0].selectedIndex=0;
newcell.childNodes[0].name=newcell.childNodes[0].name+(next_cnt);
newcell.childNodes[0].id=newcell.childNodes[0].id+(next_cnt);
break;
}
}
document.frmratecard.no_of_records.value=next_cnt;
}
<input type="hidden" name="no_of_records" value="1">
On clicking add row button i’m passing the table id.
Textbox and combo are getting generated but Combo is not having values in it. The code in the color for normal select drop down list.
Is there any way where i can dynamically add rows which is having dhtmlxcombo in it?
If so how?
Please help me. My combo data is huge and so for filtering i need to use combo.
Thanks in advance.
Vigneshwarie