Yes, this works if you have one level. But what about if you have second level-something like this:
{
"statuses": [
"SW7=ON, SW6=OFF, SW5=OFF, SW4=OFF, SW3=OFF, SW2=OFF, SW1=OFF",
"Unique Printer ID and Fiscal Memory ID are set",
"The fiscal memory is formatted"
],
"warnings": [],
"errors": [],
"ok": true
}
Hey Neerav,
From the very beginning I understand what you want, but I'm not sure that tablePane is designed to use where clause with runtime expression in the filters . That's why I pointed to you two works around. Here is the third one.
=====================================================================================
{
Property State As %ZEN.Datatype.string(ZENURL = "Home_State");
XData Contents [ XMLNamespace = "http://www.intersystems.com/zen" ]
{
<page xmlns="http://www.intersystems.com/zen">
<tableNavigator tablePaneId="table"/>
<tablePane id="table" width="700" tableName="ZENDemo_Data.Patient"
valueColumn="ID" maxRows="25">
<column colName="ID" width="5%"/>
<column colName="Name" width="30%" filterType="text"/>
<column colName="SSN" width="17%" filterType="text"/>
<column colName="MaritalStatus" width="18%" filterType="text"/>
<column colName="City" colExpression="Home_City" width="25%" filterType="text"/>
<column colName="State" colExpression="Home_State" width="10%" filterType="query"
filterQuery="SELECT DISTINCT Home_State FROM ZENDemo_Data.Patient ORDER BY Home_State"
filterOp="="/>
</tablePane>
<button caption="Filter Value" onclick="zenPage.changeFilterValues();" />
</page>
}
ClientMethod changeFilterValues() [ Language = javascript ]
{
this.getFilterValues();
this.restoreFilters();
zen('table').executeQuery();
}
ClientMethod getFilterValues() [ Language = javascript ]
{
var table = this.getComponentById('table');
var state = table.getColumnFilters();
if (state == null) {
alert('Unable to get filter values!');
}
else {
// save filter state
this.filterState = state;
var p='State'
state[p]='CA'
///state[p]=this.State;
}
}
ClientMethod restoreFilters() [ Language = javascript ]
{
var table = this.getComponentById('table');
if (null == this.filterState) {
alert('No saved filter state found.');
}
else {
table.setColumnFilters(this.filterState);
}
}
}
=====================================================================================
Just replace
with
Vlado
Thank you Eduard.