Pre-selected rows with agGrid - ag-grid

Is there a way, when creating a new grid with agGrid to have some rows preselected? I mean, with the same effect as calling setSelected on them after creating the grid.
Maybe somehow in rowData when it's passed to agGrid?

One possible solution to this problem is to have add one more column with values as 0 or 1 and then set row as selected in rowDataChanged and modelUpdated event.

Related

Implement a GridView.Count with non scrollable first row and column

So I am implementing sort of a data table in flutter. it shows data based on time in days in rows and some other variant in columns. so naturally, first row is name of the days, and then in first column are values of the other variant. What properties of GridView.count can I use to make first row and column stay fixed when scrolling the grid. so that you can always see the data variants in screen.
I have gone over all properties of GridView.count but I can't find anything.
PS: I don't want to change to something else Like GridView.builder..... because the code is too far gone with how it renders the dynamic data in the rest of rows and columns.
Please Use data table instead of Grid
https://api.flutter.dev/flutter/material/DataTable-class.html.

React ag grid - event to find if user reached end of grid while scrolling

In ag-grid, we have 'bodySroll' event to listen scrolling.
But I want to know when user reaches last record of grid while scrolling.
Is there any way I can acheive this?
Thanks
You can add onScroll listener for the Div which holds your ag-grid and then you can use gridApi.getLastDisplayedRow() this gives you last row index in the current viewport you can use this index to compare with your total number of records present on the current grid
if((gridApi.getLastDisplayRow()+1) == totalRecords). In order to update gridApi.getLastDisplayRow()+1 value you need to write it inside onScroll listener function.

How to select rows in swt table

I am trying to create a UI using SWT in eclipse. I have a table with multiple rows and two buttons Start and Next.When I click on Start, the first row is supposed to get selected. When I click Next, the next row has to be selected. And when a row is selected I have to read the corresponding row data.
I tried using
tableViewer.getTable().setFocus();
tableViewer.setSelection(new StructuredSelection(tableViewer.getElementAt(0)),true);
But no row is getting selected.
I also tried with table.getSelection(0);
And now each row is selected but with grey colour.As a result the row selection is not invoking table.addListener().
Please help me with this. I am new to this topic.
Thanks in advance.
You might have missed
tableViewer.refresh ();
before doing setSelection

Navigating RepeatBox in code

In my Smartface app I have a dataset binded to a RepeatBox.
I am adding new row to the dataset from a function that is running ASYNCRONOUSLY.
I can perfectly see my new row within the RepeatBox but it does not scroll automatically to the new row. If all visible rows of the RepeatBox are filled then new rows come off the screen which is not very user-friendly.
Is there any way to move the RepeatBox to the last row (or to the top row)?
P.S.: moving binded dataset by seek() doesn't help - the RepeatBox stands still
Try this :
RepeatBox.setTopIndex(0, itemIndex, 100);
Use itemIndex as a variable that is incremented each time you add a new row to the dataset. You can calculate how many numbers of rows do you have, make the variable start from that number, not 0.
The values 0 and 100 can be changed according to your design. You can check the links below for information about repeatbox's properties and members :
http://docs.smartface.io/html/M_SMF_UI_RepeatBox_setTopIndex.htm
http://docs.smartface.io/html/AllMembers_T_SMF_UI_RepeatBox.htm

GWT cellTable - new row handler?

I want to change some fields every time my cellTable content changes (new row, row change). Is there any predefined event/handler for that?
See if addRangeChangeHandler or addRowCountChangeHandler in HasRows meet your needs.
If by "row change" you mean a change in selected row(s), you can use SelectionChangeHandler attached to a SelectionModel.
Otherwise, you can simply call whatever method you need when you add a row or update a data provider.