get (Multiple Items) Filter Criteria in a Pivot Table using Excel Api javascript - pivot-table

I am trying to get Multiple Items from filter criteria. I have tried through filterHierarchies and also using pivotTable.layout.getFilterAxisRange() but its only return "Multiple Items" as text instead of return the list of selected Items

Related

Search form model(s)

I have to design a search form and display the results. I am having some difficulties finalizing the models/collections to be used.
I have a few fields which acts as filters. These fields are select boxes where multiple items can be selected. After an item has been selected from a field, I need to call the API which will return a list of results with this filter and also all the remaining filter options for the other fields based on the first filter.
What I am confused is how should I go about this. Should every select box be a model? Because the options for each select box will be changing.
About the results,
I am thinking that results should be a collection. But given that there is only one API endpoint here, I am confused which model should hold the url.
Since your API is actually returning a collection of results, I'd keep the filter parameters in a model, and while submitting search request, create the collection URL dynamically based on the filter model attributes.
You can go the other way, send the request from model itself, then in parse set results from response to the collection and remove it from model, but it seems more hacky than dynamically creating collection URL

AngularUI grid: How can I get selected data after sorting?

I am using AngularUI grid with AngularJS 1.x.
I performed a sort on my table.
Selected all the rows, post sorting.
getSelectedRows() returns the selected data in the original order, but not in the sorted order.
How can I get the selected data in the sorted order?
So, we can get our hands on the sorted data, even with pagination using the below.
var sorted = grid.sortByColumn(grid.rows);
Worked like a charm for the fix I wanted.

single datasource for muiltiple mutiselect dropdown in angular

I want to use Single Array as a Data-Source for Mutiple DropDown element(will be dynamic generated based on another ArrayList) with muti-select and condition begin when any item/'s get selected in any of the DDL, then it should be removed or disabled in the remaining DDL.
PS: I'm new to front end development and using Angular1.5 with TypeScript.
Ex:
DS for Select Option: [1,2,3,4,5,6,7,8]
I kind of facing problem when we are deselecting any item from the any of the DDL, since the deselected values needs to be pushed based to Available Values Array for the remaining DDL.
Maybe you should create an array of objects like [{value:1, disabled:false}, .....]
and work with the disable property.
should be something like:
<md-select ng-repeat="item in myItems">
<md-option
... ng-click="item.disabled = !item.disabled"></md-option>

In trNgGrid, how to get filtered data for export, or get current filter's value

I am using angular's trNgGrid library to display a table of data and trying to export data. On some occasions I want to export the filtered data.
My question is:
How to get the data records filtered by the active filter or get the active filter's value.
Thanks.
Is this example helping? See Grid Configuration - http://moonstorm.github.io/trNgGrid/release/#/GlobalOptions
Using filtered-items="myGridFilteredItems" attribute you should be able to access filtered array.

How to filter data from array and apply infinite scroll using angular js?

I have a requirement where I query all the records and push it to array. And since I have about 2000 records to display, it takes more time. So I would like to implement infinite scroll. But I have filter feature along with this. So how can I show all records on scroll initially and show filtered records on scroll when search box contains search term? Pls help.
Thanks in Advance!
This is a slightly more complicated task since the built in angular filter requires all the elements to be in a local array before being able to filter. So you cannot use it, and must move the task of filtering to the server, for example using the sql %like% query.
You need to reuse both the array of records, and the pagination component. So there are 2 use cases:
User is viewing unfiltered list
User has entered a valid search query and is viewing a filtered list
When user is viewing the unfiltered list, you are querying the API endpoint ex:
server.com/api/records?page=page_number
When the user is viewing a filtered list, you are querying the API endpoint ex:
server.com/api/records?page=page_number&query=mysearchquery
So the entire task becomes:
User is viewing unfiltered list
User enters a search term in the search box
Use a debounce to check the input query for validation, ex: length > 4
Front end clears entire list of records, and reset any pagination state
Pagination now occuring on the filtered list
When a user clears the search box:
Clear the list of filtered records and reset pagination state
Begin paginating the unfiltered list once again
If you any specific questions about any part of the process, I'd be happy to update my answer.

Resources