Our blazing fast Grid component built with pure JavaScript


Post by janan »

I am using grid.state

https://www.bryntum.com/docs/scheduler/api/Core/data/mixin/StoreState

In the below example :
https://bryntum.com/examples/grid/filterbar/
If i scroll to the bottom and filter the city field my scroll is reset to beginning. Is it possible to for filter to know the state of scroll?

Is it possible to save state selectively? For example just date, filter , group and scroll?


Post by alex.l »

Hi janan,

Is it possible to for filter to know the state of scroll?

No, it is not supported. You never know how many records will stay in a grid after filter applied (so, what is the scroll position then?) and which records will be shown for the user in the current position of a scroller, that may confuse user.

Is it possible to save state selectively? For example just date, filter , group and scroll?

We have standard set of properties that stores into state, see https://www.bryntum.com/docs/scheduler/api/Grid/view/mixin/GridState
You can remove some of them, or try to add your own, but you should also take care of your own to apply them back.

All the best,
Alex


Post by janan »

I have 2 filters. One in column filter and another in tbar. The change in column filter resets the 'tbar filter' even if I do not do clearfilter. Is it possible for store not to clear the 'tbar filter' when i filter the column filter.
Is it possible to achieve it through state?


Post by Animal »

You certainly can have multiple filters. It depends how they are asked to be applied to the store.

myStore.filter(filter) should add that filter to any existing filters the store is using.

It would be interesting to see exactly what you are doing.


Post by janan »

 column.filterable =  filterField: {
        type: 'combo',
        ref: '',
        width: 'auto',
        editable: false,
        valueField: 'field',
        value:'' ,
        multiSelect: true,
        hidePickerOnSelect: false,
        listItemTpl: function (record) {
          return  record.field;
        },
        items: '',
        chipView: {
          itemTpl: function (record) {
            return '<div class="field-text '+ record.class +'">' + record.field + '</div>';
          },
        },
        },
        filterFn: function(data) {
          // function
        }

};

Post by Animal »

That will add its filter. So if you also have a filter that you add there should be two items in your store's filters Collection.


Post by janan »

Here is my sample code

 store.filter(function(event) { ...... }

Here i filter on the rendered event . My event is rendered as table data. So I use the 'custom filter' to filter few table items. But the problem is if I scroll or try another column filter the first filter disappears.Image
I have attached the screenshot.

  1. I want the filter to be applied when i scroll or filter a column
  2. Scroll position to be there as it is does not change the number of records.

Is there a way to do this or a work around may be?

Attachments
Screenshot 2021-11-28 at 08.19.10.png
Screenshot 2021-11-28 at 08.19.10.png (104.05 KiB) Viewed 788 times

Post by Animal »

A filter is applied as soon as you add it and remains applied.

It doesn't change on scroll. Something else is happening.


Post Reply