I have made a table that has a Edit and Delete
the data inside the table is coming from CVF file I am not using database here.
what i need to do is when i click the Edit it will allow me to edit the row where the clicked edit place and when i save it, it will update the table and also the data in CSV file.
How can i do that. I am using codeigniter here
I tried this code but its not working.
function Edit()
{
var par = $(this).parent().parent(); //tr
var f1 = par.children("td:nth-child(1)");
var f2 = par.children("td:nth-child(2)");
var f3 = par.children("td:nth-child(3)");
var f4 = par.children("td:nth-child(4)");
var f5 = par.children("td:nth-child(5)");
var f6 = par.children("td:nth-child(6)");
var f7 = par.children("td:nth-child(7)");
var f8 = par.children("td:nth-child(8)");
var f9 = par.children("td:nth-child(9)");
var f10 = par.children("td:nth-child(10)");
var f11 = par.children("td:nth-child(11)");
var f12 = par.children("td:nth-child(12)");
var f13 = par.children("td:nth-child(13)");
var f14 = par.children("td:nth-child(14)");
var f15 = par.children("td:nth-child(15)");
var f16 = par.children("td:nth-child(16)");
var fbtn = par.children("td:nth-child(17)");
f1.html("<input type='text' id='txtf1' value='"+f1.html()+"'/>");
f2.html("<input type='text' id='txtf2' value='"+f2.html()+"'/>");
f3.html("<input type='text' id='txtf3' value='"+f3.html()+"'/>");
f4.html("<input type='text' id='txtf4' value='"+f4.html()+"'/>");
f5.html("<input type='text' id='txtf5' value='"+f5.html()+"'/>");
f6.html("<input type='text' id='txtf6' value='"+f6.html()+"'/>");
f7.html("<input type='text' id='txtf7' value='"+f7.html()+"'/>");
f8.html("<input type='text' id='txtf8' value='"+f8.html()+"'/>");
f9.html("<input type='text' id='txtf9' value='"+f9.html()+"'/>");
f10.html("<input type='text' id='txtf10' value='"+f10.html()+"'/>");
f11.html("<input type='text' id='txtf11' value='"+f11.html()+"'/>");
f12.html("<input type='text' id='txtf12' value='"+f12.html()+"'/>");
f13.html("<input type='text' id='txtf13' value='"+f13.html()+"'/>");
f14.html("<input type='text' id='txtf14' value='"+f14.html()+"'/>");
f15.html("<input type='text' id='txtf15' value='"+f15.html()+"'/>");
f16.html("<input type='text' id='txtf16' value='"+f16.html()+"'/>");
fbtn.html("<a class='btnSave'>Save</a>");
$(".btnSave").bind("click", Save);
$(".btnEdit").bind("click", Edit);
$(".btnDelete").bind("click", Delete);
};