Vladimir is an Avid Reader. No contributions for 2024.
Without a doubt, there will be something to
share on the Community in 2025!
User bio
404 bio not found
Member since Nov 7, 2018
Posts:
Vladimir has not published any posts yet.
Replies:

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.

=====================================================================================

Class ZENMVC.MVCMasterDetail3 Extends %ZEN.Component.page
{

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 

state[p]='CA' 

with

state[p]=this.State;

Vlado

Certifications & Credly badges:
Vladimir has no Certifications & Credly badges yet.
Global Masters badges:
Vladimir has no Global Masters badges yet.
Followers:
Vladimir has no followers yet.
Following:
Vladimir has not followed anybody yet.