Skip to content

Hierarchy array #6

Description

@ricardovf

Hi, First of all, congrats on the GREAT work! Ill be trying it in my projects from now.

My Web App is a reporting aplication, and it uses AJAX to load reports, when selected from the menu.

I need to do something like Hierarchy tags. Ill do an exemple:

Supose i have 2 functions requested via AJAX. One is for reports, and it have aditional configs (like id) and the other doesnt.

Report A) index.php/#{"page":{"name":"reports","id":"25648"},"something":"111"}
Report B) index.php/#{"page":{"name":"reports","id":"48441"},"something":"111"}
Report B+config) index.php/#{"page":{"name":"reports","id":"48441","vision":"xxx"},"something":"111"}
Help Page) index.php/#{"page":{"name":"help"},"something":"111"}

On the Report B+config, i would like to register something like:
HM.addEvent('page.vision-changed',function...

Note the page.vision syntax. Would it be posible? An array syntax. Maybe only 2 or 3 levels are needed... (no recursion needed)

There is another thing. As the reports are loaded via AJAX, they need to register on the HM to listen to events. But when i load one of them the second time, they register again for listening. So the solution i found was to use HM.removeEvents('-something:changed');
Is there a better way?

If you have more tips on AJAX+HistoryManager, please let me know!

Thx in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions