0
votes

My underlying view is sorted on the categorized column. I have selected this column to sort on. There is not really a column header in the view for a category.

Any way around this? Maybe put a button that would switch the sort programmatically?

<xe:dataView 
            id="dataView1" 
            style="margin-top:55.0px"
            openDocAsReadonly="true" 
            var="entry" 
            rows="25" 
            columnTitles="true"
            showCheckbox="true" 
            showHeaderCheckbox="true">
            <xe:this.data>
                <xp:dominoView var="view1"
                    databaseName="scoApps\Spectrum\cashmarkData.nsf"
                    viewName="(view01)"
                    search="#{javascript:return sessionScope.searchString}"
                    sortColumn="author" />
            </xe:this.data>
            <xe:this.summaryColumn>
                <xe:viewSummaryColumn 
                    columnName="subject"
                    columnTitle="Subject" />
            </xe:this.summaryColumn>
            <xe:this.categoryColumn>
                <xe:viewCategoryColumn 
                    columnName="author"
                    columnTitle="Author" 
                    style="font-weight:bold;font-size:14pt" />
            </xe:this.categoryColumn>
            <xe:this.extraColumns>
                <xe:viewExtraColumn 
                    columnTitle="Date Created"
                    columnName="creationDate" 
                    headerStyleClass="xspDataViewColumn150"
                    styleClass="xspDataViewColumn150" />
            </xe:this.extraColumns>
            <xp:this.facets>
                <xe:pagerExpand 
                    id="pagerExpand1" 
                    xp:key="pagerTopLeft"
                    partialExecute="true" 
                    partialRefresh="true" 
                    for="dataView1">
                </xe:pagerExpand>
                <xp:pager 
                    layout="Previous Group Next"
                    partialRefresh="true" 
                    id="pager1" 
                    xp:key="pagerBottomLeft"
                    partialExecute="true" />
                <xp:scriptBlock id="scriptBlock2"
                    xp:key="pagerBottom">
                    <xp:this.value><![CDATA[$("table.dataview").addClass("table-striped table-hover table-bordered table-condensed")]]></xp:this.value>
                </xp:scriptBlock>
            </xp:this.facets>
        </xe:dataView>
1
can you not make the sortColumn rely on a sessionScope variable and if not set, it is author, but if you click the header it will set the sessionScope and refresh the the data viewFrank van der Linden

1 Answers

0
votes

I have done it before with a DataTable. In my column I set the sort column via a link

<xp:column id="column9">
                    <xp:this.facets>
                        <xp:div id="div8" xp:key="header" styleClass="team">
                            <xp:link escape="true" text="Team" id="link7" styleClass="sort">
                                <xp:eventHandler event="onclick" submit="true"
                                    refreshMode="partial" refreshId="dataTablePanel">
                                    <xp:this.action>
                                        <xp:executeScript>
                                            <xp:this.script><![CDATA[#{javascript:viewScope.sortColumn = "Team"}]]></xp:this.script>
                                        </xp:executeScript>
                                    </xp:this.action>
                                </xp:eventHandler>
                            </xp:link>
                        </xp:div>
                    </xp:this.facets>
                    <xp:text escape="true" id="computedField14">
                        <xp:this.value><![CDATA[#{javascript:entry.getColumnValue("Team")}]]></xp:this.value>
                    </xp:text>
                </xp:column>

And in my DominoView datasource I compute the sortColumn by

sortColumn="#{javascript:viewScope.get("sortColumn")}"

The refreshId point to a panel around my DataTable