Highlight: Table View with Open Street Map (OSM)
06/08/2020

Important Notice
The features shown in this "highlights" blog category are a showcase of things which can be done using AppGini, AppGini Helper Library, PHP, SQL, Javascript, JQuery, CSS and HTML. This definately does not mean that everything you can see here is part of our product. It took hours, sometimes days of research, trial-and-error, coding and testing. So, these showcases are not part of a 49$ library, they are not single-line copy&paste codes and they are not for sale. Just a demonstration of what can be done.

Showcase

Description

A map based on Leaflet and Open Street Map (OSM) at the right hand side of a busines partners table view. Whenever selection changes, the client fetches geo coordinates, stored in an postal-addresses-table, from the server and renders points-of-interest (POI's).

Note the dynamic sizing and automatic centering of the map according to the selected business partners' addresses.

Components

AppGini Helper Features

  • Navbar-Fix
  • Custom navbar title
  • Additional panel right of table view
    will be available by the end of 2020
  • Selection-Change handler for table views
    will be available by the end of 2020

Extensions

A few extensions over the day:

  • Additional left-hand-side panel (dismissable)
  • Quick filters
  • Range selection und de-selection (with SHIFT-key pressed)

Preview: (Auto-) Hiding table columns in children tabs of DV
05/08/2020

In this preview of the next version of AppGini Helper Javascript Library I show the new function "autoHide" for columns of children tabs.

Please note that the functions shown here will be available by the end of 2020, probably

The problem with too many columns

As you may already know a master record may have detail records in a different table. AppGini can generate tabs for each detail table and will show the tabs below the master record's data.

You can see there may be many columns in the children tab table. There are a few CSS tricks to hide columns you don't need. And in next version there will be two smart solutions for hiding columns.

Solution 1: Auto hide according to user preferences

When we open that details-table in table view, users can configure the columns they want to see by using the column-selector at the top-right:

Wouldn't it be great if those user preferences would apply to the children tabs table of the detail-view, too?

Just add that one line of code to your hooks-dv file of your master table:

// file: MASTERTABLE-dv.js
new AppGiniDetailView().getChildrenTabs().autoHide("tasks");

Next time the hidden colors of table view will also be hidden in children tabs of a master record:

Solution 2: Hide columns by (javascript-) code

Instead of applying user preferences of table view we can also programmatically hide specific columns:

Hiding a single column:

// file: hooks/MASTERTABLE-dv.js
var subtable_name = "tasks";
var subtable_column ="created_by";

new AppGiniDetailView().getChildrenTabs().hide(subtable_name, subtable_column);

Hiding multiple columns:

// file: hooks/MASTERTABLE-dv.js
var subtable_name = "tasks";
// array of column names
var subtable_columns = ["created_by", "created_on", "modified_by", "modified_on"]; 
new AppGiniDetailView().getChildrenTabs().hide(subtable_name, subtable_columns);
How to: Redirect to requested page after login
03/07/2020

Sometimes, in our AppGini applications we'd like to share data with co-workers or other users by sending a link via email, for example. Unfortunately, this does not work as expected, by default.

I am going to show a very simple, solution, based on our AppGini Helper Javascript Library.

AppGini default behaviour

By default, if we are not logged in already, AppGini redirects us to the login-page first, then to the homepage (index.php) after login.

graph LR S((Start)) ==> A{Authorized<br>?} A -. yes .-> P([Requested Page]) A == no ==> L([Login]) L ==> A2{Authorized<br>?} A2 -- no --> L A2 == yes ==> H([Homepage]) H ==>E((End)) P -.-> E classDef red fill:#eee,stroke:#f00,color:#f00,stroke-width:1px; class H red; classDef orange fill:#eee,stroke:#aaa,color:#aaa,stroke-width:2px,stroke-dasharray:5,2 class P orange; classDef standard fill:#eee,stroke:#333,color:#000,stroke-width:1px; class S,A,A2,L,E standard;

This means the user will not see the requested page unless he/she clicks the link again (or copies the url into the browser's address bar).

AppGini Default

But this is not what we want at all. We'd like to redirect the user to the requested page after login, not to the homepage.


Expectation

What we want is, when the recipient clicks the link, his/her browser should open up and show the shared page after login.

graph LR S((Start)) ==> A{Authorized<br>?} A == no ==> L([Login]) L ==> A2{Authorized<br>?} A2 -- no --> L A2 == yes ==> P A -. yes .-> P([Requested Page]) P --> E((End)) classDef green fill:#fafafa,stroke:#0a0,color:#0a0,stroke-width:2px; class P green; classDef standard fill:#eee,stroke:#333,color:#000,stroke-width:1px; class S,A,A2,L,E standard;

Solution

Please note that this is BETA for testing purposes. Please provide feedback if this works for you or not.

We have done all the hard work for you and provide a simple solution:

Code

<!-- file: hooks/header-extras.php -->
<script>
  var common = new AppGiniCommon();
  common.autoRedirect();
</script>

That's all you have to do. Just call the autoRedirect() function on the AppGiniCommon object. Our library will do the rest.

Result

Wanna see it in action?


Pro-Tipp:

This integrates nicely with QR-Codes