cto issueshttps://code.gramener.com/groups/cto/-/issues2018-11-27T03:51:26Zhttps://code.gramener.com/cto/g1/-/issues/116Allow loading multiple pages via AJAX2018-11-27T03:51:26ZS AnandAllow loading multiple pages via AJAX### Summary
Create a `$.ajaxchain()` that allows chaining AJAX requests flexibly
### Benefits
- Lets you load FormHandler pages successively with a single call
- Loads multiple pages of data from APIs (e.g. YouTube, Twitter, etc) easily### Summary
Create a `$.ajaxchain()` that allows chaining AJAX requests flexibly
### Benefits
- Lets you load FormHandler pages successively with a single call
- Loads multiple pages of data from APIs (e.g. YouTube, Twitter, etc) easily1.46S AnandS Anandhttps://code.gramener.com/cto/g1/-/issues/115g1 template should support list creation2018-11-24T09:00:01ZS Anandg1 template should support list creation### Summary
`$().template()` replaces the target DOM element. Allow it to append to the target DOM element.
### Benefits
This helps in creating lists that can be extended. For example:
- Repeated AJAX loads append data to the target ...### Summary
`$().template()` replaces the target DOM element. Allow it to append to the target DOM element.
### Benefits
This helps in creating lists that can be extended. For example:
- Repeated AJAX loads append data to the target node
- Successive notifications can be appended to the target node
### Usage
`$().template({}, {append: true})` should enable this behavior.1.46S AnandS Anandhttps://code.gramener.com/cto/g1/-/issues/107Trigger simple hashchange events2018-11-16T14:40:57ZS AnandTrigger simple hashchange events### Summary
When the URL hash changes, trigger a `#?key` event on the window.
### Benefits
This makes it easier for developers to write URL-driven applications.
To change state, just add `<a href="#?key=val" class="urlfilter" data-ta...### Summary
When the URL hash changes, trigger a `#?key` event on the window.
### Benefits
This makes it easier for developers to write URL-driven applications.
To change state, just add `<a href="#?key=val" class="urlfilter" data-target="#">`
To respond to state, don't use `$('a').on('click')`. Instead, use `$(window).on('#?key')`.
### Usage
For example, if the URL changes from `/page` to `/page#?state=Goa`, you can listen to `$(window).on('#?state', function(state) { ... })` will be triggered with `Goa` as the `state`.
It will also trigger `$(window).on('#?', function(url) { ... })` where `url` is a g1 parsed URL.
To enable this, just run `$(window).urlchange(options)`.
Instead of `window`, we can run this on iframes and any other urlfilter target too.1.46S AnandS Anand