Create the required number of Drop Down boxes and the corresponding text fields in the “Filter_Panel”. For this exercise, 10 Drop Down boxes are required
for ( var j=1; j<v_number_of_filters+1; j++)
{
v_dd[j].removeAllItems();
var res= v_filter_table[j].getDataSource().getResultSet();
if (res.length >= 500)
{
v_dd[j].addItem("many","To many values");
v_dd[j].setSelectedKey("many");
}
else
{
for ( var i=0; i<res.length; i++)
{
v_dd[j].addItem("all","All");
v_dd[j].addItem(res[i][v_level[j]].id,res[i][v_level[j]].description);
v_dd[j].setSelectedKey(v_selectedkey [j]);
}
}
}
// Define the filters to be used and load the description
v_number_of_filters = 10;
v_level [1] ="Continent"; DD_Tx_1.applyText("Continent");
v_level [2] ="Country"; DD_Tx_2.applyText("Country");
v_level [3] ="City"; DD_Tx_3.applyText("City");
v_level [4] ="Company"; DD_Tx_4.applyText("Company");
v_level [5] ="Line"; DD_Tx_5.applyText("Product Line");
v_level [6] ="Category"; DD_Tx_6.applyText("Product Category");
v_level [7] ="Product"; DD_Tx_7.applyText("Product");
v_level [8] ="Sales_Rep"; DD_Tx_8.applyText("Sales Rep");
v_level [9] ="Manager"; DD_Tx_9.applyText("Manager");
v_level [10] ="Order_Id"; DD_Tx_10.applyText("Order Id");
// Define the tables that will be used for the filters
v_filter_table[1] = Table_1;
v_filter_table[2] = Table_2;
v_filter_table[3] = Table_3;
v_filter_table[4] = Table_4;
v_filter_table[5] = Table_5;
v_filter_table[6] = Table_6;
v_filter_table[7] = Table_7;
v_filter_table[8] = Table_8;
v_filter_table[9] = Table_9;
v_filter_table[10] = Table_10;
// Load the Drop Down filters into an array
v_dd [1] = DD_1;
v_dd [2] = DD_2;
v_dd [3] = DD_3;
v_dd [4] = DD_4;
v_dd [5] = DD_5;
v_dd [6] = DD_6;
v_dd [7] = DD_7;
v_dd [8] = DD_8;
v_dd [9] = DD_9;
v_dd [10] = DD_10;
// Add and Define the "All" as DD Item
for ( var i=1; i<v_number_of_filters+1; i++) {v_dd[i].addItem("all","All");}
for ( var j=1; j<v_number_of_filters+1; j++) {v_selectedkey[j]="all";}
// Define the number of CHART to be filtered
v_number_chart = 1;
// Load the CHARTs into an array
v_chart [1] = Cost;
// Define the number of TABLES to be filtered
v_number_table = 1;
// Load the TABELs into an array
v_table [1] = Company;
for ( var i=1; i<v_number_chart+1; i++)
{
v_chart[i].getDataSource().removeDimensionFilter(v_level[Level]);
if (v_selectedkey [Level] !== "all")
{
v_chart[i].getDataSource().setDimensionFilter(v_level[Level],v_selectedkey [Level]);
}
}
for ( i=1; i<v_number_table+1; i++)
{
v_table[i].getDataSource().removeDimensionFilter(v_level[Level]);
if (v_selectedkey [Level] !== "all")
{
v_table[i].getDataSource().setDimensionFilter(v_level[Level],v_selectedkey [Level]);
}
}
for ( var i=1; i<v_number_of_filters+1; i++)
{
v_filter_table[i].getDataSource().removeDimensionFilter(Level);
if (Selected_key !== "all")
{
v_filter_table[i].getDataSource().setDimensionFilter(Level,Selected_key);
}
}
v_selectedkey [1] = DD_1.getSelectedKey();
v_dd [1] = DD_1;
Utils.SET_DIM_FILTERS(v_selectedkey [1],v_level[1]);
Utils.SET_CHART_TABLE_FILTERS(1);
Utils.FILL_DD();
Utils.INIT();
Utils.FILL_DD();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
26 | |
25 | |
21 | |
12 | |
9 | |
8 | |
8 | |
8 | |
8 | |
8 |