EasyUI Forum
October 31, 2025, 03:42:44 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: inverted filter  (Read 6847 times)
madstudio
Newbie
*
Posts: 8


View Profile
« on: October 22, 2015, 06:53:30 PM »

Is it any possible way to get an inverted selection filter (everything but not the selection on combogrid)  to display result on datagrid ?
My apologies to ask something probably easy for experts, but after several hours, I've realized is not my case.

 
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 22, 2015, 08:03:32 PM »

You can call 'getValues' method to get all the selected values on the combogrid. To get all the unselected rows, please try this:
Code:
var cc = $('#cc');  // the combogrid object
var opts = cc.combogrid('options');
var values = cc.combogrid('getValues');
var rows = [];
$.map(cc.combogrid('grid').datagrid('getRows'), function(row){
if ($.inArray(row[opts.idField], values) == -1){
rows.push(row);
}
});
console.log(rows)
Logged
madstudio
Newbie
*
Posts: 8


View Profile
« Reply #2 on: December 17, 2015, 07:31:53 PM »

Thank you for the answer, but it did't really work.

What I am trying to achieve is if you select for instance "Apples" in the filter, then you Datagrid display everything except the rows that contains the word "Apples"

Or In my real scenario , I need to hide rows that contains numbers between 0 and 999 in a certain column called "CODE"
Cheers!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!