akveo / akveo/ng2-smart-table

Edit mode: confirm action leaves the table in edit mode

Offen
#811 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
1.6k
Forks
867
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

}
`

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.