akveo / akveo/ng2-smart-table

Edit mode: confirm action leaves the table in edit mode

Open
#811 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.6k
Forks
867
PR merge metrics
No merged PRs in 30d

Description

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);
}

}
`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.