![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder Demos and Examples » View Thread |
Messages 1 to 7 of 7 total |
![]() |
Tue, Dec 8 2015 6:17 AM | Permanent Link |
Riaz | here is my first attempt to load a database, search by product code or by label
thank you for all your help http://www.epos4bars.com/products.html all = list all the database label button = search by label keyword p.code = search by productcode keyword thanks Riaz |
Tue, Dec 8 2015 9:04 AM | Permanent Link |
Matthew Jones | Riaz wrote:
> here is my first attempt to load a database, search by product code > or by label Given you have prices, I think that they should have the same number of decimals. You probably also want to have it do the search when anyone types any character (any change to the edit box). And do both at the same time. So I could type "coke" and the list would be showing the results narrow as I do. I'd keep the text too - clearing it means I have to retype, but you could have a "clear" button to do that if it will be necessary. -- Matthew Jones |
Tue, Dec 8 2015 9:15 AM | Permanent Link |
Riaz | Thank you Mathew,
i was just testing if i could pull the data from EWB server will now try and see how i can put the price as 2 decimal places thank you |
Tue, Dec 8 2015 9:33 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Matthew
>Given you have prices, I think that they should have the same number of >decimals. You probably also want to have it do the search when anyone >types any character (any change to the edit box). And do both at the >same time. So I could type "coke" and the list would be showing the >results narrow as I do. I'd keep the text too - clearing it means I >have to retype, but you could have a "clear" button to do that if it >will be necessary. I agree with you about the prices Given that I don't use EWB I may be being a complete moron here but I recommend that rather than responding to every edit change you have a timer linked to changes (I use the key up/down to cope with backspace etc) in the edit box an respond to the value of the edit box in there. DoFind.Interval is set to 150 which is short enough not to annoy and long enough to allow typing In Delphispeak procedure TCompaniesForm.FinderKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin DoFind.Enabled := False; end; procedure TCompaniesForm.FinderKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); begin DoFind.Enabled := True; end; procedure TCompaniesForm.DoFindTimer(Sender: TObject); begin DoFind.Enabled := False; if (Finder.Text <> '') and (Finder.Text[1] <> '=') then Companies.Locate('_Name', Finder.Text, [loCaseInsensitive, loPartialKey]) else Companies.Locate('_ID', StrToIntDef(Copy(Finder.Text, 2, MaxInt), -1), []); end; This one just does a locate, and is the first example I found. For filtering I use a slightly different strategy. Dump the KeyDown event, have a global string variable that's set in the timer event after setting the filter, and checked against the edit.text to see if the filter needs refreshing in the first place. Roy Lambert |
Tue, Dec 8 2015 9:42 AM | Permanent Link |
Riaz | Roy Lambert,
thank you Riaz |
Tue, Dec 8 2015 9:49 AM | Permanent Link |
Matthew Jones | Roy Lambert wrote:
> recommend that rather than responding to every edit change you have a > timer linked to changes Now you're just getting fancy! 8-) -- Matthew Jones |
Tue, Dec 8 2015 10:29 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Matthew
>Now you're just getting fancy! 8-) Nah - just copying those better than me. My "refinement" was to use keyup/down rather than keypress Roy |
This web page was last updated on Wednesday, August 14, 2024 at 03:12 PM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |