Auo Refresh is contradicting Colorizing Row

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
vpaul
Posts: 2
Joined: 2019-04-24 15:19

Auo Refresh is contradicting Colorizing Row

Post by vpaul » 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>

------------------------------------------------------------------

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Auo Refresh is contradicting Colorizing Row

Post by pbottcher » 2019-04-25 10:08

Hi,

maybe you can explain why you would need to reload the page every 10 sec, as if somebody wants to enter some data, if he is not quick enough he will have to redo everything.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

vpaul
Posts: 2
Joined: 2019-04-24 15:19

Re: Auo Refresh is contradicting Colorizing Row

Post by vpaul » 2019-04-25 18:56

I am using it as a display. This way employees can see it on a monitor and know what problems arises.

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Auo Refresh is contradicting Colorizing Row

Post by pbottcher » 2019-04-26 20:15

Hi,

in this case I would suggest that you create a view for the table for which you can update the page every 10 sec.

See https://forums.appgini.com/phpbb/viewto ... f=7&t=2980 (sjohn explained how to do that).
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

Post Reply