Unique ID

11 views
Skip to first unread message

Pavel V. Kaygorodov

unread,
May 3, 2013, 10:18:44 AM5/3/13
to nagare-users@googlegroups.com users
Hi!

I want to show a few similar elements on the page, each rendered by AsyncRenderer. Each of those elements must have unique (across the page) ID to be accessible from JS. I don't want to make a global counter to generate unique IDs. I think, Nagare already generates such IDs for each async element, so I want to use those IDs, just appending some suffixes or prefixes.

How can I get the unique object ID from __init__() constructor?

Pavel.

Pierre Meyer

unread,
May 3, 2013, 3:54:11 PM5/3/13
to nagare...@googlegroups.com
Hi,

Nagare renderers come with a `generate_id` method out of the box, which accepts a custom prefix.

Use it to generate ids on the fly during rendering phase, and provide those ids to your JS library.


HTH


Pavel.

--
You received this message because you are subscribed to the Google Groups "Nagare users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nagare-users...@googlegroups.com.
To post to this group, send email to nagare...@googlegroups.com.
Visit this group at http://groups.google.com/group/nagare-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



Reply all
Reply to author
Forward
0 new messages