Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

Closed
jakub-g opened this Issue Feb 28, 2013 · 3 comments

Comments

Projects
None yet
1 participant
Collaborator

jakub-g commented Feb 28, 2013

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).

Collaborator

jakub-g commented Feb 28, 2013

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 added a commit to jakub-g/ariatemplates that referenced this issue Feb 28, 2013

@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
Collaborator

jakub-g commented Mar 15, 2013

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 Dec 18, 2014

Collaborator

jakub-g commented Dec 18, 2014

This was fixed by #1086

@jakub-g jakub-g closed this Dec 18, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment