+ Start a Discussion
Niraj Kr SinghNiraj Kr Singh 

Dynamic Table to add/remove no.of columns and position of column will be changeable

My requirement is like that:
1. We can add/remove any no.of column in table.
2. Position of column should be changable and in sorting order on tha basis of value in column/cell.

Please suggest some idea/workaround on it.
Hi Niraj,
You can use fieldsets to dynamically change columns to add and remove from your VF page, position of the column is controlled by your fieldset so you dont need to rely on any sorting.
<apex:repeat value="{!$ObjectType.Account.fieldsets.<FieldsetName>}"  var="fieldValue" >
 <apex:column value="{!c[fieldValue]}" onclick="selectedRow('{!c.Id}');highlightElem(this);">

Fahad Akhtar