Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Senthil on Jul 24, 2009 06:55
open dhtmlx forum
Loading the combo is very slow

I am using the following code to generate the rows of a table.
function addRowToTable()
{
        var tbl = document.getElementById('entrydetails');
        var lastRow = tbl.rows.length;
        var iteration = lastRow;
        var row = tbl.insertRow(lastRow-1);
        var row1 = tbl.insertRow(lastRow-1);
        var cellLeft = row.insertCell(0);

        var cellRight = row.insertCell(0);
        var text71 = document.createElement('image');
        text71.setAttribute('src', '/images/view.gif');
        text71.onclick =Function("showItem(" + count + ","+ lineNo + ");");// new Function("showItem();");
        text71.type="image";
        text71.alt='Show Details';
        text71.name="ch_lineItemSrno"+count;
        text71.id="ch_lineItemSrno"+count;
        cellRight.appendChild(text71);
        cellRight.align="center";
        cellRight.className="cellbgml";
        lineNo++;

         var cellRight = row.insertCell(1);
        var e1 = document.createElement('select');
         var string = new Array();
        string.push("<div align='center'><select name='ch_lineItemNo"+count+"' id ='ch_lineItemNo"+count+"' style='width:175px' onChange = 'onChangeItem("+count+")' >");
        string.push("<option value="+" "+">"+"</option>");
         for(var i=0; i<itemNoList.length;i++){
            //var ls_idName = getName(itemCodes[i]);
            string.push("<option value="+itemDescList[i]+">"+itemNoList[i]+"</option>");
            
        }
        string.push('</select></div>');
        var writestring = string.join('');
        e1.style.width = "260px";
        cellRight.style.width="175px";
        cellRight.innerHTML = writestring;
        cellRight.align="center";
        cellRight.className="cellbgml";
        zepItemNo[count]=dhtmlXComboFromSelect("ch_lineItemNo"+count);
        zepItemNo[count].enableFilteringMode(true);
        zepItemNo[count].setOptionWidth(400);
        rowno++;
        count = parseInt(count) + 1;
}

Here "itemNoList" contains 20000 elements.So its taking more time to generate each row.Here I have to crate n number of rows.Please Assist .
Thanks
Answer posted by Alex (support) on Jul 24, 2009 07:14

Hello, 

you can use dynamic loading in this case: combo.enableFilteringMode(true,path_to_script,true). The sample is 

dhtmlxCombo/samples/filtering/100000/index.html

http://dhtmlx.com/docs/products/dhtmlxCombo/samples/filtering/100000/index.html