cancel
Showing results for 
Search instead for 
Did you mean: 

Access Rows in the table after filtering

kammaje_cis
Active Contributor
0 Kudos
64

Hi Experts,

I am populating a table with json model binding. When I filter this table by clicking on the column header, I want to access the new content in the table so that I can update binding for another control. (Pie chart).

I am listening to the filter event of the table, but I am not finding a way to access the content of the table after filtering. Any pointers?

Thanks

Krishna

Accepted Solutions (1)

Accepted Solutions (1)

Qualiture
Active Contributor
0 Kudos

Not sure if I remember correctly, but I think you need to add the filter to the table row aggregation:


yourTable.bindAggregation("rows", {

  path    : "/yourTableData"

  filters : arrayOfFilters,

  sorter  : arrayOfSorters

});

Then you can access the filtered table's model; simply set


yourChart.setModel(yourTable.getModel());

and it should work

kammaje_cis
Active Contributor
0 Kudos

I need to calculate a new json model based on the latest data in the table. This new model is used to bound to the pie chart. So I would need to have some event which gets triggered after the table is filtered.

Did I make sense? Or is there a better way to handle this?

My current code is here (filter is on 'Status'). The code looks dirty for me and I feel there should be a better way.

Thanks

Krishna

Former Member
0 Kudos

Why do you need to create a new json model ? When you do a filter on the Table, also do the same on the Pie chart. Doesn't that work ?

Answers (0)