EasyUI Forum
September 19, 2025, 04:48:37 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: combogrid: hiding rows  (Read 7487 times)
korenanzo
Guest
« on: February 23, 2016, 02:46:56 AM »

Hi,

I have a combo grid loaded with local data.

is it possible to hide the rows that not match with the typed text?

Thanks, RIc
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: February 23, 2016, 07:40:01 AM »

Please try to enable filter on the drop-down datagrid. The 'enableFilter' method is extended from http://www.jeasyui.com/extension/datagrid_filter.php
Code:
$('#cc').combogrid({
//...
}).combogrid('grid').datagrid('enableFilter');
Logged
korenanzo
Guest
« Reply #2 on: February 23, 2016, 08:11:12 AM »

ok,

but I am not sure how to bind the textfield with the filter

for example,
Code:
$('#cc').combogrid({
        delay: 500,
        mode: 'local',
        hasDownArrow: false,
        value: valore,
        idField: 'tb_testo',
        textField: 'tb_testo',

        columns: [[
            {
                field: 'tb_cod',
                title: 'Cod',
            },
            {
                field: 'tb_desc',
                title: 'Desc',
                width: 200
             },
       
            {
                field: 'tb_testo',
                title: 'test',
                hidden: true
            }
    ]],
        data: dati
     

    }).combogrid('grid').datagrid('enableFilter',[{
        field:'tb_desc',
       op:'contains',
       value: ?????
    }]);


what do I must put as value ?

How can I write a filter  if I need to match the text against with more than one column (for example I'd like to check if the typed word is contained in tb_desc OR in tb_testo column)?

thanks,
RIc



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


View Profile Email
« Reply #3 on: February 24, 2016, 12:52:19 AM »

You will have to override the keyHandler.query function to add filter rules according to the typed string.
Please try this example http://jsfiddle.net/xy5nbw2k/2/
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!