Hello!
My project has the following interface: (screenshot works the best)
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 populateDeviceL ist(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 deviceListFilte rBox = $('.DeviceListF ilterBox')[0].value;
var len = result.length;
for (var i = 0;i < len;i++){
var thisOne = result[i];
if (thisOne.starts With(deviceList FilterBox)){
AddItem(listBox , thisOne, thisOne);
}
}
disableSelected Items($('body') );
}
function AddItem(objList Box, strText, strId, added)
{
var newOption = new Option(strText, strId)
objListBox.opti ons.add(newOpti on);
}
Any suggestions?
Thanks in advance!
My project has the following interface: (screenshot works the best)
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 populateDeviceL ist(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 deviceListFilte rBox = $('.DeviceListF ilterBox')[0].value;
var len = result.length;
for (var i = 0;i < len;i++){
var thisOne = result[i];
if (thisOne.starts With(deviceList FilterBox)){
AddItem(listBox , thisOne, thisOne);
}
}
disableSelected Items($('body') );
}
function AddItem(objList Box, strText, strId, added)
{
var newOption = new Option(strText, strId)
objListBox.opti ons.add(newOpti on);
}
Any suggestions?
Thanks in advance!
Comment