akveo / ngx-admin

Customizable admin dashboard template based on Angular 10+
https://akveo.github.io/ngx-admin/
MIT License
25.26k stars 7.96k forks source link

ng2-smart-table dropdown filter or editor gets bigger than text inputs. #1827

Open mkhoshnasib opened 6 years ago

mkhoshnasib commented 6 years ago

Hi everyone. I'm facing an styling issue on ng2-smart-table.

Issue description

When setting.column.filter.type or setting.column.editor.type set to list, the size of dropdown gets bigger than text inputs like image below. image

Steps to reproduce: Simply changing type to list like this.

settings: {
   columns: {
      age: {
        title: 'Age',
        editor: {
          type: 'list',
          config: {
            selectText: 'Select',
            list: [
              {value: '1', title:'Option 1'},
              {value: '2', title:'Option 2'},
              {value: '3', title:'Option 3'},
              {value: '4', title:'Option 4'},
            ],
          },
        }
        filter: {
          type: 'list',
          config: {
            selectText: 'Select',
            list: [
              {value: '1', title:'Option 1'},
              {value: '2', title:'Option 2'},
              {value: '3', title:'Option 3'},
              {value: '4', title:'Option 4'},
            ],
          },
        },
      },
   }
}

I fixed this problem using these CSS:

.ng2-smart-filter select {
  height: calc(2rem + 4px) !important;
  padding: 0 10px !important;
}

table-cell-default-editor select-editor select {
  height: calc(2rem + 8px) !important;
  padding: 0 10px !important;
}

and here is the result. screenshot1

but I'm not sure if it's the best way.

I will be very happy if I know that how can I fix this issue on main project.

cerkiner commented 6 years ago

+1. Thanks for the hack.

jchavarria1983 commented 5 years ago

I need to create a multi select when add new row, Someone have implemented that ?

mkhoshnasib commented 5 years ago

In the below code the editor part will do that.

settings: {
   columns: {
      age: {
        title: 'Age',
        editor: {
          type: 'list',
          config: {
            selectText: 'Select',
            list: [
              {value: '1', title:'Option 1'},
              {value: '2', title:'Option 2'},
              {value: '3', title:'Option 3'},
              {value: '4', title:'Option 4'},
            ],
          },
        }
        filter: {
          type: 'list',
          config: {
            selectText: 'Select',
            list: [
              {value: '1', title:'Option 1'},
              {value: '2', title:'Option 2'},
              {value: '3', title:'Option 3'},
              {value: '4', title:'Option 4'},
            ],
          },
        },
      },
   }
}
jchavarria1983 commented 5 years ago

it is a select but i need the ability user can select multiple options

hdahrouch commented 5 years ago

@mkhoshnasib i have the same problem , could you please explain where did you put the CSS code to resolve the issue . thanks

kgrigorian commented 5 years ago

having the same issue

varmamkm commented 5 years ago

i have the same issue. can you please share the complete css @mkhoshnasib

AbdallahAbdedaiem commented 4 years ago

In my rows, I only see the value, I wan't to show the title instead for my select field. how???