How to order the columns(fields) of a table

I have a requirement to create a rolling 12 month table of data.  The question is on how to order the columns.  

Where current month is April 2017

The columns currently display data like so…
January, Feb, March, April, May, June, July, August, Sept, Oct, Nov , Dec

But it should display
May, June,July,Aug,Sept,Oct,Nov,Dec, January, Feb, March, April

Is there a way to manipulate the columns prior to rendering?

You want the columns to dynamically render in order next month, next month + 1, next month + 2 … ?

If so, fairly certain this can be done with snippet, just not sure how.

Jaime,

You may be able to handle this need using Aggregate models and Model Lookup formula fields.  I think it would depend upon the data that you need to show.  For example, you can build an aggregate model using ‘THIS_MONTH’ as the condition on a date field.  You can build a second using ‘LAST_MONTH’ as the condition; etc.  Then use a Model Lookup field to pull in the ‘LAST_MONTH’ data as a column with ‘THIS_MONTH’.  You might be able to use an Aggregate model for the column labels as well.

Let me know if this makes sense.

Thanks,

Bill

this is what I’m trying to accomplish.

Where is data coming from? A field on the record?

It’s coming from a field on the record. tks

Got it. Then a snippet for sure imho. :slight_smile:

ok…now where do I start? :slight_smile:

how do you order the columns?  

That’s the thing. I dunno. At least not right now. But, there hasn’t much of anything that couldn’t be done. Just too much to do right now for me to take a swing at it. Sorry. :frowning:

thanks for the response!

Jaime,

The ‘snippet’ is the way to go.  I can think of 2 approaches.  One approach is to manipulate the Personalization framework to reorder the columns.  I am not sure if Skuid provides any APIs that you can use.  The other ‘more standard’ approach is to create a custom component–even if its just a 1 page component where you dynamically create the ‘Skuid table’ XML.  You really just need to change the order of the columns based on the current month.

Thanks,

Bill

hey Bill can you expand on this a bit more?

1-personalization framework

2-dynamically create a skuid table


thanks!

Jaime,

1-personalization framework - In the Brooklyn release, Skuid allows users to modify the order of the columns that show on a table component.  My thinking is that you should be able to override these settings on the page that shows your table.  I don’t know if Skuid allows you to change these settings on the page.  I saw this on the community:  https://community.skuid.com/t/personalization-settings.  It appears that you can’t change the object directly.

2-dynamically create a skuid table - I am pretty sure this will work, but it’s an all Javascript solution.  You create a Skuid component that decides what order to display the columns, builds the XML for the table component and then renders it to the screen.  If you only need this on one Skuid page, then you can create a single page component.  If not, then you would want to create a ‘full’ Skuid component that would show in the page builder that you could drop onto any page you build.

3- add 12 tables to your page - Since it appears you have the columns of data you need on your object, you should be able to add 12 tables to your page and conditionally show only 1 based on the current month.  Setup a UI only model with a formula field that grabs the Month from Today’s date.  Use this field to show the appropriate table.

Thanks,

Bill

thanks Bill....


3- seems like the easiest to do just not a clean solution

2- I'm thinking that I may be able to build an table using parts of this tutorial

 http://help.skuid.com/m/11720/l/228794-dynamic-creation-of-models-and-components-with-javascript#!prettyPhoto