akveo / akveo/ng2-smart-table

Edit mode: confirm action leaves the table in edit mode

未关闭
#811 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
1.6k
派生
867
PR 合并指标
30 天内没有已合并 PR

描述

Hello, when editing a row inline mode, the row doesn't exit edit mode although data on the server are correctly updated. I don't wanna see input fileds anymore once i confirmed editing.
With cancel action works fine.

It was working fine then suddenly stopped. Any suggestion?

I am loading columns and data dinamically

`
ngOnChanges() {

if (this.buttons.length > 0) {

let columnNumber: number = 0;
let columns: ColumnInterface = {};
let tableData = [];
let data: DataInterface = {};

//add first column
// columns['groupId'] = { title: 'Group ID', filter: false, editable: false }
columns['group'] = { title: 'Group', filter: false, editable: false }
columns['behaviour'] = { title: 'Default Behaviour', filter: false, editable: false }

this.buttons.forEach(button => {

//rimuovo spazi dal nome proprietà
const propertyName: string = button.name.replace(' ', '_');
columns[propertyName] = {
title: button.description + ' (' + button.name + ')',
filter: false,
editable: true,
editor: {
type: 'list',
config: { list: this.scenarios }
}
};
columnNumber++;
});

this.settings = { columns };
this.settings['hideSubHeader'] = true;
this.settings['actions'] = {
add: false,
edit: true,
delete: false
}
this.settings['edit'] = {
editButtonContent: '',
saveButtonContent: '',
cancelButtonContent: '',
confirmSave: true,
mode: 'inline'
}

this.groups.forEach(group => {

data['groupId'] = group.id;
data['group'] = group.name;
data['behaviour'] = group.behaviour;
this.data.push({ ...data });

});

//adding all properties into data structure
this.data.forEach(row => {
this.buttons.forEach(button => {
//replace space
const pName = button.name.replace(' ', '_');
row[pName] = '-';
});
});

this.data.forEach(row => {
this.buttons.forEach(button => {
const pName = button.name.replace(' ', '_');

this.groups.forEach(group => {

button.behaviour.forEach(behave => {

if (group.id === row['groupId'] && group.id === behave.groupId) {
row[pName] = behave.scenario !== null ? behave.scenario : '-';
}

});
});
});
});

this.dataSource = new LocalDataSource(this.data);
}

}
`

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。