Handsontable Get source data given table row data (not original row in source) - handsontable

I'm using handsontable (https://handsontable.com/) and I create the sourceData with an additional parameter like it was another column (never used to render the table).
Then, afterChange, I need to get that parameter back.
The afterChange is working as expected, giving me the row number and the col header.
What I need is to be able to get the sourceData belonging to the object (not the cell) of the row.
Thank you

Related

How can I select a specific row and column from a DBGrid lazarus?

I want to save a specific value that is on a specific row and column. How I can do this? I already search, but I didn't find anything
One doesn't save a value from the grid but rather from the underlying dataset. The following is for Delphi, but I understand that Lazarus is near enough the same. Let's say that the grid is displaying data from a query qTest that has fields id, surname, forename, date of birth (DOB). In Delphi, one can automatically have variables created with names qTestID, qTestSurname, etc. Another way of referring to the variables is by use of the 'fieldbyname' syntax - qTest.fieldbyname ('surname').asstring.
Write a dblClick handler for the grid: when one gets to the row that holds the required data, perform a double click. In the handler, the fields of the row will now be available as qTestID.asinteger, qTestSurname.asstring, etc.

Handsontable: How to pass id to a cell?

I'm using Handsontable and was able to fill a data grid with 16 rows and 9 columns retrieved from a database. Each cell represents a value from a table with a many to many relation. When saving the data-grid, an array is passed to view. I want to clearly identify each cell with the id provided from the table. Is this possible? I read about the setCellMeta(), but don't know how to apply this...
What you can do is iterate all cells and set metadata for each cell (rows and columns) with the value you need.
myhot.setCellMeta(0,0,'Id',1);// where parameters are: row, col,propertyName, value.
later you can do the following to read :
myhot.getCellMeta(0,0) // rown, col
I hope it helps

Not able to get the cell data of Java tree - UFT

When I am using getcelldata method for Java tree object, nothing is being returned.
Celldata=javawindow("Oracle").javatable("Console").getcelldata(1,1)
Celldata=javawindow("Oracle").javatable("Console").getcelldata("#1","#1")
Please help.
There could be few possible reasons for this
1) You are not using the correct row and column numbers for fetching the data. Row and column starts with 0. So if you want to fetch the data for row 1 and column 1 then your statement should be
GetCellData 0,0 not 1,1
To check if you are on the right row and column you can use ActivateCell or ClickCell functions. Both of these function indexes starts with 0, so they should match.
2) Check if there are any child controls inside the table cell, sometimes that will cause issues getting the data from the cell, because if cell is having a custom control inside it then cell technically does not have the data.
To check this use the childObjects function
3) If GetCellData is not working, then you can also check, if you are able to add the table cell directly in the object repository and get the text using GetROProperty.
4) If nothing else works then you can also check the native functions and properties.
To access the native properties and function you can use object spy.

JavaFX Exporting table/treetable view content to pdf and excel

I have a abstract table (table or treetable view does not matter) view which have lots of column. But not all columns are visible at the same time. Now what i want to do, when i export the table contents to pdf/excel read each row data but actually in javafx we can not get row and cell data directly. For this we must use row/cell factory. But in this case this factory is called only when we add data to the table. I can read table data model for each row but in this case i must chek which columns are visible and invisible and which data model used always, and call the required method of the data model. Doing this required lots of code lines because as mentioned i have lots of column and nested column and also different data models. So during exporting to check all of these required lots of code line. But if i can read the row and cells of row i do't need to check invisible row and data model. Just read current row and data of cell. So my question is how can i solve this issued? Do you have any suggestion?
Any suggestion?
finally I solved this problem. Thanks for java documentation. I post some code snippet so who needs can use. For reading cell value on (row,column) intersection on TreeTableView
int rowIndex = treeTableView.getRow(treeRowItem);
for(int i=0;i<treeTable.getColumns();i++){
TreeTableColumn ttc = treeTable.getColumns().get(i);
String value = ttc.getCellData(rowIndex).toString();
}
you can also use the same logic on TableView

Tableau create a table matrix?

I have a CSV file that looks like this. It is in matrix form where cell A1 is empty. I want to visualize this in Tableau like this
a1,a2,a3
a1,1,0.2,0.3
a2,0.3,1,0.5
a3,0.6,0.7,1
How can I build this in tableau to show a matrix?
I tried putting measure name in both the row and column field and measure values in the marks text box but i ended up with diagonal values which isn't what i want.
First structure your data in the form of a table.
A well structured CSV file for Tableau (and most tools) has a single header row that labels each column (so skipping the first cell in the header row is a problem). Then each data row that follows contains only values in each field separated by columns (so there should be no leading row labels)
Order is not significant in a relational table. The rows in a table form a set, not a matrix.
So your CSV should look something closer to
field_name_1,field_name_2,field_name_3
1,0.2,0.3
0.3,1,0.5
0.6,0.7,1
Normally, the prime use of Tableau is display an aggregated summary of the data, not to display each individual data row. So you can put measure_names on columns and measure_values on the text or label shelf to get a summary of each measure (by default a sum)
If all you want to do is to view the underlying data rows in a table for diagnostics, the easiest way is to use the view data button or menu command.
If you want to build a visualization that displays all the data (without summarizing it) in a table, you have two ways to go. The simplest is if you have a unique primary key in your data, you can place it on the row shelf to get a row in your viz for each row in your data.
If your data rows do not have a primary key, you can turn off aggregate measures from the Analysis menu, but then you'll see multiple values in each table cell. Then to get a row in your viz for each row in your data, put the calculation index() on the rows shelf and change it to discrete.

Resources