akveo / akveo/ng2-smart-table

add a row from an external form

Open
#1,008 0 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

I have a form in my html , after submitting the form i want to create another entry(row) in my ng2-smart-table

this is my settings
~~~~
settings = {
mode : 'external',
columns: {
Transformation: {
title: 'Transformation', filter: false
},
TableSource: {
title: 'Table_Source', filter: false
},
Colonne: {
title: 'Colonne', filter: false
},
Expression: {
title: 'Expression', filter: false
},
Condition: {
title: 'Condition', filter: false
},
Agg_Function: {
title: 'Agg_Function', filter: false
},
Format: {
title: 'Format', filter: false
},
Table_Hbase: {
title: 'Table_Hbase', filter: false
},
CF: {
title: 'CF', filter: false
},
CN: {
title: 'CN', filter: false
},
}
};
~~~~

and this is my initial source data, this objectc was successfully displayed in the table
~~~~
data= [
{
Transformation: 'test' ,
TableSource: 'test',
Colonne: 'test',
Expression: 'test',
Condition: 'test',
Agg_Function: 'test',
Format: 'test',
Table_Hbase: 'test',
CF: 'test',
CN: 'test'
}
];
~~~~

but when i submit the form, and i push the new informations in data array (the source )
nothing is happened to the ng2-smart-table.
this.source.data contain the new data after the push but nothing displayed aove the initail init.

this how i push the data

~~~~
this.trans={
Transformation: this.transformationSelected ,
TableSource: this.tableSqlSelected,
Colonne: this.colonneSqlSelected,
Expression: this.expression,
Condition: this.condition,
Agg_Function: '-',
Format: '-',
Table_Hbase: this.tableHbasesSelected,
CF: this.colFamilySelected,
CN: this.colname
}
//this was the first alternative
//this.data.push(this.trans)

//this is the second alternative
//this.source.add(this.trans)
~~~~

i don't know what to do, if i want to use a completely external form to add a new data to the smart table

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.