gramex uicomponents now ships with g1
0.11.0
In this version, two new interaction components are released.
$.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);
});
$.ajaxchain() chains AJAX requests, loading multiple pages in sequence
$.template can append to existing DOM elements, allowing AJAX requests to add to a list rather than replace them
New UI classes are added
.border-2
for a border twice as thick.border-top-1
, border-right-1
, border-bottom-1
, border-left-1
add a 1px
border on each side..overflow-hidden
, .overflow-auto
and .overflow-scroll
set the overflow styles..text-decoration-none
removes the text-decoration..cursor-default
helps when you make clickable elements non-clickable..pointer-events-none
sets the pointer-events to noneYou 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.
We’ve re-ordered and grouped Gramex Guide index sidebar into logical heading.
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.