cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Data Filter widget with Datatable

SOLVED
Highlighted
Aquamarine

Data Filter widget with Datatable

Hi ,

I have DataTable with some records , i want to use Data filter widget .but when i binds filter widget to "All Data" in Datatable Service . its showing field names in filter widget but unable to filter data. i need proper reference on it. which service needs to bind and which needs to create new one. i have attached screenshots plz see this and give some steps how we can get it.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Data Filter widget with Datatable

Hi,

 

I recommend to use QueryDataTableEntries and create bindings in the following order:

- bind the Query from Data Filter to Query from Parameters of service QueryDataTableEntries

- Change event of filter  bind it with QueryDataTableEntries service

 

See below:

raluca_edu_0-1579771367785.png

 

 

Hope it helps,

Raluca Edu 

View solution in original post

4 REPLIES 4
Highlighted

Re: Data Filter widget with Datatable

Hi,

 

I recommend to use QueryDataTableEntries and create bindings in the following order:

- bind the Query from Data Filter to Query from Parameters of service QueryDataTableEntries

- Change event of filter  bind it with QueryDataTableEntries service

 

See below:

raluca_edu_0-1579771367785.png

 

 

Hope it helps,

Raluca Edu 

View solution in original post

Highlighted

Re: Data Filter widget with Datatable

Thank you very much . perfect !!

Highlighted

Re: Data Filter widget with Datatable

Hi raluca_edu,

Could you please expain how it can be done in infotable. If you give me binding connections it would be better.
Thank you
Highlighted

Re: Data Filter widget with Datatable

Hi,

 

Bindings remain the same, the only thing is that you need to create a service that is getting all rows of an infotable and one service that is doing query in infotable. I do not have a code example for this, but for querying infotable you can use:

var query = {
sorts:[{
fieldName: "name_of_field",
isAscending: false
}],
filters: {
type: "AND",
filters:
[{
type: "LT",
fieldName: "name_of_field",
value: 20      // this is selecting field values less than 20
}]}};
var result = Resources['InfoTableFunctions'].Query(
{query : query,
t : myinfotable
});

 

But you need to figure it out how to create a dynamic query for infotable that is selected by user and then to pass it to your service.

 

Hope it helps,

Raluca Edu

 

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum! ______________________________