HI All,
I am using Jsf 2.0 and Primefaces 3.0.
I want to add Visual indicator in datatable sortable column. All columns are sortable in datatable. Visual indicator mean different style to the column which is sorting the datatable.
Please advice.
Regards,
Saurabh Bansal
Visual Indicator in Primefaces Datatable Sortable Column.
- andyba
- Expert Member
- Posts: 2473
- Joined: 31 Mar 2011, 16:27
- Location: Steinfeld, near Bremen/Osnabrück, DE
- Contact:
If you setup the facet header column for sorting as demonstrated in the showcase then the markers will appear automatically.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Don't understand your case, datatable displays sort arrow icons and applies ui-state-active to the sorted column header already.
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Oh ok, there is nothing built-in for that and probably won't be.
Hi all,
Thanks for the response.
There is inbuild function for visual indicator in datatable header but when datatable loads for the first time then there is no visual indicator for the column which is sorting the table by default. I need to add visual indicator for this default column.
Please advice.
Regards,
Saurabh Bansal
Thanks for the response.
There is inbuild function for visual indicator in datatable header but when datatable loads for the first time then there is no visual indicator for the column which is sorting the table by default. I need to add visual indicator for this default column.
Please advice.
Regards,
Saurabh Bansal
Hi,
that's strange!!! I am using many datatables without problem. Please, use #{col2} instead of col2. I am highlighting lazy attribue, in case primefaces use sortBy only for that mode.
my code:
<p:dataTable id="tblGaming" var="instance" value="#{gamingAction.model}"
paginator="true"
rows="10"
dynamic="true"
styleClass="blue"
lazy="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink}
{PreviousPageLink} {PageLinks} {NextPageLink}
{LastPageLink} {RowsPerPageDropdown}"
paginatorPosition="bottom"
rowsPerPageTemplate="10,20,50"
sortBy="#{cpndate}"
sortOrder="descending"
>
<p:column headerText="#{i18n['gamingTrns.channel']}" sortBy="#{channel_id}">
...
</p:column>
<p:column style="text-align:right;" headerText="#{i18n['gamingTrns.date']}" sortBy="#{cpndate}">
...
</p:column>
.......
Primefaces 3.0.RC1-SNAPSHOT, liferay 6.0.5
Vassilis
that's strange!!! I am using many datatables without problem. Please, use #{col2} instead of col2. I am highlighting lazy attribue, in case primefaces use sortBy only for that mode.
my code:
<p:dataTable id="tblGaming" var="instance" value="#{gamingAction.model}"
paginator="true"
rows="10"
dynamic="true"
styleClass="blue"
lazy="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink}
{PreviousPageLink} {PageLinks} {NextPageLink}
{LastPageLink} {RowsPerPageDropdown}"
paginatorPosition="bottom"
rowsPerPageTemplate="10,20,50"
sortBy="#{cpndate}"
sortOrder="descending"
>
<p:column headerText="#{i18n['gamingTrns.channel']}" sortBy="#{channel_id}">
...
</p:column>
<p:column style="text-align:right;" headerText="#{i18n['gamingTrns.date']}" sortBy="#{cpndate}">
...
</p:column>
.......
Primefaces 3.0.RC1-SNAPSHOT, liferay 6.0.5
Vassilis
-
- Information
-
Who is online
Users browsing this forum: No registered users and 60 guests