Page 1 of 1

Appgini Pre-sales questions, can Appgini?

Posted: 2015-09-29 00:12
by dragon
I'm looking for a solution to create a web based application. I've been reviewing various solutions including Appgini.

I'm wondering if I can have 'due dates' in Appgini.

Example: cells where the due date is expired would be red, cells where the due date is 7 days out yellow, cells where due dates are 8+ days out green. Once the item is take care of, then due date updates to either 7 days out, 14 days out, 30 days out, end of the following month, etc.

If Appgini is capable of doing this, please briefly explain. Thanks.

Re: Appgini Pre-sales questions, can Appgini?

Posted: 2015-09-30 04:31
by a.gneady
Although this is not directly supported by AppGini, it can be added by customizing the generated code. Let's assume your table name is 'tasks', the field name is 'due_date', and the date format for that field is 'month/day/year'. You should add code similar to the following in the generated 'hooks/footer-extras.php' file:

Code: Select all

$j('td.tasks-due_date a').each(function(){
    var ds = $j(this).html();
    
    /* assuming date format of due_date is month/day/year */
    var dc = new Date(ds.replace(/(\d{1,2})\/(\d{1,2})\/(\d{4})/, '$3-$1-$2'));
    
    var today = new Date();
    var days_ahead = parseInt((dc - today) / 86400 / 1000);

    if(days_ahead >= 8){
        // 8+ days left, use green highlighting
        $j(this).addClass('text-success').parent().addClass('success');
    }else if(days_ahead >= 7){
        // 7 days left, use yellow highlighting
        $j(this).addClass('text-warning').parent().addClass('warning');
    }else{
        // less than 7 days left, use red highlighting
        $j(this).addClass('text-danger').parent().addClass('danger');
    }
});
Here is sample output that shows how highlighting would look like (assuming the default bootstrap theme):
highlight-date-field-based-on-value.png
highlight-date-field-based-on-value.png (38.02 KiB) Viewed 11737 times

Re: Appgini Pre-sales questions, can Appgini?

Posted: 2015-09-30 16:45
by dragon
Thank you for the response a.gneady. I purchased appgini last night, I'm looking forward to using and supporting the development & support of Appgini.

Re: Appgini Pre-sales questions, can Appgini?

Posted: 2015-10-01 21:38
by a.gneady
You're always welcome.
And thanks for your order :)

Re: Appgini Pre-sales questions, can Appgini?

Posted: 2015-10-14 16:07
by dragon
a.gneady wrote:Although this is not directly supported by AppGini, it can be added by customizing the generated code. Let's assume your table name is 'tasks', the field name is 'due_date', and the date format for that field is 'month/day/year'. You should add code similar to the following in the generated 'hooks/footer-extras.php' file:

Code: Select all

$j('td.tasks-due_date a').each(function(){
    var ds = $j(this).html();
    
    /* assuming date format of due_date is month/day/year */
    var dc = new Date(ds.replace(/(\d{1,2})\/(\d{1,2})\/(\d{4})/, '$3-$1-$2'));
    
    var today = new Date();
    var days_ahead = parseInt((dc - today) / 86400 / 1000);

    if(days_ahead >= 8){
        // 8+ days left, use green highlighting
        $j(this).addClass('text-success').parent().addClass('success');
    }else if(days_ahead >= 7){
        // 7 days left, use yellow highlighting
        $j(this).addClass('text-warning').parent().addClass('warning');
    }else{
        // less than 7 days left, use red highlighting
        $j(this).addClass('text-danger').parent().addClass('danger');
    }
});
Here is sample output that shows how highlighting would look like (assuming the default bootstrap theme):

Doing the above I get the following errors.

screenshot10.PNG
screenshot10.PNG (10.29 KiB) Viewed 11669 times
screenshot9.PNG
screenshot9.PNG (11.82 KiB) Viewed 11669 times

Re: Appgini Pre-sales questions, can Appgini?

Posted: 2015-10-14 17:24
by dragon
@ All, I think I got it working! I'll update momentarily! Yeeeehaw! Making progress with Appgini.

Re: Appgini Pre-sales questions, can Appgini?

Posted: 2016-08-22 04:24
by Gerud Mani
How did you fix that error, I got the same, not sure how to work around it!

I have two more questions about this function please:
  • Is it possible to highlight the whole row and not just the due date cell?
  • Is it possible to highlight it based on cell content, like if it had the word 'hot' or so?
Thank your for your awesome support!

Re: Appgini Pre-sales questions, can Appgini?

Posted: 2016-08-29 07:30
by Noha Eshra
Regarding the above error, make sure the code is inserted in the footer page inside a script tag. You should also make sure it is NOT placed inside a php block.

To highlight an entire row based on a value you can use a code similar to the one below.

Code: Select all

<script>
$j(function(){
    $j('td.tablename-fieldname a').each(function(){
         var ds = $j(this).html();
         if (ds == "trigger value here"){
               $j(this).parent().addClass('text-success').parent().addClass('success');
         }
     }
}
</script>
For more tips and ideas regarding customizing the generated code, please refer to our AppGini Customization Course at https://www.udemy.com/customizing-appgi ... ode=TENOFF

Re: Appgini Pre-sales questions, can Appgini?

Posted: 2016-08-30 11:36
by Gerud Mani
Thank you so much Noha, it is working for me now. However, for some reason I don't get the text effect of the theme when the whole row is selected (see screenshot), it only color the background with the right theme but not the text. Is there a way to fix this?
capture.gif
capture.gif (11.57 KiB) Viewed 11048 times
I checked the preview of your course, it does sound interesting. I'll definitely sign up for it.

Re: Appgini Pre-sales questions, can Appgini?

Posted: 2016-08-31 19:04
by Noha Eshra
This code should do the job:

Code: Select all

<script>
   $j(function(){
       // change tablename and fieldname below to the actual table and field names ...
       $j('td.tablename-fieldname a').each(function(){
           var ds = $j(this).html();
           if (ds == "trigger value here"){
               $j(this).addClass('text-success').parent().parent().addClass('success');
           }
       }
   }
</script>

Re: Appgini Pre-sales questions, can Appgini?

Posted: 2017-10-25 14:08
by D Campbell
I just found out that it only works on Chrome browser - not other browsers like Microsoft Edge, Firefox, and others. I haven't test on different browsers, just three of them. These highlight colors works on chrome only - is there a way to get it working on other browsers?

Re: Appgini Pre-sales questions, can Appgini?

Posted: 2017-11-09 05:11
by Abeer
D Campbell wrote:
2017-10-25 14:08
I just found out that it only works on Chrome browser - not other browsers like Microsoft Edge, Firefox, and others. I haven't test on different browsers, just three of them. These highlight colors works on chrome only - is there a way to get it working on other browsers?
I have just tried it on IE and Firefox browsers and it works as fine as on Chrome browser.