简体   繁体   中英

Hiding the SlickGrid filters for certain field

I am very new to javascript . I was working in a application where i need to use the slick grid with the filter . i was following this link http://mleibman.github.com/SlickGrid/examples/example-header-row.html . in my app , i dont want filter to be in all fields , only for certain field i need .

could anyone help me on this.

    this.grid.onHeaderRowCellRendered.subscribe(function(e, args) {
    $(args.node).empty();
    if(args.column.id == 'name' || args.column.id == 'contract'){
        var s = $("<input type='text'>");
        s.data('columndata', args.column.id)
        .val(columnFilters[args.column.id])
        .appendTo(args.node);
        console.log(s);
    };
    });

will appear only for columns with id 'name' and 'contract'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM