Updating ag-grid with new data after new table load with React - react-redux

I'm using React and I have a navigation component that updates a Redux table state. Based on the table chosen in the navigation, I need the ag-grid to update accordingly.
I have six tables. Three of them have the same column definitions. I'm currently using onNewColumnsLoaded to refresh the data, but because three of the tables have the same column definitions, nothing's loading. I've tried onColumnEverythingChanged and other column options, but again because the columns are the same nothing is happening.
I've tried rowDataChanged, rowDataUpdated, and componentStateChanged, but those refresh the data if I'm scrolling or filtering, so those are not acceptable options.
I've taken a look at this answer, but it's using plain javascript, and this one has a problem in the css, not in the javascript.
What's the best way to have the grid update programmatically based on Redux state variables?

You can check to use immutableData with directly udpate the rowData:
getRowNodeId
method should be implemented as well.
Check the doc for more detail.

Related

How to get data from server in Nativescript gridview?

I am able to load data from sqlServer using mat table in angular, but have no clue how to do same in nativescript?. I think GridView will work,but cant find source to load dynamic data.
If GridLayout is what you mean by GridView, it's just layout not responsible for loading data.
If you are looking to load list of items on screen, then ListView is what you need. If you like to show table kind of layout with multiple columns then you must design your item template with a GridLayout.
If you go with RadListView, you have different layouting option too.

How to refresh a stacktable js after underlying table is filtered in mobile

I am using dc.js and crossfilter.js to make a dashboard. When moving to mobile I turn the data table responsive with stacktable. However in mobile when I click on various filters, the stacktable doesn't update since it is a copy of the underlying table. Is there a way to refresh a stacktable based on the main table. Or remove stacktable and add again to reflect the newest table.
I'm not familiar with stacktable.js but my guess is that it isn't noticing when d3 modifies the table underneath it (which is good because there are a lot of modifications).
My guess is to reinitialize stacktable each time the dc.js data table is redrawn. You can use the pretransition event for this. (A number of the other events could work, too, but this seems simplest.
Something like:
dataTable.on('pretransition', function(chart) {
$('#your-data-table').stacktable({your options});
});

Accessing the whole table when using the tablesorter and tablesorterPager jQuery plugin

I am using the tablesorter and tablesorterpager plugin and I really like it.
http://tablesorter.com/docs/
http://tablesorter.com/docs/example-pager.html
However I need help with a problem I have. I use checkboxes for every row in a table for selecting items. I also have a “select all” checkbox in the table header.
When looking at the pager script I understand that the plugin completely removes all the table rows from the DOM and only renders the visible rows, the rest of the table is cached.
So when using code similar to this:
$("#theTable").find("input[name='cbitems']:not(:disabled)").each(
I will only get elements currently visible. Not elements in "hidden" pages.
So my question is; is there anyway to make the cached table accessible?
For example:
$("#theTable").cachedTable.find("input[name='cbitems']:not(:disabled)").each(
I have tried reading up on object oriented javascript (or what to call it), but no success.
To answer my own question:
The cached table is accesible, I had just left out the [0] part.
$($("#theTable")[0].config.rowsCopy).each(function() {
$(this).find("input[name='nodeitems']:not(:disabled)").attr('checked', check);
});

Why do jqgrid, flexigrid and ingrid all use separate tables for the header and data?

We're using jqgrid on a web application to render the results of searches because of its built in functionality for paging and sorting that executes server side. We were previously using Tablesorter, but that operated client side and so didn't work well for how we were trying to use it.
We had a web designer on the project (whom has since left the organisation) that had created styles for tables and tried to get the same look working on the jqgrid. It sort of worked, but not quite. We have trouble with the header columns being unaligned with the data columns. We've fiddled with the CSS but it just doesn't seem to work. Sometimes we get scroll bars appearing when we don't want them.
Anyway, part of the problem seems to be that jqgrid uses one table for the column headers, and then another for the data itself. These tables are each wrapped in a div tag. We've had a look at some of the alternatives such as Flexigrid and Ingrid but they also use the same approach with separate tables for the headers and data.
It would be great if someone could explain why this approach is used. We were wondering why a standard table tag with a row of th for the headers and td for the data couldn't be used instead?
The reason these plugins use separate tables for headers and data is to allow for fixed header scrolling. As far as I know you cannot have headers and data in the same table, yet fix the headers to the top during scrolling.
Also for your alignment issue, if possible, I believe these plugins all have settings where you can set how wide you want each column, and this will make the data and header columns line up properly.

Drupal Views Ajax refresh rows

I have some view (Views 2 - list of invitations, table style) which uses embedded forms to edit records directly in view rows.
I am using ahah to change values in records. What I need is to refresh all records dynamically (some calculations) after I change some checkboxes.
Is there any way to refresh view using Ajax?
To trigger reload table rows only form the code?
I suspect it must be some way (some command) as there is a Use Ajax option in views for sorting tables, etc...
Any hints would be much appreciated
In basic settings there is the 'use ajax' option which :
If set, this view will use an AJAX mechanism for paging, table sorting and exposed filters. This means the entire page will not refresh. It is not recommended that you use this if this view is the main content of the page as it will prevent deep linking to specific pages, but it is very useful for side content.
you may find the module Ajax Views Refresh useful

Resources