Search code examples
slickgrid

Reg: Placeholder in the search box


I have created a slickGrid APP and want to have placeholders in the search box. I can see an example in the Angular version of the slickgrid, yet couldnt see its code. I am however using the Javascript version.My APP

Angular example online - couldnt find its code though

Can someone help?

Thank you, B


Solution

  • Check out http://6pac.github.io/SlickGrid/examples/example-header-row.html as an example.

    The filter boxes are created using:

    grid.onHeaderRowCellRendered.subscribe(function(e, args) {
        $(args.node).empty();
        $("<input type='text'>")
           .data("columnId", args.column.id)
           .val(columnFilters[args.column.id])
           .appendTo(args.node);
    });
    

    So just add the 'placeholder' attribute to the box, eg:

    <input type="text" name="fname" placeholder="First name">