Comments (4)
I was also looking for this method today to automatically mark added rows as edited. When saving changes I collect all rows with edits and send those to the server. To include new rows I now get all rows with changes or Id 0. Maybe that makes more sense anyway, but my first instinct was to just mark a cell as edited when adding the row.
Iβd like to join OP in thanking you for your work on Tabulator. A godsend!
from tabulator.
Hey,
Thanks for the suggestion.
I'm unsure why this would be needed. Cells get marked as edited when a super edits them. If they have not been edited then the flag should not be set. If you are programmatically changing the value of the cell then you already know you have updated it in your code.
Could you please clarify the usage case.
Cheers
Oli
from tabulator.
Sure thing Oli!
I will break down our use case in a couple ways, first as a contrived example similar to the Stackoverflow question linked (which I can see us doing in the future), as well as our current use case.
I believe this boils down to us wanting to implement a table where user edits are mixed with user-triggered programmatic actions, and we want to easily use getEditedCells
to retrieve the changed cells. From the perspective of the user these are all "user" edits, but from the perspective of the developer, the edits made programmatically do not get tracked as a user edit even though it was triggered by a user.
If this is not in scope of Tabulator we will definitely shift to tracking history on our own, but it is super convenient to be able to utilize the history stack, getEditedCells
, other related features of Tabulator and not have to reimplement the same functionality.
Contrived example
JSFiddle: https://jsfiddle.net/nathan_mih/04fxvz7e/
In this example, the table is user editable. It also has a button "Retrieve Machine Reading" to retrieve values from some hypothetical API and set them as the data for a certain column. This acts as a preview for the user, and following this preview of data, they could then click Save to send the data back to the server.
The screengrab below shows the log of the Save button, which simply uses table.getEditedCells()
and loops over the edited cells to then hypothetically send that as a payload to update the data in a database. You can see that the programmatic change is not reflected there, which is intended default behavior as you describe. However this feature request would easily enable us to track the programmatic change as a user edit.
Our current use case
We are building an interactive table that mixes per-cell user-edits with quicker tools to make those edits. I imagine we could provide similar functionality as the contrived example above to allow users to set an entire column of data using a button or input that captures the desired data the user would like to apply to that column, then applies it as an edit to multiple cells at once.
This request comes from a workaround for a solution we implemented for #4398 -- we currently are overriding the clipboardPasteAction
to use cell.setValue
so clipboard changes get tracked as a user edit. With this feature, we would simply be able to add cell.setEdited
and our implementation needs would be very close to complete. If that feature request is something that could be worked on, this request is not as necessary (but I still do see it being useful).
--
Thanks as always for the great library and your quick responses. Let me know if I can clarify more.
from tabulator.
FYI I decided to implement this and opened up a PR #4485
This would be really great to have, it would enable a workaround I have for #4398 as well which I will post in that thread.
from tabulator.
Related Issues (20)
- Tabulator loses sort state with auto columns after page change HOT 2
- Progressive Load: Scroll on Basic Renderer jumps to top while scrolling HOT 2
- Missing event.touches when resizableColumnGuide is set to true and Chrome Dev-Tools are used HOT 1
- Progress bar lost when changing pages with row numbers on.
- persistence of scroll position HOT 4
- old tabulator's header info by autoColumns remains memory after re-create Tabulator HOT 1
- Bulma 1.0 dark mode support HOT 2
- Event Target Lookup Error during cellMouseEnter event HOT 2
- List Editor doesn't highlight the selected element if the value is an integer
- Incorrect context menu opening when scrolling on mobile
- Some editors report edits when blurred with no change, others donβt
- doc - fix typo in Vue 3 setup paragraph
- No way to set a pagination counter when a custom pagination element is in use
- Accessibility (A11y) Improvements for Tabulator Table
- Natural ordering sorter HOT 6
- Display issue with rows in Tabulator during testing
- Horizontal Scroll Position Lost on Header Filter, Header Sort or Pagination Changes (only with Remote Pagination, Filter & Sort) HOT 1
- Load data from HTML which contains attributes `rowspan=1` and `colspan=1` HOT 1
- Filter data by its formatted value HOT 1
- Indentation problem on dynamically added child nodes of a data tree in Tabulator.js 6.2
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 tabulator.