ghiscoding / Angular-Slickgrid

Angular-Slickgrid is a wrapper of the lightning fast & customizable SlickGrid datagrid, it also includes multiple Styling Themes
https://ghiscoding.github.io/Angular-Slickgrid
MIT License
392 stars 117 forks source link

Filter Input Field Not Visible #465

Closed zulkifelff closed 4 years ago

zulkifelff commented 4 years ago

Default filters are not showing on the grid. Screenshot (16)

Even though I have enabled filter in gridOptions.

JSON is as follow. gridOptions={ "enableAutoResize": true, "enableSorting": true, "autoEdit": true, "enableColumnReorder": false, "enableCellNavigation": true, "editable": true, "enableColumnPicker": true, "enableFiltering": true, "gridId": "grid1", "gridContainerId": "slickGridContainer-grid1", "enablePagination": false }

columnDefinitions=[ { "field": "Location ID", "id": 16417, "name": "Location ID", "filterable": true, "sortable": true, "minWidth": 132, "filter": {} }, { "field": "Region", "id": 16418, "name": "Region", "filterable": true, "sortable": true, "minWidth": 72, "filter": {} }, { "field": "State", "id": 16420, "name": "State", "filterable": true, "sortable": true, "minWidth": 60, "filter": {} }, { "field": "City", "id": 16421, "name": "City", "filterable": true, "sortable": true, "minWidth": 48, "filter": {} }, { "field": "ZIP Code", "id": 16423, "name": "ZIP Code", "filterable": true, "sortable": true, "minWidth": 96, "filter": {} }, { "field": "Market", "id": 16425, "name": "Market", "filterable": true, "sortable": true, "minWidth": 72, "filter": {} }]

close-issue-app[bot] commented 4 years ago

This issue was automatically closed by our bot because it does not meet our issue template requirements. Please fill in the questions/sections required in the issue template before submitting a new issue. Thank you.

ghiscoding commented 4 years ago

First the order might matter, define the Column Definitions first then the Grid Options. Second, and most probably is your problem, don't defined filter: {} that probably confuses the lib. If you plan to use the default Filter (input text), then you don't need the filter property, just don't put anything there (filterable: true is the only thing you need). When you use filter it's because you're using a Filter that is not the default one and when you do then it requires at the minimum the model property (filter: { model: Filters.compoundInput }) which you didn't do in your case.

Next time please fill in the necessary Issue Template, I don't answer questions/issues that don't have enough info provided and that is why I added this auto-close bot.

Also this kind of question should be asked on Stack Overflow, I don't want to be the only person answering all these questions.

If you like the lib, please upvote ⭐