I have a website which only needs to support IE11. It is a single page application, which has about 200 table rows and each table row has 5 child rows.
There is a pulsing function that updates the table as records come in. Table rows are skipped over if no update comes in.
However, when receiving large updates (which should only occasionally happening), the application will hang as it slowly processes the javascript. I've tried to limit the JavaScript as much as possible, but still have a long running function.
I am a backend developer by nature, and was wondering if anyone had any tips to help support large table Ajax updates for IE since IE so poorly handles JS.
function writeTableLines(tempRows){
/* This Function takes care of updating the text and coloring of
required dynamic fields.
All other values are not dynamically written.
*/
for( i in tempRows){
//i is the computer name
tempValues = tempRows[i];
// For Row
selector = "[id='"+i+"']";
// Network Name
network_selector = "[id='"+i+"_network']";
$(network_selector).text(tempValues['network']);
if (tempValues['network_color']){
$(network_selector).addClass(tempValues['network_color']);
$(selector).find('.name').addClass(tempValues['network_color']);
}else{
$(network_selector).removeClass('warning');
$(selector).find('.name').removeClass('warning');
}
// Boot Time
boot_selector = "[id='"+i+"_boot']";
$(boot_selector).text(tempValues['boot']);
if (tempValues['boot_color']){
$(boot_selector).addClass(tempValues['boot_color']);
$(selector).find('.name').addClass(tempValues['boot_color'])
}else{
$(boot_selector).removeClass('issue');
$(selector).find('.name').removeClass('issue');
}
// Last Checked In Timestamp
check_in_selector = "[id='"+i+"_checked_in']";
$(check_in_selector).text(tempValues['checked_in']);
if (tempValues['service_unresponsive']){
$(check_in_selector).addClass('redline');
$(selector).find('.name').addClass('redline');
}else{
$(check_in_selector).removeClass('redline');
$(selector).find('.name').removeClass('redline');
}
util_selector = $(selector).find('td.util').find('a');
$(util_selector).text(tempValues['util'])
if (tempValues['util_class']){
$(util_selector).addClass(tempValues['util_class']);
}else{
$(util_selector).removeClass('redline warning');
}
workgroup_selector = $(selector).find('td.workgroup');
if (($.trim(tempValues['workgroup'])) != $.trim($(workgroup_selector).text())){
if ((tempValues['workgroup'] != selected) && (selected != 'All')){
$(workgroup_selector).addClass('warning');
}else{
$(workgroup_selector).removeClass('warning');
}
}
$(workgroup_selector).text(tempValues['workgroup'])
toggle_links(i, tempRows[i]);
$('#connectionGrid').trigger('updateAll', [false]);
}
}
This function iterates over only received data. For each row item that was received, update the text of the cell, and add coloring as necessary.
I'm thinking I might just be screwed since its IE, but am open to all suggestions and ideas.
Image of the rows - child rows only available when expanded, but still need updates.
<tbody>...</tbody>
, with considerable advantages to element selection and styling. Hard to give concrete advice without seeing the HTML. \$\endgroup\$