Auo Refresh is contradicting Colorizing Row
Posted: 2019-04-24 16:50
Auo Refresh is contradicting Colorizing Row
I am young webdesigner who is learning HTML and CSS at the moment. I have not yet learned Java but will be taking a course soon. I just cannot seem to figure this simple task out.
I have a page where I want to refresh every 10 seconds. The code is below(CODE1) that I found on this forum. It is saved as a .JS file. Works perfectly. It however is contradicting with another piece of code that colorizes rows. That code is saved on the footer.php HOOKS file. I know i am suppose to merge these two codes together and I have tried but won't run the way its suppose to. . Anyone want to have a crack at it?
Secondly, When I click on the ADD NEW button to input new data, the page would load the entire table after 10 seconds.
Thanks Guys!!
CODE1
=========================================
$j(function(){
setInterval(function(){
$j('table').parent().load('tablename_view.php?SortField=5&SortDirection=desc table', function(){
// do something after reloading the table view
});
}, 10000);
})
=====================================================
Code2
--------------------------------------------------------------------------
<script>
$j(function(){
$j('.Trouble_Call_Log-Status').each(function(){
var Status = $j(this).text();
if (Status == 'WIP'){
$j(this).parents('tr').addClass('warning');
}
if (Status == 'BRKDWN'){
$j(this).parents('tr').addClass('danger');
}
if (Status == 'WOP'){
$j(this).parents('tr').addClass('info');
}
})
})
</script>
------------------------------------------------------------------
I am young webdesigner who is learning HTML and CSS at the moment. I have not yet learned Java but will be taking a course soon. I just cannot seem to figure this simple task out.
I have a page where I want to refresh every 10 seconds. The code is below(CODE1) that I found on this forum. It is saved as a .JS file. Works perfectly. It however is contradicting with another piece of code that colorizes rows. That code is saved on the footer.php HOOKS file. I know i am suppose to merge these two codes together and I have tried but won't run the way its suppose to. . Anyone want to have a crack at it?
Secondly, When I click on the ADD NEW button to input new data, the page would load the entire table after 10 seconds.
Thanks Guys!!
CODE1
=========================================
$j(function(){
setInterval(function(){
$j('table').parent().load('tablename_view.php?SortField=5&SortDirection=desc table', function(){
// do something after reloading the table view
});
}, 10000);
})
=====================================================
Code2
--------------------------------------------------------------------------
<script>
$j(function(){
$j('.Trouble_Call_Log-Status').each(function(){
var Status = $j(this).text();
if (Status == 'WIP'){
$j(this).parents('tr').addClass('warning');
}
if (Status == 'BRKDWN'){
$j(this).parents('tr').addClass('danger');
}
if (Status == 'WOP'){
$j(this).parents('tr').addClass('info');
}
})
})
</script>
------------------------------------------------------------------