function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Niraj Kr SinghNiraj Kr Singh 

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

Hi, 
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.
Fahad-AkhtarFahad-Akhtar
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);">
  </apex:column>
</apex:repeat>


Thanks,
Fahad Akhtar