Jump to content
We've recently updated our Privacy Statement, available here. ×

How set filters form the external website


Saurabh Dixit

Recommended Posts

This may be implemented when you are loading the web player analysis using the Web player javaScript API as documented below:

https://community.spotfire.com/wiki/tibco-spotfire-javascript-api-overview

Example implementation:

function SetFiltersTest() {

 

var filterVal = ["ABW"];

//alert(filterVal);

 

var filterColumns = new Array();

filterColumns[0] = {

 

filteringSchemeName: "Filtering scheme",

 

dataTableName: "World Bank Data",

 

dataColumnName: "Country Code",

 

//filteringOperation: spotfire.webPlayer.filteringOperation.ADD,

 

filterSettings: {

 

values: filterVal,

 

includeEmpty: false

}

}

filterColumns[1] = {

 

filteringSchemeName: "Filtering example",

 

dataTableName: "World Bank Data",

 

dataColumnName: "Country Name",

 

filterSettings: {

 

includeEmpty: false,

 

values: ["Angola"]

}

}

 

 

alert("SetFiltersTest !!");

_analysisDocument.filtering.setFilters(filterColumns, spotfire.webPlayer.filteringOperation.REPLACE);

 

}

Link to comment
Share on other sites

  • 1 year later...

I've tried using the same method to set the range on a date range filter but doesn't seem to be working. Any suggestions 

 

    function SetFilterValues1() {
                                   var filterColumns = new Array();
                                   filterColumns[0] = {
                                       filteringSchemeName: 'Filtering scheme',
                                       dataTableName: 'CustomQuery',
                                       dataColumnName: 'DB_LoadDate',
                                       filterSettings: {

                                           highValue:'12/03/2019',
                                           lowValue: '12/05/2019'


                                       },
                                       filterType: 3
                                   }
                                 //console.log(mysel);
                                 console.log(filterColumns)
                                       viewOne0.filtering.setFilters(filterColumns,2);
                                       console.log('test2');
                               }

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...