KUIB JFP Filter

Posted by jackc@fordav.com on 21-Jun-2018 13:38

Im in neet of adding JFP into my call to the endpoint on a JSDO project.

KUIB 3

Angular

Grid view

Using the KUIB i can make my app call the endpoint But is 504 times out because the data return ir large. So I need to add a filter to the dataService. I have done this but if I Generate the app in KUIB it wipes out my setting. See image..

How can I keep my filter even generating in the future?

Is there a preferred way to accomplish this?

Posted by jackc@fordav.com on 22-Jun-2018 08:27

Awesome - Thank you..

Here is what I have and its working - for others searching:

in my

src\app\modules\timesheet\timesheet\details-grid.base.component.ts

I added to the constructor

constructor(@Inject(Injector) injector: Injector) {

       super(injector);

       this.$dataServicesState['tttc_header'].filter = {

           logic: 'and',

           filters: [

               { field: 'tch_userid', operator: 'eq', value: 'JACKC' },

               { field: 'tch_current', operator: 'eq', value: true },

               { field: 'tch_date', operator: 'eq', value: '05-30-2018' },

           ]

       };

   }

This is now causing the Server Side Filtering needed for the Grid view.

Thank you Thank you....

Posted by egarcia on 22-Jun-2018 08:12

A way to do this is to set the filter property in this.$dataServicesState.

Here is an example:

   constructor(@Inject(Injector) injector: Injector) {

       super(injector);

       this.$dataServicesState.Customer.filter = {

           logic: 'and',

           filters: [{ field: 'CustNum', operator: 'lte', value: 20 }]

       };

   }

Please let me know if goes.

I hope this helps.

All Replies

Posted by egarcia on 21-Jun-2018 14:46

Hello,

Quick reply.

The file that you tried to use is auto-generated and it will be overwritten on Generate.

You may probably want to add code in the <view>.view.component.ts file.

The way that you would express the filter is using a Kendo UI filter:

- www.telerik.com/.../

By default you would be using client side filtering.

You can de-select the "Client-side Processing" option in the Data Providers to use server-side processing.

When using server-side processing, the JSDO will receive the Kendo UI filter and convert it to JFP when sending the request to he server.

I hope this helps,

Edsel

Posted by jackc@fordav.com on 22-Jun-2018 06:03

I found the <view>.view.component.ts file.

Where on this file can I apply my SERVER Side filter so that the data that comes back will be focused on the filter criteria?

And - what code do i put in this file to do this?

Im wanting server side filtering, not client side.

Posted by egarcia on 22-Jun-2018 08:12

A way to do this is to set the filter property in this.$dataServicesState.

Here is an example:

   constructor(@Inject(Injector) injector: Injector) {

       super(injector);

       this.$dataServicesState.Customer.filter = {

           logic: 'and',

           filters: [{ field: 'CustNum', operator: 'lte', value: 20 }]

       };

   }

Please let me know if goes.

I hope this helps.

Posted by Peter Judge on 22-Jun-2018 08:26

If you’re using ABL business entities (or similar) then the filter is passed into Read and Count operations as a character / string parameter typically named “filter”.
 
The data will come in in stringified JSON, which you need to convert to an ABL WHERE clause. There is some doc on this at  documentation.progress.com/.../index.html

Posted by jackc@fordav.com on 22-Jun-2018 08:27

Awesome - Thank you..

Here is what I have and its working - for others searching:

in my

src\app\modules\timesheet\timesheet\details-grid.base.component.ts

I added to the constructor

constructor(@Inject(Injector) injector: Injector) {

       super(injector);

       this.$dataServicesState['tttc_header'].filter = {

           logic: 'and',

           filters: [

               { field: 'tch_userid', operator: 'eq', value: 'JACKC' },

               { field: 'tch_current', operator: 'eq', value: true },

               { field: 'tch_date', operator: 'eq', value: '05-30-2018' },

           ]

       };

   }

This is now causing the Server Side Filtering needed for the Grid view.

Thank you Thank you....

Posted by jackc@fordav.com on 22-Jun-2018 08:32

Thank you - this fixed it.

For other searchers

With JFP enabled on your business entity - you can pass a server side filter in the

src\app\modules\timesheet\timesheet\details-grid.base.component.ts

Modify the constructor to include the filter

constructor(@Inject(Injector) injector: Injector) {

       super(injector);

       this.$dataServicesState['tttc_header'].filter = {

           logic: 'and',

           filters: [

               { field: 'tch_userid', operator: 'eq', value: 'JACKC' },

               { field: 'tch_current', operator: 'eq', value: true },

               { field: 'tch_date', operator: 'eq', value: '05-30-2018' },

           ]

       };

   }

Thank you....

This thread is closed