Question
· Jun 25, 2021

clear selection tablepane

Hi guys,

 

how to clear selection in a table pane?

 

Thanks

Product version: Ensemble 2014.1
Discussion (4)1
Log in or sign up to continue

Simple sample:

Class dc.test Extends %ZEN.Component.page
{

XData Contents [ XMLNamespace "http://www.intersystems.com/zen" ]
{
<page xmlns="http://www.intersystems.com/zen">
  <tablePane
    id="tp"
    sql="select ID,'Western branch' Branch,{'2021-03-15'&quot;Date&quot;,35 Suma
    union
    select 2,'Eastern branch',{'2020-12-11'},37"
  />
  <button caption="Row unselect" onclick="zenPage.rowUnselect()"/>
</page>
}

ClientMethod rowUnselect() [ Language = javascript ]
{
  var tp=zen('tp');
  row=tp.selectedIndex;

  if (tp.rowSelect && row>=0) {
    var old=tp.enableToggleSelect;

    tp.enableToggleSelect=true;
    tp.selectRow(row);
    tp.enableToggleSelect=old;
  }
}

}