Add custom action button - ng2-smart-table

后端 未结 1 527
星月不相逢
星月不相逢 2021-02-15 04:26

I\'m trying to add a button to custom action, but a new column is not added in the action, making the button overlap with the others.

Code:

settings = {
         


        
1条回答
  •  礼貌的吻别
    2021-02-15 04:58

    you can try this. change your setting to:

    settings = {
    hideSubHeader: true,
    actions: {
      custom: [
        {
          name: 'yourAction',
          title: ''
        },
        {
          name: 'editAction',
          title: ''
        },
        {
          name: 'deleteAction',
          title: ''
        }
      ],
      add: false,
      edit: false,
      delete: false
    }
    ...
    };
    

    then add this into your component.scss

        :host /deep/ ng2-st-tbody-edit-delete {display: flex !important;
      height: 0 !important;
    }
    
    :host /deep/ ng2-st-tbody-custom a.ng2-smart-action.ng2-smart-action-custom-custom {
      display: inline-block;
      width: 50px;
      text-align: center;
      font-size: 1.1em;
    }
    
    :host /deep/ ng2-st-tbody-custom a.ng2-smart-action.ng2-smart-action-custom-custom:hover {
      color: #5dcfe3;
    }
    

    0 讨论(0)
提交回复
热议问题