Aller au contenu. | Aller à la navigation

Outils personnels


Vous êtes ici : Accueil / Articles / AJAX ordering from contents tab

AJAX ordering from contents tab

Par Vincent Fretin publié 14/12/2008 15:36, Dernière modification 14/12/2008 15:40
How to activate AJAX ordering in your folderish content type.

This a reply to Josh Johnson blog post AJAX Ordering In AT Content Types.

One of my customer said he can reorder his files at the Plone root, but not in my folderish content type. I tried to understand why, but I finally gave up by lack of time.

A few days later, I found there was a <<ordered>> stereotype in archgenxml. I tested to find out what it does. And that's it. If you add this stereotype to your folderish content type (my content type is called RendezVous), instead of:

RendezVous_schema = BaseFolderSchema.copy() + \

class RendezVous(BaseFolder, BrowserDefaultMixin):
    schema = RendezVous_schema

You have:

RendezVous_schema = OrderedBaseFolderSchema.copy() + \

class RendezVous(OrderedBaseFolder, BrowserDefaultMixin):
    schema = RendezVous_schema

And now you can reorder items from the contents tab!