Written by

Question Nezla · Apr 6, 2022

tablePane row selection

Hi Guys,

I've the below tablePane and for some reason when it's populated always the last row is selected by default, I've many tablePanes defined the same way but none of them has the last row selected when populate, so not sure why this grid is doing this? 


<tablePane
    width="1200px"
    id="ItemsTable" 
    OnCreateResultSet="GetLog"
    maxRows="20000" 
    pageSize="20" 
    showRowNumbers="false"
    showRowSelector="false"
    showZebra="false"
    valueColumn="ID" 
    nowrap="false"
    showValueInTooltip="true"
    showFilters="true"
    autoExecute="true"
    initialExecute="false"
    useSnapshot="true" 
    onselectrow="">
<parameter />
<parameter />
<parameter />
<parameter />
<parameter />
<parameter />
<parameter />
    <column colName="Sit" header="Sit name" width="50%" style="text-align:left;" filterType="text" filterOp="[" />
    <column colName="Label"  header="Label" width="10%" filterType="text" filterOp="["/>
    <column colName="userno" header="Packed By" width="10%" filterType="text" filterOp="["/>
    <column colName="LogedDate" header="Packed Date" width="10%" />
     <column colName="LogedTime" header="Packed Time" width="10%" />
    <column colName="TimeSpent" header="Spent Time" width="10%" style="text-align:left;"/>
    
</tablePane>
<tableNavigatorBar tablePaneId="ItemsTable"/>
 

Thanks

Product version: Ensemble 2014.1

Comments

Vitaliy Serdtsev · Apr 7, 2022

We need to look at your full code, since there is nothing suspicious in the specified piece of code. I made a small example and there is no highlighting of the last line:

 

Source code

Class dс.test Extends %ZEN.Component.page
{

XData Contents [ XMLNamespace "http://www.intersystems.com/zen" ]
{
<page xmlns="http://www.intersystems.com/zen">
  <tablePane
      width="1200px"
      id="ItemsTable" 
      OnCreateResultSet="GetLog"
      maxRows="20000" 
      pageSize="20" 
      showRowNumbers="false"
      showRowSelector="false"
      showZebra="false"
      valueColumn="ID" 
      nowrap="false"
      showValueInTooltip="true"
      showFilters="true"
      autoExecute="true"
      initialExecute="false"
      useSnapshot="true" 
      onselectrow="">
  <parameter />
  <parameter />
  <parameter />
  <parameter />
  <parameter />
  <parameter />
  <parameter />
      <column colName="Sit" header="Sit name" width="50%" style="text-align:left;" filterType="text" filterOp="[" />
      <column colName="Label"  header="Label" width="10%" filterType="text" filterOp="["/>
      <column colName="userno" header="Packed By" width="10%" filterType="text" filterOp="["/>
      <column colName="LogedDate" header="Packed Date" width="10%" />
      <column colName="LogedTime" header="Packed Time" width="10%" />
      <column colName="TimeSpent" header="Spent Time" width="10%" style="text-align:left;"/>
    
  </tablePane>
  <tableNavigatorBar tablePaneId="ItemsTable"/>
</page>
}

Method GetLog(
  ByRef pSC,
  ByRef tParams)
{
  sql = 5
  sql(1)="SELECT 0 ID,'Sit' Sit,'Label' Label,'userno' userno,current_date LogedDate,current_date LogedTime,null TimeSpent"
  sql(2)="union"
  sql(3)="SELECT 1,'Sit','Label','userno',current_date,current_date,null"
  sql(4)="union"
  sql(5)="SELECT 2,'Sit','Label','userno',current_date,current_date,null"

  st=##class(%SQL.Statement).%New()
  st.%SelectMode=2
  ##class(%SQL.Statement).%ExecDirect(st,.sql)
}

}
0
Nezla · Apr 7, 2022

Hmm, tried to copy and paste the code or attached the file but it looks like it's too big, how did you upload your code Source Code link?

Thanks

0