0

I am trying to select some users (about 200) from a list of 2000 users and load it onto another div but every time the loop runs it opens the following dialog in Firefox

A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue.

It works on smaller lists though. Is there any optimized way to achieve this? Below is my code:

var usersList = $("#UsersList").data("kendoListView");
var usersListDS = usersList.dataSource;
var newSelectedUsers = usersList.select();
var selectedUsersData = [];

$.each(newSelectedUsers, function (index, data) {
    var itemIndex = $(data).index();
    var newItem = usersListDS.at(itemIndex);
    if (newItem) {
        selectedUsersListData.push(newItem);
        selectedUsersData.push(newItem);
    }
});
CoderPi
  • 12,985
  • 4
  • 34
  • 62
Mudasir Sahto
  • 69
  • 3
  • 13

0 Answers0