Toggle cumulative_filtering: true/false or similar functionality using deferRender: true - datatables-1.10

I started using yadcf and it works fine for my needs except for one thing, since I have quite a lot of rows for the datatable I use deferRender: true to speed things up. I would like to use yadcf with cumulative_filtering: true but since deferRender is set then the filters will only populate with what's being displayed on the current page.
So if the page length is 50 out of 200 unique rows the filter dropdowns will only contain the 50 rows and not 200 like I would want. This of course works if I set cumulative_filtering: false but then the results will not narrow down when filtering.
Same question was asked here with no real answer,
how to use yadcf with DataTables deferRender: true

Related

WiX - Dataset Mismatch

I have a website for my Theatre Institute and on the homepage, I have a Slideshow with Two Repeaters on two different slides connected to two different datasets. I use them to display event information/status from my database collection.
Slide1: recentRepeater <-- recentDataset <-- myCollection (For Recent Events)
Slide2: upcomingRepeater <-- upcomingDataset <-- myCollection (For Upcoming Events)
The Problem
While loading, the dataset2 data is shown in repeater1 i.e. RECENT EVENTS gets displayed in the UPCOMING EVENTS section and it gets corrected after fully loading. Being the first thing to be shown on the site, I do not want it to get messed up. This is a negative impact on my website
How It Works
I have stored dates of the Event in the database as a number in YYYYMMDD format. For example:
20-April-2019 ---> 20190420
I have properly connected the datasets to the repeater elements, set the dataset result limit to 2
I sorted the results to be produced based on the YYYYMMDD number
Ascending for upcomingDataset
Descending for recentDataset
I generate the YYYYMMDD format number for that day and filtered the results produced by the dataset by the .setFilter() function
$w("#recentDataset").setFilter(wixData.filter()
.lt("dateNumber", YYYYMMDD_today)
)
$w("#upcomingDataset").setFilter(wixData.filter()
.ge("dateNumber", YYYYMMDD_today)
)
How can I prevent this from happening..?
Thanks in Advance
It's hard to say what's going on without actually playing with your site. I think both of your datasets are connected to the same collection. I would guess the problem is that the dataset is only being filtered after the page is loaded. You can verify this by turning the console to verbose mode in preview.
If that is indeed the problem, I can think of three possible fixes/workarounds:
Set the filter's in the dataset settings instead of setting them programmatically. (This is the easiest option.)
Hide the repeaters until the filters are set. (This is a bit of a hack.)
Store the promises returned by the setFilter functions and return them using Promise.all() from the onReady(). (This is the fanciest option. I think it will work, but if you don't need to set the filters programmatically, you might as well do option 1 instead.)

Disable rows in ag-grid when columns are set to editable true

I have a requirement of developing spreadsheet like application using ag-grid. In that I need to disable few rows (not allow users to edit few rows). Can someone guide me how to make specific rows read only when all the columns are set editable to true mode in ag-grid. Or is there any other way to archive this functionality.
Rather than setting editable: true you can set editable based on the data:
editable: params => params.data.active === true.
Hope that helps.
What will work best is to use the cellEditor somehow. It provides row nodes in it's init params that you can iterate through and check if it is a row you want editable or not. If it is not then call stopEditing.
Sorry this doesn't have a working example yet, but that is how I will try tackling it and try to provide a working example when I get one going.

ui-grid export all filtered data to csv

I have some fairly large data (~100k rows) with filtering on every column and paging enabled. It's all displayed and manipulated client side.
I'd like to be able to export all the filtered results, not just what's displayed in the first page.
The workaround would be to change the pagination size to something larger than the resulting filtered result, but that just seems cumbersome. Is there a better way to do this?
Someone had asked this question in https://github.com/angular-ui/ui-grid/issues/3954 but never got an answer.
There isn't really a way to do it. Export visible exports the currently visible rows. Pagination works by changing which rows are visible - so the visible rows are those on the current page. Export all data works by exporting all the data whether it's visible or not, so it exports rows that have been filtered out.
In theory this could be implemented, we'd need to reinstitute the "invisibleReason" flag which I think is still mostly implemented but not used in the code, and then set the visibleReason to "pagination" on those rows that the pagination feature makes invisible. We could then have exporter manually process the rows and include those for which the only invisibleReason was pagination.
It's quite a lot of fiddling around, but it's plausible someone could submit a PR with that functionality.
I think this should work.
onRegisterApi: function (gridApi) {
gridApi.core.on.rowsVisibleChanged($scope, function () {
// match export enabled per row to visible property. This is in order to force export only of filtered data.
gridApi.grid.rows.forEach(function (row) {
row.exporterEnableExporting = row.visible;
});
});
}

NG-Grid Filter not working correctly

I have a really basic grid using Angular.js and NG-GRID with the showFilter: set to true.
However if I search for the value in the Marketing Start Date Column, 200101011. It doesn't show. Actually as soon as I start typing a 2 in the filter text it should find all four records, but only 2 show up....
Here's the Plnkr
http://plnkr.co/edit/D3nFkQ
Thank you.
The problem appears to be the null values in your table. The search does not seem to go past a cell containing null. Hence the strange filtering behaviour. If you replace the nulls with empty strings or other values the search works perfectly.
There is an issue logged on ng-grid on GitHub - filter search box returns prematurely when cell contains an object. Since null is an object the solution suggested may work for you.

Can extjs Control/toggle groupField data?

here is the example edited by crop grid:
1st i view like a normal grid like this image
http://imageshack.us/f/836/groupcontrollingb4.png/
then i create a check box name as "Cuisine:American" and check it to reload become image like this
http://imageshack.us/f/803/gridcontrollingafter.png/
the group data "Cuisine:American" can be group it and expand
then other data still remain the normal grid view
Does any one know a example or possibility for controlling the groupView like in the example i've shown ?
Hope u all can understand my question
thankz.
It's harder than it should be, because ext is not calling Ext.util.Grouper.getGroupString method. I've managed to bypass this. Here is working sample: http://jsfiddle.net/bP7Y2/
I am basing on Grouped Grid Example from Ext JS site. I've created CuisineGrouper which is extending Ext.util.Grouper. There are 2 important methods: getGroupString which returns gruping string and sorterFn which sorts in that way that grupped elements are on the top. For example when there is grouping by 'Cuisine:American' getGroupString returns 'American' or '' depending on cuisine value.
Another important bit is overriden getGroupString method on Restaurants store, so now it calls Ext.util.Grouper.getGroupString.
Last thing I've modified is groupHeaderTpl of groupingFeature.
(Update) It's possible to hide Others grouping header with some hacks. Example: http://jsfiddle.net/bP7Y2/1/

Resources