首页 > 解决方案 > 如何根据智能表中下拉列表的选定值显示列中的值

问题描述

我正在使用智能表,并且在一列中有一个下拉列表。基于下拉列表中的选定值,我想在同一行中显示其他列。

variablesList = [
{ value: "1", title: 'A',description: "", response: 'Integer'},
{ value: "2", title: 'B' , description: "", response: 'Boolean'},
{ value: "3", title: 'C', description: "", response: 'Integer' }
];

columnInfo = {
actions: {
edit: true, add: true,
},
columns: {
name: {
title: 'Variables',
filter: false,
type: 'html',
editor: {
type: 'list',
config: {
list:
this.variablesList,
},
}
},
description: {
title: 'Description',
filter: false,
},
response: {
filter: false,
title: 'Response Type',
},
},
attr: {
class: "table table-responsive"
},
edit:{
editButtonContent: ''
},
delete: {
deleteButtonContent: ''
},
};

这是我的智能表。

<ng2-smart-table [settings]="columnInfo" [source]="variableSource">
                </ng2-smart-table>

标签: angularangular7ng2-smart-table

解决方案


我认为目前智能表不可能做到这一点,几周前我正在使用智能表,它无法满足我们的需要,所以我们从头开始制作了一张桌子以满足我们的要求,但为了得到它在功能上使用智能表并不难,但如果您需要/必须使用 ng2-smart-table,我建议在他们的 GitHub 页面https://github.com/akveo/ng2-smart-table上提出问题。


推荐阅读