Hello!
My project has the following interface: (screenshot works the best)
http://www.screencast.com/users/asch...9-4a7af883e3c9
Device groups could have 1 device, or 100,000 devices.
I have an asynchronous action when you select a different device group
- it will go to the server, get the applicable devices - remove the
current devices from the list, then re-add all the devices it has
retrieved.
This takes a long time with around 20,000 devices (20-30 seconds).
Here's my code:
//result is an array of strings
function populateDeviceList(result){
var listBox = $('.DeviceList')[0];
//Clear the list
for (var i = listBox.options.length - 1 ; i >= 0 ; i--) {
listBox.options[i] = null;
}
//Repopulate with results
var deviceListFilterBox = $('.DeviceListFilterBox')[0].value;
var len = result.length;
for (var i = 0;i < len;i++){
var thisOne = result[i];
if (thisOne.startsWith(deviceListFilterBox)){
AddItem(listBox, thisOne, thisOne);
}
}
disableSelectedItems($('body'));
}
function AddItem(objListBox, strText, strId, added)
{
var newOption = new Option(strText, strId)
objListBox.options.add(newOption);
}
Any suggestions?
Thanks in advance!