Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ng2-smart-table selectText issue in editor-config for dropdown (Add,Edit) #1279

Open
vikkikrishna opened this issue Jul 1, 2021 · 1 comment

Comments

@vikkikrishna
Copy link

vikkikrishna commented Jul 1, 2021

Hi...
I have tried using ng2 smart table to display the data but the issue is on dropdown to be displayed with placeholder (used default attribute "selectText" in editor -config) on clicking Add New and Edit Action.
Placeholder not working while clicking the Add New action and Edit action on select field.

///Typescript
this.settings = {
edit: {
editButtonContent: '',
confirmSave: true,
},
delete: {
deleteButtonContent: '',
confirmDelete: true,
},
actions: {
position: 'left',
}, attr: {
class: 'table'
},
add: {
confirmCreate: true,
addButtonContent: 'add new', this: this.checking()
},
columns: {
employeeFirstName: {
title: 'First Name*',

    },
    employeeLastName: {
      title: 'Last Name',
    },
    employeeEmail: {
      title: 'Email*',
      editable: false
    },
    role: {
      title: 'Role*',
      type: 'html',
      valuePrepareFunction: (cell, row, companyList) => {

        // this.placeholder();
        let bn = this.userRoleList.find(x => x.value === cell);
        if (bn) {
          return bn.title;
        }
        else {

          return cell;
        }
      },
      editor: {
        type: 'list',
        config: {

          selectText: 'Select',
          list: this.userRoleList

        }
      }
    },
    ageGroup: {
      title: 'Age Group*',
      type: 'html',
      valuePrepareFunction: (cell, row, companyList) => {
        let bn = this.ageGroupList.find(x => x.value === cell);
        if (bn) {
          return bn.title;
        }
        else {
          return cell;
        }
      },

      editor: {
        type: 'list',

        config: {
          placeholder: 'hello',
          selectText: 'Select ID',
          list: this.ageGroupList
          // list: this.industriesList
        }
      }
    },
    experience: {
      title: 'Employer Experience*',
      type: 'html',
      valuePrepareFunction: (cell, row, companyList) => {
        let bn = this.employerExpList.find(x => x.value === cell);
        if (bn) {
          return bn.title;
        }
        else {
          return cell;
        }
      },
      editor: {
        type: 'list',
        config: {
          selectText: 'Select',
          list: this.employerExpList

        }
      }

    },
    gender: {
      title: 'Gender*',
      type: 'html',
      valuePrepareFunction: (cell, row, companyList) => {
        let bn = this.genderList.find(x => x.value === cell);
        if (bn) {
          return bn.title;
        }
        else {
          return cell;
        }
      },
      editor: {
        type: 'list',
        config: {
          selectText: 'Select',
          list: this.genderList

        }
      }
    }

  },
};

selectTextIssue

@vikkikrishna vikkikrishna changed the title selecttext box issue Ng2-smart-table selectText issue in editor-config for dropdown (Add,Edit) Jul 1, 2021
@GabrielBragaGit
Copy link

UP!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants