Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

attributes.classList is not reevaluated in Repeater childSections on refresh, only cssClass is #398

Closed
jakub-g opened this Issue · 3 comments

1 participant

@jakub-g
Collaborator

In childSections of Repeater cfg, we can have callback functions that can conditionally return different values depending on which item of the repeater they're evaluated, useful e.g. for having different CSS classes for even/odd rows.

However, while the old (deprecated) cssClass is reevaluated on refresh, the new attributes.classList is not. You can see it here:

http://ariatemplates.com/usermanual/Refresh#Repeater

Try clicking Add/Remove. The consecutive rows should have alternating background colors, but it's not the case.

Because of the old cssClass property is deprecated, the fix for this problem will, for simplicity, add support for refreshing attributes.classList and will remove support for cssClass (will land in non-backward-compatible 1.4.1).

@jakub-g jakub-g referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@jakub-g
Collaborator

There are some problems with deprecating cssClass on Repeater, because the only alternative to cssClass : function is to have attributes : function which will reevaluate more things than just CSS class.

Moreover, since the deprecation was not logged in the console (just in cfgBeans), it will be better to keep the removal of cssClass until the next deprecation period.

@jakub-g jakub-g referenced this issue from a commit in jakub-g/ariatemplates
@jakub-g jakub-g WIP #398 fix attributes.classList, deprecate cssClass in Section and …
…Repeater

This removes deprecated cssClass from Section and Repeater.
Please use attributes.classList instead.

This also fixes the problem where cssClass was properly reevaluated in
Repeater, but attributes.classList was not. Now the cssClass is removed,
and attributes.classList is properly reevaluated on refresh.
df59526
@jakub-g
Collaborator

The test case for this is test.templateTests.tests.features.repeater.RepeaterTestCase which embeds some templates (RepeaterTestOne etc). After changing cssClass to equivalent attributes function in those templates, the test case fails.

@jakub-g jakub-g added this to the 1.5.2 milestone
@jakub-g
Collaborator

This was fixed by #1086

@jakub-g jakub-g closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.