I have use the below code in Ajax for first 3 column is constant
whenever we scroll horizontal.
While adding new row in HTML table , i am able to add but first
three columns of new row are not visible.Remaining columns are
visible.So i need to remove the JQuery effect which i have given in
previous function..
function addnewMaterials() {
try {
var RowNew = 'NewRow';
var isvalid = true;
var Distribution_HTML = "";
var table1 = document.getElementById('tbl_Material');
var rowIndex = table1.rows.length;
var counter = 6;
for (var i = 1; i < counter; i++)
{
var row = table1.insertRow(rowIndex);
oCell = row.insertCell();
oCell.align = "left";
oCell.style.color = "Red";
Distribution_HTML = "<td><img
id='img_delete" + rowIndex + "'
style='max-width:none;'
src='/BHARATFORGE/Img/Delete.GIF'
onclick=show_confirm(" + rowIndex + ") alt='Click
here to delete this Entry.' /><input type='hidden'
id='NewRow" + rowIndex + "' value='newRow'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td><input
type='text' style='width: 110px;'
id='txt_Material_Code" + rowIndex + "' value=''/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td><input
type='text' style='width: 300px;'
id='txt_Material_Desc" + rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td
width='130px'><input type='text'
style='width: 110px;' id='txt_Info_Cat" + rowIndex
+ "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td><input
type='text' style='width: 110px;'
id='txt_UOM" + rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td><input
type='text' style='width: 110px;'
onkeyup='return chknumeric(this.id);'
id='txt_Basic_Rate" + rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td><input
type='text' style='width: 110px;'
onkeyup='return chknumeric(this.id);'
id='txt_landed_Rate" + rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td ><input
type='text' style='width: 110px;'
id='txt_tax_code" + rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td ><input
type='text' style='width: 110px;'
onmousedown='setcal(this.id)' id='txt_Eff_date" +
rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td ><input
type='text' style='width: 110px;'
onkeyup='return chknumeric(this.id);'
id='txt_Quantity" + rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td ><input
type='text' style='width: 110px;'
onkeyup='return chknumeric(this.id);'
id='txt_Dis_Per_Gross_VAlue" + rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td ><input
type='text' style='width: 110px;'
onkeyup='return chknumeric(this.id);'
id='txt_Dis_Per_Qty" + rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td ><input
type='text' style='width: 110px;'
id='txt_Packing" + rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td ><input
type='text' style='width: 110px;'
id='txt_PackinP_Qty" + rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td ><input
type='text' style='width: 110px;'
onkeyup='return chknumeric(this.id);'
id='txt_Excise" + rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td ><input
type='text' style='width: 110px;'
onkeyup='return chknumeric(this.id);'
id='txt_Excie_Per_Qty" + rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td ><input
type='text' style='width: 110px;'
onkeyup='return chknumeric(this.id);'
id='txt_Vat_Set_off" + rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td ><input
type='text' style='width: 110px;'
onkeyup='return chknumeric(this.id);'
id='txt_Vat_Non_Set_off" + rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td ><input
type='text' style='width: 110px;'
onkeyup='return chknumeric(this.id);'
id='txt_Ser_Set_Off" + rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td ><input
type='text' style='width: 110px;'
onkeyup='return chknumeric(this.id);'
id='txt_Ser_Non_set_off" + rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td ><input
type='text' style='width: 110px;'
onkeyup='return chknumeric(this.id);' id='txt_CST"
+ rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
var oCell = row.insertCell();
oCell.align = "center";
Distribution_HTML = "<td ><input
type='text' style='width: 110px;'
onkeyup='return chknumeric(this.id);' id='txt_LBT"
+ rowIndex + "'/></td>";
oCell.innerHTML = Distribution_HTML;
rowIndex++;
}
}
catch (Exc) {
alert('Exc' + Exc);
}
}