Comments (15)
Can you provide a demo?
from ngx-datatable.
Interesting, it's something I am currently tring to do. I have a Edit button, and once the edition is complete the data in the datatable doesn't update itself whereas the example here does: https://github.com/DavideViolante/Angular2-Express-Mongoose
If I refresh the page or I search for a term that does not exist and remove it, it seems to "recall" the data somehow and the new value is displayed.
from ngx-datatable.
You need to update your data in the results itself. See this: https://github.com/swimlane/angular-data-table/blob/master/demos/inline-editing.html#L100
Its for ng1 version but still should apply. Open to suggestions on better approaches.
from ngx-datatable.
Thanks for your answer.
Actually, I would like to manually trigger the update, it should not be that hard, right?
I have
this.http.put("/cat/"+cat._id, JSON.stringify(cat), this.options).subscribe(
res => {
this.isEditing = false;
this.cat = cat;
// here I try to update using the function in the constructor
this.route.data.subscribe(data => {
this.temp = [...data];
this.rows.push(...data)
});
this.sendInfoMsg("item edited successfully.", "success");
},
error => console.log(error)
);
but this duplicates all the rows instead of replacing them. Adding this.rows = [];
doesn't seem to help.
Sorry for the flood :)
from ngx-datatable.
Is this getting triggered? https://github.com/swimlane/angular2-data-table/blob/master/src/components/DataTable.ts#L99
from ngx-datatable.
Sorry, I'm really a JS newbie... How can I check it? I added a console.log above it and it did not seem to pass there but I am not sure if the ts code was not cached before.
from ngx-datatable.
Interestingly, if I do
submitEdit(row) {
this.http.put("/cat/"+row._id, JSON.stringify(row), this.options).subscribe(
res => {
this.isEditing = false;
this.row = row;
console.log(this.rows); // <-- this returns all the rows, including the update I just did
this.sendInfoMsg("item edited successfully.", "success");
},
error => console.log(error)
);
}
Since the rows are changed, there must be some kind of event not being emitted properly.
from ngx-datatable.
I have created a simple function:
updateRows() {
console.log('rows updated');
}
then added this in the datatable DOM
<datatable
class='material'
[rows]='rows'
[options]='optionsTable'
(onRowsUpdate)='updateRows()'>
But the event does not seem to get fired when I edit an element. It does at loading, though.
All I need is a reset() function to force the table to reload, or edit a specific row. Any hint on this?
from ngx-datatable.
Splice out the rows and re-insert them.
from ngx-datatable.
That's what I did later, copying the updateFilter function without the filter part, but it just does not work (ie: table not refreshing). I even tried to add an Update button to reload the rows... same result. I also tried to add a ngModelChange in the <datatable>
but I could not get it to work.
from ngx-datatable.
Can you make a plunkr demo?
from ngx-datatable.
It seems to work better than yesterday night, I'll investigate.
Still, after one click it should display the first entry only. You have to click several times to make them all go away.
https://plnkr.co/qoJk25kT0o8MbXistXjE
from ngx-datatable.
+1 for this request. I've got custom template for rows selection/deselection. It calls component functions to get state (is row selected or not). When I change selection it doesn't refresh templates. How can I force it?
note: I update selected
array but it doesn't help...
from ngx-datatable.
Fixed in 0.3.5 :)
from ngx-datatable.
how to over ride default message of ngx-table like
@input() messages: any = {
// Message to show when array is presented
// but contains no values
emptyMessage: 'No data to display',
// Footer total message
totalMessage: 'total',
// Footer selected message
selectedMessage: 'selected'
};
from ngx-datatable.
Related Issues (20)
- Data Clear and Reset blanks rows after horizontal + vertical scroll HOT 2
- [Violation]'requestAnimationFrame' handler took
- Column with [maxWidth] not properly computed after zooming
- Column resize handle missing in body cells
- Regarding bug in ngx-datatable
- Click do not work when ngFor is declared
- frozenright column pinning gives infinity scrolling not give smooth as frozenleft as rebound
- ngx data table doesn't print properly
- Grouping with expansion (default) + external paging.
- Table rows hiding after customizing pagination
- Grouping some rows and reusing the templates
- Variable for selectionType with Typescript is broken
- It is not possible to have border on selected row
- Support for Angular 15.x HOT 1
- Support for Angular 16.x HOT 6
- Is this project dead? HOT 6
- Issue in scroll with rtl direction
- Does Ngx datatable use View Engine or Ivy Engine, is Angular v16 supported?
- Borders dissapear in the rows when i have more than seven columns
- Progress bar loops in the center
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-datatable.