pratik227 / quasar-qgrid

QGrid is a Quasar App Extension. It allows you to filter data for each column, Drag and Drop Rows and also allows you to filter data using header filters.
https://next-quasar-qgrid.netlify.app/
MIT License
112 stars 90 forks source link

Column filtering per specific columns #58

Closed AlguerGalceran closed 2 years ago

AlguerGalceran commented 2 years ago

Hi trying to have column filtering in specific columns, not in all the columns and can't work it out. Is it possible to active column filtering just for specific columns and not all at once? Thanks is advance!

pratik227 commented 2 years ago

Ok,

But it will not look good in the each column filter if ther rest of the columns is blank. I think we can add this only in Header Filter.

AlguerGalceran commented 2 years ago

The think is that you would have the filters in majority of the columns apart of 1 or 2 columns that contain buttons, checkboxes etc that shouldn't be filtered. Thanks!

pratik227 commented 2 years ago

Try newer version. It will only work with Header Filter.

You can pass show_filter:true in columns array if you want to show the filter button.

[
  {
    name: 'name',
    required: true,
    label: 'Dessert (100g serving)',
    align: 'left',
    field: 'name',
    sortable: true,
    show_filter:true,
  },
  {name: 'calories', align: 'center', label: 'Calories', field: 'calories', sortable: true},
  {name: 'fat', label: 'Fat (g)', field: 'fat', sortable: true},
  {name: 'carbs', label: 'Carbs (g)', field: 'carbs'},
  {name: 'protein', label: 'Protein (g)', field: 'protein'},
  {name: 'sodium', label: 'Sodium (mg)', field: 'sodium',
    show_filter:true},
  {
    name: 'calcium',
    label: 'Calcium (%)',
    field: 'calcium',
    sortable: true,
    sort: (a, b) => parseInt(a, 10) - parseInt(b, 10)
  },
  {
    name: 'iron',
    label: 'Iron (%)',
    field: 'iron',
    sortable: true,
    sort: (a, b) => parseInt(a, 10) - parseInt(b, 10)
  }
]

<q-grid :data="data" :columns="columns" :header_filter="true"></q-grid>

Version - quasar-ui-qgrid@1.0.14

AlguerGalceran commented 2 years ago

Thanks