Hello AppGini family
I am looking for a solution to create an alert for the limit of stock, any idea and help is welcome.
My table is like this
product
quantity
price
I want when the quantity is equal to 8, the field is red color
Thank you
Stock Alert
Re: Stock Alert
Hi,
you can add to the hooks/<tablename>.php file at the <tablename>_header function the following in the case statement for the TV.
if you want the field to be red for <=8, change the comparison above accordingly.
If you want the complete row to be red and not only the one field, you can us change it to
you can add to the hooks/<tablename>.php file at the <tablename>_header function the following in the case statement for the TV.
Code: Select all
$header="<%%HEADER%%><script type=\"text/javascript\">
\$j(function(){
\$j('td.ekjobs-JobNummer').each(function(){
if (\$j(this).text().trim() ==8) { \$j(this).css(\"background-color\", \"red\")} ;
})
});
</script>";
If you want the complete row to be red and not only the one field, you can us change it to
Code: Select all
$header="<%%HEADER%%><script type=\"text/javascript\">
var obj = JSON.parse('{\"8\":\"red\"}');
\$j(function(){
\$j('td.ekjobs-JobNummer').each(function(){
if (\$j(this).text().trim() ==8) { \$j(this).parent().css(\"background-color\", \"red\")} ;
})
});
</script>";
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.
Re: Stock Alert
Hi
Thank you for your reply, I am going to try.
Regards
Thank you for your reply, I am going to try.
Regards