Column presets?

Wish to see a specific feature/change in future releases? Feel free to post it here, and if it gets enough "likes", we'd definitely include it in future releases!
Post Reply
dge
Posts: 9
Joined: 2013-12-05 02:54

Column presets?

Post by dge » 2020-02-14 10:55

It's great to have the ability to turn on and off columns. Now we need to make presets so the user can press a button to show and hide certain sets of columns easily, without opening the GUI and clicking them one by one.

Any ideas on how to do this?
David

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 711
Joined: 2018-04-01 10:12

Re: Column presets?

Post by pböttcher » 2020-02-16 20:13

Hi,

you can add to the TABLENAME-tv.js in the hooks folder some code to add you button to there you want an upon click on the button
execute

$j('input[data-col="TABLENAME-FIELDNAME"]').click();

for each field that you want to hide.

dge
Posts: 9
Joined: 2013-12-05 02:54

Re: Column presets?

Post by dge » 2020-02-18 01:47

Thanks very much!

However, I'm not getting it to work. It seems not as simple as entering (in clients-tv.js) $j('input[data-col="clients-dateAdded"]').click();

As well, I would like to trigger groups of fields off/on by clicking buttons. Not sure how to achieve that aspect also.

Alternately, I'm also trying to write the cookies in LocalStorage directly. It seems like a workable method but am having difficulty with getting the exact right data into the cookie. Examining the Appgini generated cookie data in Chrome helps, but somehow can't get it formatted properly for Appgini to read it back.

Any further assistance would be greatly appreciated!

dge
Posts: 9
Joined: 2013-12-05 02:54

Re: Column presets?

Post by dge » 2020-02-18 21:40

Ok, we figured out how to write the appgini cookies in a javascript function:

localStorage.setItem('columns-clients_view', '{"clients-unsubscribe":false,"clients-dateAdded":false,"clients-companyName":true,"clients-EIN":false}');

Substitute your own actual column and table names.
We trigger these functions from buttons on the tableview, so now we have our favorite column presets.

Post Reply