Jump to content

TUniDBGrid filtering doesn't work when using TUniFrame


abiery_iqms

Recommended Posts

Hello,

 

It appears that filtering using TUniDBGrid doesn't work if the TUniDBGrid resides on a TUniFrame.  I've modified the GridFiltering-2 example to demonstrate this and attached the folder.  

 

Observed problem: Filtering functionality no longer triggers when the TUniDBGrid is inside a TUniFrame.  The user enters a value to filter with, presses enter, and nothing happens.

 

Is this a bug?  Is there a way to make this work? Please let me know.

FilteringExample.zip

Link to comment
Share on other sites

Hi,

 

Is there a list of everything required for the filtering mechanism to work?

 

OnClearFilters

OnColumnFilters

 

You can analyze this demo:

FMSoft\Framework\uniGUI\Demos\Desktop\GridFiltering-2

I have another project where the filtering works, but the clear all button is missing. 

 

UniDBGrid -> Options -> dgFilterClearButton = [True]

Link to comment
Share on other sites

Thank you.  To summarize for posterity...

 

TUniDBGrid needs:

1) Options := Options + [dgFilterClearButton]; Shows the clear all button

2) A UniHiddenPanel to hold the filter edits - this needs to have a parent assigned and coexist with the TUniDBGrid.  Creating a descendant of TUniDBGrid which instantiates a TUniHiddenPanel within the class will prevent the javascript events from getting hooked up (X's in fields  & clear all button won't do anything)

3) OnClearFilters event assigned

4) OnColumnFilters event assigned

 

To enable/disable incremental search vs. waiting for use to initiate searches, use CharEOL.  Date fields automatically trigger after a date is selected.

 

Wait for prompt:

(*Tells the grid to wait for user to press enter before filtering*)'
TUniEdit(aSearchField).CharEOL := #13;
TUniEdit(aSearchField).CharEOLEventType := ceKeyDown;
 

For incremental searches, no EOL is used.

Link to comment
Share on other sites

  • Administrators

Thank you.  To summarize for posterity...

 

TUniDBGrid needs:

1) Options := Options + [dgFilterClearButton]; Shows the clear all button

2) A UniHiddenPanel to hold the filter edits - this needs to have a parent assigned and coexist with the TUniDBGrid.  Creating a descendant of TUniDBGrid which instantiates a TUniHiddenPanel within the class will prevent the javascript events from getting hooked up (X's in fields  & clear all button won't do anything)

3) OnClearFilters event assigned

4) OnColumnFilters event assigned

 

To enable/disable incremental search vs. waiting for use to initiate searches, use CharEOL.  Date fields automatically trigger after a date is selected.

 

Wait for prompt:

(*Tells the grid to wait for user to press enter before filtering*)'
TUniEdit(aSearchField).CharEOL := #13;
TUniEdit(aSearchField).CharEOLEventType := ceKeyDown;
 

For incremental searches, no EOL is used.

 

Hello,

 

That seems accurate. Except you don't need to assign CharEOLEventType. It is assigned by grid automatically.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...