Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

checkboxes in ng2-smart-table

I am using ng2-smart-table in my project, I want to add a column with checkboxes which while rendering will be checked based on the object which binds the table. In the object, there is a field with a boolean value which will determine if the checkbox will be checked or not, and after making changes in the checkboxes, the changed values should be available.

like image 478
manish sharma Avatar asked Aug 31 '25 16:08

manish sharma


1 Answers

You need to set filter type checkbox

passed: {
    title: 'Passed',
    filter: {
      type: 'checkbox',
      config: {
        true: 'Yes',
        false: 'No',
        resetText: 'clear',
      },
    },
  },

in your data you need to pass checkbox value

data = [
{
  id: 4,
  name: 'Patricia Lebsack',
  email: '[email protected]',
  passed: 'Yes',
},
]

Try this example Checkbox, Select and Completer filter types

like image 185
shamim khan Avatar answered Sep 07 '25 08:09

shamim khan