Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031255Openbravo ERPA. Platformpublic2015-10-20 12:532015-10-27 10:11
plujan 
alostale 
immediateminoralways
closedfixed 
5
main 
3.0PR15Q43.0PR15Q4 
AugustoMauch
Core
Production - QA Approved
3.0PR15Q3
No
0031255: [PR15Q4] Lazy filtering does not work when filtering the first time
If the first action taken on a grid is to change a filter, applying the filtering does nothing. If first the records are shown, it works as expected.
0. In Grid Configuration set Preference window to do Lazy Filtering on Grid

1. As System Administrator, go to Preference window
2. Click the check button to show the data. It shows the data.
3. Close the window
4. Reopen the Preference window
5. Seek for a preference on the list and check it to have the filter active
6. Click the check button to show the data. It does not work.
   -> js error can be seen in developers tool:
       Uncaught TypeError: this.data.willFetchData is not a function
         isc.OBViewGrid.addProperties.handleFilterEditorSubmit @ abac3df8aa23bfef1d3ab745040cf492.js:2087
7. Refresh the window, the data is loaded unfiltered. Repeat steps 5 and 6 and check that now it works.
A video showing the behaviour:
https://drive.google.com/open?id=0B6HEkyuFoid8SnJJaWpLY0MzQXc [^]
No tags attached.
blocks defect 0031187 closed alostale [PR15Q4] Lazy filtering does not work when filtering the first time 
Issue History
2015-10-27 07:52alostaleTypedefect => backport
2015-10-27 07:52alostaleTarget Version => 3.0PR15Q4
2015-10-27 08:37hgbotCheckin
2015-10-27 08:37hgbotNote Added: 0081325
2015-10-27 08:37hgbotStatusscheduled => resolved
2015-10-27 08:37hgbotResolutionopen => fixed
2015-10-27 08:37hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR15Q4/rev/513d631d2a22e13581ce6d5fe8d2c1263f992fe2 [^]
2015-10-27 08:37alostaleReview Assigned Tocaristu => AugustoMauch
2015-10-27 10:11AugustoMauchNote Added: 0081337
2015-10-27 10:11AugustoMauchStatusresolved => closed
2015-10-27 10:11AugustoMauchFixed in Version => 3.0PR15Q4

Notes
(0081325)
hgbot   
2015-10-27 08:37   
Repository: erp/backports/3.0PR15Q4
Changeset: 513d631d2a22e13581ce6d5fe8d2c1263f992fe2
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Oct 27 08:28:58 2015 +0100
URL: http://code.openbravo.com/erp/backports/3.0PR15Q4/rev/513d631d2a22e13581ce6d5fe8d2c1263f992fe2 [^]

fixed bug 31255: Lazy filtering does not work when filtering the first time

  Having lazy filtering configured, if a filter was applied in a grid as first
  action, it was not possible to apply it. A js error was thrown:
     Uncaught TypeError: this.data.willFetchData is not a function

  The problem was in "if (this.data.willFetchData(this.convertCriteria(criteria)))"
  statement which incorrectly assumed this.data to be an object and willFetchData
  a function within it. This is not true when in this situation where this.data is
  an array.

  It has been fixed by taking into account this case by checking wether this.data
  is an array.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
---
(0081337)
AugustoMauch   
2015-10-27 10:11   
Code reviewed and verified in [1]@513d631d2a22

[1] https://code.openbravo.com/erp/backports/3.0PR15Q4 [^]