openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

sap.ui.model.FilterOperator.NE is not working

Open SaiVellanki opened this issue 11 years ago • 2 comments

Hi, While using the table binding filter, all the operators were working except Not Equal to i.e., sap.ui.model.FilterOperator.NE Please check the sample here - http://output.jsbin.com/wigisi , code - http://jsbin.com/wigisi/edit?html,js Testing Steps -

  1. Two tables placed, left side Header Data and right side Item Data.
  2. Both the tables have Tracking Number column.
  3. Now on click of Mis-Match button placed down the table, I have to filter the item data tracking number field values which are not matching with header data tracking number field values.
  4. If I use sap.ui.model.FilterOperator.EQ it gives the matched values, but if I use sap.ui.model.FilterOperator.NE it doesn't fetch the unmatched values.
  5. All the FilterOperators are working fine except NE.

Just to add on, I have pointed to SAPUI5 hana cloud version as well, even there it is not working. Please check into the issue and do the needful.

Thank you & Best Regards, Sai Vellanki.

SaiVellanki avatar Sep 29 '15 10:09 SaiVellanki

Hello Sai,

by default if you combine many filters together, they are logically grouped with OR, that makes sense when you do the EQ filter but not for the NE filter where you have to use AND.

I modified the jsbin sample for you with a new syntax and now it should work: http://jsbin.com/lucodurucu/edit?html,js,output

You basically have to create a composite filter and define the logical operator: new sap.ui.model.Filter({ filters: arrayOfFilters, and: true })

Cheers,

Michael

Michadelic avatar Sep 30 '15 14:09 Michadelic

Apologies for raising this as a issue. Thank you Michael! :-)

SaiVellanki avatar Sep 30 '15 16:09 SaiVellanki