Uploaded image for project: 'Community Dashboard Editor'
  1. Community Dashboard Editor
  2. CDE-802

Export Button gets wrong results when tables use input html tags other than filter's one

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Severity: Medium
    • Resolution: Fixed
    • Affects Version/s: 15.06.30
    • Fix Version/s: 6.1.0 GA, 6.1-16.08.18
    • Component/s: None
    • Labels:
      None
    • Environment:
      Pentaho 5401 - EE, CTools core stack 150630
    • Story Points:
      0
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.
    • Browser:
      Google Chrome 32.x
    • Operating System/s:
      Mac OSX Yosemite
    • Steps to Reproduce:
      Hide
      • define a table using inputs (either with addIns or a custom input pagination, etc);
      • define CDE property "Show Filter" as false;
      • connect an export button to that table;
      • assure your input(s) have truthy values;
      • clear all caches relevant to query output;
        -> though no filter selection has been made; CDE will extend query parameters with some wrong values as a result of dataTables' options inspection.
      Show
      define a table using inputs (either with addIns or a custom input pagination, etc); define CDE property "Show Filter" as false; connect an export button to that table; assure your input(s) have truthy values; clear all caches relevant to query output; -> though no filter selection has been made; CDE will extend query parameters with some wrong values as a result of dataTables' options inspection.

      Description

      When exporting tableComponent's query output, export button looks-up for table's filtering settings. When doing it, it will select the filter's input value based on a too loose jquery selector (see exportButton "getFilterSettings" method, quoted below): it looks on every input html tag, under the CDE component's htmlObject (var searchInput = component.ph.find('input'); ). In cases where the table has inputs other than the filter input; their values will be wrongly identified as filtering values, based on which the query will be filtered, leading to wrong exported results.

                • Quote of getFilterSettings method definition:

      //add filtering to export if it's a data table
      getFilterSettings: function(component){
      var extraSettings = {};
      if(component.type == "Table"){
      //var dtOptions = component.getTableOptions(component.chartDefinition);
      //if(dtOptions.bFilter) {
      var dtOptions = component.ph.dataTableSettings[0];
      if(dtOptions.oFeatures.bFilter) {
      var searchInput = component.ph.find('input');
      if(searchInput) {
      extraSettings.dtFilter = searchInput.val();
      if(dtOptions.aoColumns){
      var idxs = [];
      for(var i=0; i< dtOptions.aoColumns.length;i++){
      if(dtOptions.aoColumns[i].bSearchable)

      { idxs.push(i); }

      }
      extraSettings.dtSearchableColumns = idxs.join(',');
      }
      }
      }
      }
      return extraSettings;
      }

      });

        Attachments

          Activity

            People

            • Assignee:
              eteixeira Emanuel Teixeira
              Reporter:
              bsilva Bruno Silva (Inactive)
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: