Filters

Posted: 2017-01-17 in Filters

Q:
I would like to filter the data based on one field What delegate is best to do this? (grid section)
A:
you want to filter the data displayed in the grid when it is loaded
put it in the ready delegate.


Q:
can I use more than one “like” clause in filter?
this, not work..

Code:
set filter to des_banca like "*UNI*" and PROVFINAN like 'MO'

sab giu 18 19:06:27 2016
**** Lianja error ****
set filter to des_banca like "*UNI*" and PROVFINAN like 'MO'
^
Data type mismatch

in select, work

Code:
select * from banche where des_banca like "*UNI*" and PROVFINAN like '*MO*'

A:
You can use == as an alternative to LIKE.
the == or Like condition, is not the same of FoxPro.
The == operator in Lianja works the same as exactly equal to when it does not contain patter matching characters.

If it does contain pattern matching characters then a pattern match is performed.
The patterns can be %*?[a-z][~a-z]


Q:
Is possible to change the section filter on the fly?
A:
The Section Attribute ‘SQL statement‘ allows you specify a SQL statement to populate a virtualtable – so you can set the WHERE clause there. You can access the attribute read/write with Lianja.get(“sectionname”).sql
Q2:
Is possible to combine this with the custom search?
A2:
I would think the simplest way to do this would be to create a virtual table with a variable.
Change the variable, and update the cursoradaptor.
pseudo code

Code:
create virtualtable myVT..... as select * from mytable where type ='{m.mytype}'
m.mytype = "X"
ca = cursorAdapter("myVT")ca.cursorRefresh()

Q:
I have a page section with a grid and I wish to change to change the grid records filter programmatically through some footer menu actions
A:
Once the footer has been set up, you should be able to use code similar to:

Code:
oGrid = Lianja.Get("page.section").grid
oGrid.filter = "CUSTNUM=&ncustnum AND NAME='SMITH'"

A2:
Call this to change the filter.

Code:
Lianja.get("page1.section1").grid.filter =" ="

Call this to remove the filter

Code:
Lianja.get("page1.section1").grid.filter =""


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s