Gramex 1.47 Release Notes

g1

gramex uicomponents now ships with g1 0.11.0

In this version, two new interaction components are released.

$.urlchange

$.urlchange acts as an event listener for URL hash changes. triggered by $.urlfilter – This makes it easy to build URL-driven applications.

Suppose we have buttons that sort based on “City” or “Sales”.

DOM events should change the URL like this:

<button href="?_sort=City" class="urlfilter" target="#">City</button>
<button href="?_sort=Sales" class="urlfilter" target="#">Sales</button>
<script>
  $("body").urlfilter();
</script>

Now, changes in the URL should trigger actions:

$(window)
  .urlchange() // URL changes trigger '#?city' events
  .on("#?city", function (e, city) {
    action(city);
  });

Read documentation

$.ajaxchain

$.ajaxchain() chains AJAX requests, loading multiple pages in sequence

$.template

$.template can append to existing DOM elements, allowing AJAX requests to add to a list rather than replace them

UI Components

New UI classes are added

Auth

You can now protect all pages (handlers) at a single place.

To add access control to the entire application, use:

handlers:
  BaseHandler:
    # Protect all pages in the application. All auth: configurations allowed
    auth:
      login_url: /$YAMLPATH/login/

This is the same as adding the auth: ... to every handler in the application.

Read more

Guide

We’ve re-ordered and grouped Gramex Guide index sidebar into logical heading.

Stats

Upgrade

Note: gramex >= 1.41 onwards requires Anaconda >= 5.2.0

To upgrade Gramex, run:

pip install --verbose gramex==1.47

To upgrade apps dependencies, run:

gramex setup --all

This downloads Chromium and other front-end dependencies. That may take time.