For #343542: Enable optional auto-refreshing views using AJAX I had another look at whether we could e.g. fade out old and fade in new items when refreshing. To do so, though, we would need to pass to view renderers the ability to mark each item (table row, node, list item, etc.) with a unique ID that doesn't change per page load. The most likely candidate would be a concatenation of the base type (e.g., node) and an ID. But these data are not currently passed to renderers

Currently rows are keyed by integers (which in the case of tables are used to determine odd/even classes). Probably we'd need to start keying them by an ID field.

Another issue would be ensuring uniqueness of an ID even if we could assign one. A particular item (node 21) may appear in more than one view on a given page, so if we use form_clean_id() the id will be unique per page view but not if e.g., we're reloading the view via AJAX.

Comments

merlinofchaos’s picture

In theory the combination of view + displayid + basetype + record ID will work, but in the case of duplicates, it will not work. In fact, the only thing I can think to do that has a reasonable chance of actually providing unique signatures is to md5() the $result entry for the row. That should remain fairly consistent.

merlinofchaos’s picture

Oh, the data you seek is always available to renderers. The base field is always in the result set, it is the one thing that you can always count on being there, and $view should contain the information needed to acquire it, and $view is always available.

esmerel’s picture

Status: Active » Closed (fixed)

General closing of issues with no activity for 6 months