ag grid infinite row model - Update cellRenderer - pagination

I'm using Infinite Row Model on Ag grid. And I need to be able to update the cellRenderer manually when changing the data on remote. I am currently using the purgeInfiniteCache () method. But it has a very noticeable blink. Would there be any way to update only the row? or update the cache only from the current view?

You could update the record in the cache by getting the rowNode using gridApi and then using updateData method of rowNode.
rowNode = this.gridApi.getRowNode(`${updatedRecord.id}`);
rowNode.updateData(updatedRecord);
However, if you are using this with infinite row model, you need to take care the data you are updating in the cache is same as that on the server. You can do this after receiving save/update success response from the server.

Related

Is it possible to add row data via a callback to tabulator

I need a table that shows about 2.5 million rows from an array that is already created in memory. When I create the table and add the array to the 'data' property, the browser engine runs out of memory after some (significant) time. I assume that tabulator not only creates objects for the current virtual DOM part, but for each entry in the array in advance.
So my question: is it possible to not provide the entire array, but only the the count of rows, and let tabulator ask for the content of each row via a callback only when needed for rendering. Of course it only makes sense if tabulator does not keep any data of rows that are gone out of view.
I know that this might be in conflict with some column calculation features or others, but this would be fine for my use case.
The same use case is working with canvas-datagrid, which I have tried before.
If you can use Ajax to get the data there is the Progressive Ajax Loading that will help you to load data using the pagination module to make a series of requests for part of the data set, one at a time, appending it to the table as the data arrives.
Doc is here: http://tabulator.info/docs/4.3/data#ajax-alter
Progressive loading is an option, but you still are going to run into the issue that you will have two copies of the data in memory. It will either happen automatically if in 'load' mode or manually in 'scroll' mode as you scroll through the table. The best option would seem to be to have code via say a button that loads the data using either setData() or replaceData(). Then the user could fetch either the next or previous set of data in batches.

Updating data on rows deleted event

I have a custom page with a form and a grid. When a row from a grid is deleted, I want to update some other rows. I am therefore handling the rowdeleted event. I confirmed (through debugging) that the event is firing correctly and that the data is being updated correctly.
The only issue I have is that the screen still shows the old values. My delete row correctly disappears but the other rows do not get updated.
For each row that I change, I am calling the Update method of the Data View. However, this still does not refresh the user interface.
Interesting, if I save, all my changes get correctly updated to the database. Which confirms that this is a UI isssue.
Is there any additional step that I need to perform to refresh the user interface? Or should I just avoid doing updates in Row Deleted event?
To guarantee constant optimal performance level, in the end of a roundtrip grids in Acumatica only update currently selected record. This behavior is by default. In case you insert/update/delete other records in the same grid within an event handler or an action delegate, it's always necessary to call View.RequestRefresh() to force the grid to update its entire content instead of only the selected record.
I managed to solve the issue by calling View.RequestRefresh(). However, I am not sure whether this is a standard practice. But I did find it used in several places in the Acumatica code

Trigger not firing for one particular CLOB column

We have a C++ legacy application that connects to an Oracle 11g database. The application uses Microsoft Data Access Objects (DAO) library to allow record browsing and modification. We also have some triggers on tables to track row updates and insertions.
The problem is that the triggers don't fire for the CLOB columns that we have in our tables. It gets fired for other columns but for this one CLOB column, it neither fires during update nor during delete. I've added the trigger for all three: UPDATE, INSERT and DELETE.
Is there some option that manages triggers for CLOBs? Or some other setting that might be affecting this? Any ideas where should I look for a solution?
I found a possible explanation to this non-firing trigger:
Your trigger actually works -- WHEN it is fired!
The problem is -- you are NOT updating the table when you set the lob value. You might be modifying the lob contents but -- and this is key -- you are NOT modifying the lob locator in the table itself. The row values of the table are not changing, the trigger does NOT fire for the dbms_lob.copy (or write, or trim, or append, or ...)
I think the solution proposed here at askTom requires to have a specific procedure but I haven't quite understand it.

When core data is changed, how to update the table view data?

Using NSXMLParser to get data from an xml file on internet with an update button to get update database and store it by using xcode template core data.
However, when I updated all core data, console can only show right data until I quited the app and run it again.
Any way to update all data correctly without quiting the app?
Thanks for that answer.
With using Xcode template (Navigation-based Application with core data), fetchedResultsController and managedObjectContext and so on are all included. Yet, every time I changed xml file and run parser to store data again, both my table view and nslog messege come up with a list of wrong data, eg, list of numbers only while my data contains lots of strings.
Display comes back to normal only I killed and rerun app again.
Any ideas?
Using CoreData the simplest thing to do is to use a NSFetchedResultsController. You can set your view controller to be the delegate for the NSFetchedResultsController, which will give you notifications when your data changes. You can then update your table appropriately.
This tutorial might help: http://www.raywenderlich.com/999/core-data-tutorial-how-to-use-nsfetchedresultscontrolleY

Reverting CoreData data

I have an NSTableView which is populated via a CoreData-backed NSArrayController. Users are able to edit any field they choose within the NSTableView. When they select the rows that they have modified and press a button, the data is sent to a third-party webservice. Provided the webservice accepts the updated values, I want to commit those values to my persistent store. If, however, the webservice returns an error (or simply fails to return), I want the edited fields to revert to their original values.
To complicate matters, I have a number of other editable controls, backed by CoreData, which do not need to resort to this behaviour.
I believe the solution to this problem revolves around the creation of a secondary Managed Object context, which I would use only for values edited within that particular NSTableView. But I'm confused as to how the two MOC would interact with each other.
What's the best solution to this problem?
The easiest solution would be to implement Core Data's undo functionality. That way you make the changes to Core Data but if the server returns the error, you just rollback the changes. See the Core Data docs for details.

Resources