abiery_iqms Posted February 8, 2017 Share Posted February 8, 2017 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 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 8, 2017 Share Posted February 8, 2017 Hi, You forgot to "assign" to UniDBGrid OnClearFilters and OnColumnFilter events Best regards. Quote Link to comment Share on other sites More sharing options...
abiery_iqms Posted February 8, 2017 Author Share Posted February 8, 2017 Thank you. Is there a list of everything required for the filtering mechanism to work? I have another project where the filtering works, but the clear all button is missing. OnClearFilters OnColumnFilters UniHiddenPanel must be assigned a parent? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 8, 2017 Share Posted February 8, 2017 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] Quote Link to comment Share on other sites More sharing options...
abiery_iqms Posted February 8, 2017 Author Share Posted February 8, 2017 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. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted February 10, 2017 Administrators Share Posted February 10, 2017 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.