0

I have angularjs project.I have used jquery-ui selectable to select cell from table.If i used table with 10 rows and 10 cols selectable is working fine. but when Create table with 50rows and 50 cols it will create to much lagging and browser goes hang.
I have updated my code :

var table = '<table id="my-table-1" ><tr><td></td></tr></table>';
$('#my-container').html(table);
//insert
    var html = "";
    for (var i = 0; i < 25; i++) {
        html += '<tr>';
        for (var j = 0; j < 25; j++) {
            html += '<td></td>';
        }
        html += '</tr>';
    }
    $('#my-table-1').html(html);
    $('#my-table-1').selectable();
0

1 Answer 1

0

You will have to create the table as a directive implementation . $compile(table[0])($scope) & appendChild are expensive operations. Any sort of DOM manipulations must be handled in the link or compile method in the Directive . Don't write DOM logic in controllers if that's the case . Otherwise you'll have to elaborate further .

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for reply @jeson Dias Please check my question once again I have updated my code.
Are you writing this in your .controller file ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.