Click here to Skip to main content
15,902,445 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All, 
In my application i am using jquery dynamic table with dynamic rows, the problem is when ever we deletes a row at run time the row is get deleting but the space  which is occupied by the deleted row remains same and when i try to adds new row to table after deletion , the new row is getting adding to end of the table but . 
please let me know how to solve this, any help would be appericiated. 
Thanks 
uday 
Posted
Comments
Sergey Alexandrovich Kryukov 22-Mar-12 3:13am    
How? Could you make the minimal code sample (HTML and JavaScript)?
--SA
udaysimha 22-Mar-12 4:32am    
Following is the my code:
function addDropdown(GUID) {
var newSelect = $("<select id='SelectedRoles" + index + "' önchange='addoperand(" + index + ")' name='SelectedRoles" + index + "'></select>");
for (var i = 0; i < ddlOperand.length; i++) {
if (GUID != '' && GUID != null) {
newSelect.append("<option value='" + GUID + "'>" + ddlOperand[i] + "</option>");
}
else {
newSelect.append("<option value='" + ddlOperand[i] + "'>" + ddlOperand[i] + "</option>");
}
}
var newimage = $("<br/><img önclick='closeselectederow(" + index + ")' id='img" + index + "' src='../../images/cancel_cross.png'/>"); /* uday */
$("#addcritiriatable").append(newimage); /* uday */
$("#addcritiriatable").append(newSelect);
index++;
}
// removing controls dynamically./* uday */
function closeselectederow(index) {
$("#img" + index).remove();
$("#SelectedRoles" + index).remove();
$("#opratorddl" + index).remove();
$("#operandvaluesrddl" + index).remove();

}


<table id="addcritiriatable" border="10" style ="height:auto;">


</table>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900