Behaviour controls- Drag/Drop/Resize/Reorder and Cookie

Hi,

I intend to use these controls on a table. Is there anything about the usage of these controls that is not documented and any specific limitations?

Here is a scenario.

The user needs to have the ability to “delete” columns from a table that he is not interested in viewing. There is no “Select Column” control I reckon.
So, I was thinking of a few different ways to achieve this using the tools at disposal.

  • 1. Have a Drag and Drop control for user to Drop unwanted columns into a Hideable Panel in the disguise of a Recycle Bin.
    2. Have a Check Box (or a Toggle CheckBox) in the Column Headers to Hide and that sets the rendered property of the Column to False when checked. We may have to potentially force the user to hit a Reload Table button to refresh the selections. It would be great if this can be avoided.
    3. Allow “Column Reorders” to bring the preferred columns to the first.

What do you suggest based on the features of these controls?

Also, if you know how to save these preferences to a user session cookie, that would be awesome.

Thanks for your response in advance,
Best regards,
Raj

Have you considered using the Search Results portlet? It already contains logic for manipulating the columns and storing the user’s preferences. It might not look exactly like you’re hoping it to look, but it would be a fairly large time savings for you if you could use that template as a starting point.

Regards,
–mark

Hi Mark,

Look and feel are very particular to the customer and unfortunately it takes precedence over the functionality.

BTW, I added Re-Order Columns and what I saw was the following. If there are too many columns that the browser has a horizontal scroll bar, then the columns after the end of the initial browser RHS cannot be dropped, they can be dragged though, but it does not serve the purpose. Is this a known issue?

Secondly, I had difficulty getting both Re-Order Columns and Resize-Columns working on the table.

Thirdly, when any of these controls are on the table, and you sort a column, then I get a NPE in the initialize method.

I have backed out all these features for the moment until I ascertain what works with what and how.

If you are able to get all of these column behaviours working as expected on a very wide table, can you let me know please?

Thank you in advance,
Best regards,
Raj

Well, i’ve had some good results and bad results investigating this issue. I’ve attached a sample that demonstrates reordering a table with twenty columns as well as sorting. Please note, that in the browsers i used, all twenty columns were displayed as well.

However, i was unable to get the Drag to Resize Columns behavior to work properly.

I’ve attached the sample (for 8.x). If you need a fix for the Drag to Resize Columns, please open a Support Incident and refer to this thread.

Regards,
–mark
TableBehaviorApp.zip (10.7 KB)