tabulator filter: ungroup filter results - filter

in my tabulator table I group specific rows. When I load the page I keep the groupings closed, so that the user can open those grouping he is interested in. (see attached screenshot)
But I would like to automatically open the groupings, when the user applies a filter to any column of the table. (because in this case I want him to see the results on first glance and I do not want him to open the grouping manually) Do you know how I can set up this specific requirement?
Open grouping when applying a column filter in tabulator js
Thank you very much in advance.
Best regards

To check when the table is filtered you can use the dataFiltered callback, you would need to check through the filters passed into the callback to make sure that there are filters actually applied before carrying out your app logic.
var table = new Tabulator("#example-table", {
dataFiltered:function(filters, rows){
//filters - array of filters currently applied
//rows - array of row components that pass the filters
},
});
You could the use the getGroups function to return an array of the Group Components for the table, and the itterate through the list and open the groups using the show function:
table.getGroups().forEach(function(group){
group.show();
});
I hope that helps,
Cheers
Oli :)

Related

SSRS Static fields in groups

Good afternoon!
I have created a report with the wizard to create a matrix that is grouped and has drill down rows. I have added filters to the rows and columns and it works great! I then copied that matrix and modified the filters, so I had two matrixes.
But what I really wanted was those two rows in the same matrix, just in different row groups. So I added another group, using the adjacent below option, and then added all the child groupings. However, when I run the report it shows the values for the first row of the drill down data.
When I look at the groupings I can see the one I did manually has a 'Static' field in each row grouping but the ones that the wizard did (with the red ?), they don't have that "extra" row:
What do I need to change or how do I need to add my groups so that I don't get that "static" row and not show the data? I have the visibility set to 'Hidden' and the toggle set up for the prior grouping set data.
Assuming a few things....
the data comes from a single dataset
You are differentiating between Property and Violent crimes by filtering on a column, I'll call it IncidentGroup for the sake of illustration..
I've understood your question ! :)
Get to the point where you had just a single tablix filtered to show 'Property crime'.
Now remove or edit that filter so it shows all the data you need in the report.
Finally, right click on your Matrix1_IncidentCategory row and add a parent group, choose IncidentGroup (or whatever the column is actually called) and check the box to add a group header.
That should be it, there is no need for a second tablix.
Without knowing how you are filtering currently it's hard to give a complete answer but this should get you close, if not all the way there.
If this doesn't work for whatever reason, please post sample data from your dataset output and your current filters.

jsGrid - get data typed by the user in a search navGrid

I'm trying to bind a table and a graph using d3 and jqGrid library. For that I have to get the search typed by the user in the searchbox (my table looks like this : http://www.guriddo.net/demo/guriddojs/)
I've found this function :
grid.getGridParam("postData").filters
but I don't know how to use it. I thought about the trigger event "jqGridToolbarAfterSearch" to get the data after each search but doesn't seems to work...
If someone has an idea I'll be very grateful!
Thanks.
Ps : if the same method exist to set data, I'm interested too.
I hope that I correctly understand your problem. I suppose that you first converts the CSV data of the demo to some more continent data format: array of items with some properties (name, economy, cylinders, displacement, power, weight, mph, year). Then you can use datatype: "local" and data as the input data. I suppose that the user apply the local filter and then you want to get the filtered data
If you use free jqGrid fork of jqGrid (it's the fork which I develop) then you can get lastSelectedData parameter (var filteredData = $grid.jqGrid("getGridParam", "lastSelectedData");) to have the array of filtered items (see the demo). After that you can use d3 with the filtered items.

Remove all the rows of handson table

I am new to handsontable.
My handsontable rows are readonly.
I wanted to remove all rows of handsontable on a button click.
Please help me.
Do update with empty dataset:
handsontableInstance.updateSettings({
data : []
});
This removes all rows (and leave header if there is some).
There are many ways to "remove" all rows. For example, one, and the easiest, would be to empty your data array. So say that you initialized your HOT instance with the data field as array dataArray. Your button would only need do:
$("#buttonId").click(function() { dataArray = [];})
That would be the easiest way but of course you'd be bypassing HOT. This means that if your application gets more complex and you rely on handlers such as afterRemoveRow, then this method will bypass them. In this latter case, you'd want to use the hot.alter() method as follows:
hot.alter('remove_row', 0); // would remove the row at index 0;
With this I am assuming you know how to use a for loop that could iterate through all rows and remove them, one by one. An expensive operation but it would ensure all the proper handlers get called.
tableInstance.clear()
Clears the data from the table (the table settings remain intact).
refer to the
doc

Disable single key input in flex

I have an AdvancedDatagrid built up dynamically basing on xml data retrieved from http services.
The last row contains columns totals and to simulate its footer behavior it has been foreseen a custom sortFunction, but it doesn't works for multiple columns sorting.
Since I don't need multiple columns sorting, I preferred to:
set adg.sortExpertMode = true;
extend sortItemRenderer in order to hide the number indicating the sort order and so to avoid user to think multiple sort is possible
Now, my problem is that if a user presses CTRL key and click on 1+n column, the standard adg class foresees the multiple sorting. So I thought I would be possibile to catch the pression of CTRL and to eliminate its effect.
Below the code
private function keyHandler(event:KeyboardEvent):void{
if (event.ctrlKey == true){
event.stopImmediatePropagation();
}
}
It doesn't work, is there a way to make it possible??
THanks in advance!
Enrico

access list of filtered items in dataview

I'm using a DataView to populate the Grid, and using filters to interact with the visible rows. My problem is after applying the filters, on rows change, or rows count change... how can I access the dataview to iterate over only those visible rows, to do some calculations for example?
Because rows themselves are not publicly exposed... and if they were, a row is not always a data element, since can also refer to a Group, right?
Is there an easy way to access those filtered data elements then?
(I guess what I'm looking for is something like being able to access "var filteredItems = getFilteredAndPagedItems(_items, _filter);")
thanks,
Use dataView.getLength() and dataView.getItem(index) to access filtered/paged/grouped data.
This is the interface the grid is using to talk to the data source.
I posted a solution here if you want to give that a look. Also for those who might be looking for something similar.
Get Filtered data from Dataview in Slickgrid
if you want to show the information that's being filtered and whats on the current page you can do something like this.
var pagingInfo = dataView.getPagingInfo();
var start = pagingInfo['pageSize'] * (pagingInfo['pageNum']);
var filteredAndPagedItems = dataView.getFilteredItems().slice(start,(start + pagingInfo['pageSize']));
console.table(filteredAndPagedItems);
something along those lines.the getFilteredItems is a custom function i added to the dataview.js. for more information view the link.

Resources