Hi guys,
I have a form in which I created three fields namely,
Name
checkbox
Window field
Now I have created a new text field in that form and now whenever I type starting letters it should filter that grid based on letters typed in that textbox.
Please give some suggestions.
Regards,
AXTechie
*This post is locked for comments
Thank you rustem for your valuable time
Regards,
AX Techie
Try to change SysQuery::valueLike() with SysQuery::valueLikeAfter()
Sorry without pressing enter button.
Moreover the filter searches for the letter that we type and show all records that contains that letter but what i want is to show the record starting with that letter.
Is there any modifications that i need to do in that query.
please advise.
What you mean by "Is there anythere way with pressing the enter button" ?
Thanks you Rustem
I tried it just now.
Is there anythere way with pressing the enter button
Then you need to override modified() method on your text control, call executeQuery() after super(), put text like "andrew, anderson" or "andr*, anders*" and leave field or press Enter.
And remove textChange() method.
Hi Rustem,
Thanks your reply,
But my requirement is different.
If i have four name like this,
andrew, anderson etc,
If I type a it should filter both names and if i "andr" it should show only andrew ..
How can i achieve this,
Please advise.
Regards,
AX Techie
Hi AXTechie2120!
On your text field override textChange() method and after super() call yourTable_DS.executeQuery().
On yourTable DS override executeQuery() method and write the following code:
public void executeQuery() { if (yourTextField.valueStr()) SysQuery::findOrCreateRange(this.query().dataSourceTable(tableNum(YourTable)), fieldnum(YourTable, YourField)).value(SysQuery::valueLike(yourTextField.valueStr)); else this.query().dataSourceTable(tableNum(YourTable)).clearRange(fieldnum(YourTable, YourField)); super(); }
But it's not good idea to executeQuery on every letter typing. Maybe will be enough to call executeQuery after you finish typing?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156