Closed helmutgranda closed 7 years ago
Hi @helmutgranda Unfortunately this option is not available at the moment. We have also two related bugs (sorting a summaryCalculations row and the fixed rows). I'll mark your idea as a feature.
Hi @AMBudnik,
Thanks for adding this as a feature, one thing that I have done is adding my sorting dropdown inside the header area which works great, however it looks like the header area goes through the sorting and filter algorithms as well. Is there a way to ignore the header tags from the table and leave them intact during those two behaviors?
Could you share a Fiddle with updated code? I'd be happy to take a look at it.
Hi @AMBudnik,
Sure, I have created a demo for you:
http://jsfiddle.net/helmutgranda/sLyt95kh/1/
One thing that you will notice is that I am updating the data of the headers without HandsonTable API but rather updating from outside. Long story short we have dropdowns in headers that filter the data on the table similar to what comes out of the box but with some modifications. However when you interact with the dropdowns the filtering happens and the data in our dropdown headers get updated. The easiest way to see this in action is as follows:
Hi @helmutgranda
I can see what you mean and the table is over-witting your new headers.
Is there any particular reason why not to use updateSettings
with colHeaders
to change them?
Hi again @helmutgranda I just got a demo from our devs where you can ignore first row while sorting: http://jsfiddle.net/budnix/8n9cdnc8/
Hi @AMBudnik,
Thanks for the response and in fact the first row is ignored, however since we are updating the data of the cell outside the table it gets overwritten with what is in memory. I am able to get around this limitation by listen to specific events.
great, thanks for keeping me updated.
We're moving this topic to our Feature-requests section
Would it be possible for @AMBudnik to share the ignore first row demo code again? The url is no longer working.
Sure @zachary822 Here it is: http://jsfiddle.net/handsoncode/y2ttkwt6/ in this example we ignore 2 rows a[0] === 0 || a[0] === 1
Thank you!
@zachary822 you're welcome :)
Is there a way to ignore last row instead of first row?
@mohithg
unfortunately, this option works only for first adjacent rows.
@AMBudnik I did the following to make it work.
return function (a, b) { const plugin = hot.getPlugin('columnSorting'); if (b[0] === (hot.countRows() - 1)) { return -1; } return plugin.defaultSort(sortOrder, columnMeta)(a, b); };
you're right @mohithg such a clever solution. Thanks for sharing!
Hi @AMBudnik , Is there any sample codes for v7.0.2? :)
Hey @zawmyohtet1 the last demo should work for all the versions below 6.0.0
.
In 6.0.0. we've made some breaking changes https://handsontable.com/docs/6.0.0/tutorial-release-notes.html and haven't created the demo since then.
However, we should think of an option that will allow us to exclude some rows from being sorted, like excludeFromSorting: [0,1]
where 0
and 1
are indexes of visible rows. We could also add a boolean option dontSortFixedRows
then we just could fix the rows and keep them unsortable.
Thank you :)
Hi Are there any samples for ignoring the first row while filtering?
Hi @aljke thee are no update since my comment in April
maybe some future plans? cause year already passed
Hey @galvakojis We are working on the v8 of Handsontable, where (as we believe) it will be possible to exclude rows from being sorted. Here's an example based on 8.0.0.-beta1 https://jsfiddle.net/wojciech/2rdua5ek I haven't tested filtering but I stay positive.
I haven't tested filtering but I stay positive.
You're example includes fixed rows with filters as well.
@wojciechczerniak true, I should have explained it better - values from the first two rows cannot be filtered out but they're visible in the filter_by_value list so I consider filtering partially supported for excluding rows.
@AMBudnik thank you looks like it is working, kind of, cause I am using angular now I have bunch of errors: Still this works in development, but not sure will it work in prod
ERROR in node_modules/@handsontable/angular/lib/hot-table.component.d.ts:276:42 - error TS2339: Property 'modifyCol' does not exist on type 'GridSettings'.
276 modifyCol: Handsontable.GridSettings['modifyCol'];
~~~~~~~~~~~
node_modules/@handsontable/angular/lib/hot-table.component.d.ts:283:42 - error TS2339: Property 'modifyRow' does not exist on type 'GridSettings'.
283 modifyRow: Handsontable.GridSettings['modifyRow'];
~~~~~~~~~~~
node_modules/@handsontable/angular/lib/hot-table.component.d.ts:293:48 - error TS2339: Property 'skipLengthCache' does not exist on type 'GridSettings'.
293 skipLengthCache: Handsontable.GridSettings['skipLengthCache'];
~~~~~~~~~~~~~~~~~
node_modules/@handsontable/angular/lib/hot-table.component.d.ts:294:44 - error TS2339: Property 'unmodifyCol' does not exist on type 'GridSettings'.
294 unmodifyCol: Handsontable.GridSettings['unmodifyCol'];
~~~~~~~~~~~~~
node_modules/@handsontable/angular/lib/hot-table.component.d.ts:295:44 - error TS2339: Property 'unmodifyRow' does not exist on type 'GridSettings'.
295 unmodifyRow: Handsontable.GridSettings['unmodifyRow'];
~~~~~~~~~~~~~
@galvakojis that's a beta version - we will make an update for Angular, React, and Vue after publishing a stable version. Some of the hooks will be deprecated in 8.0.0 https://github.com/handsontable/handsontable/pull/6613
@AMBudnik understood, maybe there is something like a road map? When you are expecting to release v8? Q2? Q3? Q4? Next year?
@galvakojis here' an epic to follow https://github.com/handsontable/handsontable/issues/6465 However, we do not have to fix all those issues to publish beta2. Stable 8 version needs to have all the regressions fixed so that would take us another 2-3 weeks. I hope that we will be able to push beta2 in May but I cannot guarantee the date.
Hi All.
We are moving feature ideas and improvements to Github Discussions to gather all the ideas on UI and API. That will help us to continue the development of the functionality in the future.
Please feel welcome to share your feedback via the Github Discussions panel if you have any additional ideas.
I have a custom dropdown for filtering, also need the ability to sort the data. Currently I am not able to do so since filtering and sorting applies to all the data including for headers. How can I implement a similar behavior while Ignoring the first row after header?
In the following example the first row has values of "Do not sort" which would be great to ignore for sorting and filtering.
http://jsfiddle.net/9rofomd5/