Hi all,
I need to create extra rows for already existed table in javascript.I added code as shown below.It works well for mozilla but for ie extra rows are not adding .i didnt find where the problem was.Apart from that i had another problem with checkbox created below.it always returns checked state as false.
can anyone please help me in tracing out my problem.
Thanking you in advance.
This is my code part.
for(var exi=0;exi<(viewindex-displayindex);exi++)
{
var lastRow = allTables.rows.length;
// if there's no header row in the table, then iteration = lastRow + 1
var iteration = lastRow;
var row = allTables.insertRow(lastRow)
for (var extd = 0; extd<5;extd++)
{
var cell = document.createElement("td");
row.appendChild(cell);
if(extd==0)
{
cell.id="cbox"+String(displayindex+exi);
cell.align="center";
var cellText=document.createElement("input");
cellText.type="checkbox";
cellText.checked="true";//eventhou
//cellText.align="right"
cellText.name="chkbox";
cellText.onclick=function(){return changestatus(cellText,cell,document.form_enc);};
cellText.id=String(displayindex+exi);
cellText.value=console_lstringa_colname[index+exi];
cell.appendChild(cellText);
row.appendChild(cell);
}else if(extd==1)
{
cell.id="colname"+String(displayindex+exi);
var cellText = document.createTextNode(console_lstringa_colname[index+exi]);
cell.appendChild(cellText);
row.appendChild(cell);
}else if(extd==2)
{
var cellText = document.createElement("select");
cellText.style.width="100px";
cellText.id="selectkey"+String(displayindex+exi);
for(var keyindex=0;keyindex<console_lstringa_keyids.length;keyindex++)
{
var option0= new Option(console_lstringa_keyids[keyindex],console_lstringa_keyids[keyindex])
eval("cellText.options[keyindex]=option0")
}
cell.appendChild(cellText);
row.appendChild(cell);
}else if(extd==3)
{
cell.id="noaccess"+String(displayindex+exi);
cell.name="noaccesstxttd";
var cellText =document.createElement("input");
cellText.id=displayindex+exi;
cellText.name="noaccesstxt"+String(displayindex+exi);
var data=document.createTextNode(console_lstringa_noacess[index+exi]);
cellText.value=console_lstringa_noacess[index+exi];
cell.appendChild(cellText);
row.appendChild(cell);
}else
{
cell.id="treeview"+String(displayindex+exi);
cell.className="treemenu" ;
var roletree=new jktreeview("treeview"+String(displayindex+exi));
var branch1=roletree.addItem("Roles");
roles=new Array("IT_Sale","IT_R&D", "vani","asdas","asas","asasD")
for(var j=0;j<roles.length;j++)
{
roleindex++;
roletree.addItem(roles[j],branch1,'',roleindex)
}
roletree.treetop.draw();
row.appendChild(cell);
}
}
allTables.appendChild(row);
}