Outputting sortable tables from a Static Content Macro

Hi,

I develop a macro which outputs tables onto Confluence pages and I’d like to make the tables sortable like they are with tables manually inserted into Confluence pages.
I know this is achievable using Dynamic Content Macros and AUI or another framework but I don’t want to use a Dynamic Content Macro because those can only be loaded over GET requests which means I cannot get access to the macro body in the preview screen (as the history API returns a 404 because the page hasn’t been saved yet). Whereas Static Content Macros can access the body in preview mode because they can use POST as the renderingMethod and receive the entire body in preview mode regardless of how big it is.
Anyway, is there a way maybe be adding some classes to my table by which the Javascript already running in the Confluence page would detect my table and make it sortable, like manually inserted Confluence tables are?

thanks,

Matt

1 Like