Appgini Pre-sales questions, can Appgini?

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
dragon
Veteran Member
Posts: 44
Joined: 2015-09-29 00:06

Appgini Pre-sales questions, can Appgini?

Post by dragon » 2015-09-29 00:12

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.
Appgini 5.50, Revision 835. Mac OSX 10.11 running Windows 10 on VMWare.

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Appgini Pre-sales questions, can Appgini?

Post by a.gneady » 2015-09-30 04:31

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 10149 times
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

dragon
Veteran Member
Posts: 44
Joined: 2015-09-29 00:06

Re: Appgini Pre-sales questions, can Appgini?

Post by dragon » 2015-09-30 16:45

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.
Appgini 5.50, Revision 835. Mac OSX 10.11 running Windows 10 on VMWare.

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Appgini Pre-sales questions, can Appgini?

Post by a.gneady » 2015-10-01 21:38

You're always welcome.
And thanks for your order :)
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

dragon
Veteran Member
Posts: 44
Joined: 2015-09-29 00:06

Re: Appgini Pre-sales questions, can Appgini?

Post by dragon » 2015-10-14 16:07

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 10081 times
screenshot9.PNG
screenshot9.PNG (11.82 KiB) Viewed 10081 times
Appgini 5.50, Revision 835. Mac OSX 10.11 running Windows 10 on VMWare.

dragon
Veteran Member
Posts: 44
Joined: 2015-09-29 00:06

Re: Appgini Pre-sales questions, can Appgini?

Post by dragon » 2015-10-14 17:24

@ All, I think I got it working! I'll update momentarily! Yeeeehaw! Making progress with Appgini.
Appgini 5.50, Revision 835. Mac OSX 10.11 running Windows 10 on VMWare.

Gerud Mani
Posts: 9
Joined: 2016-08-22 04:18

Re: Appgini Pre-sales questions, can Appgini?

Post by Gerud Mani » 2016-08-22 04:24

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!

Noha Eshra
Moderator
Posts: 82
Joined: 2013-11-11 19:21

Re: Appgini Pre-sales questions, can Appgini?

Post by Noha Eshra » 2016-08-29 07:30

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

Gerud Mani
Posts: 9
Joined: 2016-08-22 04:18

Re: Appgini Pre-sales questions, can Appgini?

Post by Gerud Mani » 2016-08-30 11:36

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 9460 times
I checked the preview of your course, it does sound interesting. I'll definitely sign up for it.

Noha Eshra
Moderator
Posts: 82
Joined: 2013-11-11 19:21

Re: Appgini Pre-sales questions, can Appgini?

Post by Noha Eshra » 2016-08-31 19:04

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>

D Campbell
Posts: 20
Joined: 2017-03-12 09:32

Re: Appgini Pre-sales questions, can Appgini?

Post by D Campbell » 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?

Abeer
Posts: 18
Joined: 2017-03-12 09:19

Re: Appgini Pre-sales questions, can Appgini?

Post by Abeer » 2017-11-09 05:11

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.

Post Reply