jeans_larghi Posted August 31, 2015 Share Posted August 31, 2015 Hi, I want to know how to read the text in a uniedit or unicombobox during editing when used in a column in unidbgrid. Using extEvent don't give me text except for the event "data" useful for remote queries. I need to manage and change edit text when data is no present in remote query, but ther is no possibility in dbgrid's unicombobox..... There are ways for manage events in controls embedded in grids? jeans_larghi (Sesamo Software collaborator) Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 1, 2015 Administrators Share Posted September 1, 2015 Hi Edits and Combos in grid are controlled by framework. Why do you need to read its text? I discourage it. Quote Link to comment Share on other sites More sharing options...
jeans_larghi Posted September 1, 2015 Author Share Posted September 1, 2015 Error handling. Edit editable combo box with fixed list to avoid errors and to suggest only values in the list. Autocomplete also in phase cancellation. All these actions can be programmed having full control of the text. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 1, 2015 Administrators Share Posted September 1, 2015 You can use ExtEvent onChange event and getValue() method to get last input value. Quote Link to comment Share on other sites More sharing options...
jeans_larghi Posted September 2, 2015 Author Share Posted September 2, 2015 the method getvalue() works well. For your business needs we need more control to offer our customers a multi-functional grid. We would like something the image attached. Also you need dbgrid with virtual scrolling. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 2, 2015 Share Posted September 2, 2015 Hi, * Pressing additional chars.. A possible solution, try,While it may help.. UniDBGrid1 -> .... function reconfigure(sender, store, columns, oldStore, the, eOpts) { //columns[2], 2 = your lookup column index columns[2].getEditor().on("keydown", function(obj, e){ if(!columns[2].getEditor().store.findRecord("val", obj.getRawValue() + String.fromCharCode(e.keyCode)) && e.keyCode!=8 && e.keyCode!=35 && e.keyCode!=36 && e.keyCode!=37 && e.keyCode!=38 && e.keyCode!=39 && e.keyCode!=40 && e.keyCode!=46){ e.preventDefault() } } ); columns[2].getEditor().on("change", function(obj, e){ if (obj.getRawValue() == "") { columns[2].getEditor().triggerEl.elements[0].dom.click(); columns[2].getEditor().triggerEl.elements[0].dom.click() } } ) } Best regards. Quote Link to comment Share on other sites More sharing options...
jeans_larghi Posted September 3, 2015 Author Share Posted September 3, 2015 I did as you posted, but I get an ajax error. What is wrong? Best regards. Quote Link to comment Share on other sites More sharing options...
jeans_larghi Posted September 3, 2015 Author Share Posted September 3, 2015 ajax error attached Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 3, 2015 Share Posted September 3, 2015 Hi, Hmm, What is your version uniGUI? Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 3, 2015 Administrators Share Posted September 3, 2015 Please show your complete code. Quote Link to comment Share on other sites More sharing options...
jeans_larghi Posted September 3, 2015 Author Share Posted September 3, 2015 delphi XE7 64 bit. unigui version 0.99.1195 procedure TscrQuadroE1.UniComboBox1RemoteQuery(const QueryString: string; Result: TStrings); begin if (Trim(QueryString)='') and (Length(QueryString) > 49) then Exit; UniMainModule.QueryComuneGriglia.Active := false; UniMainModule.QueryComuneGriglia.Params[0].Text := UpperCase(QueryString)+'%'; UniMainModule.QueryComuneGriglia.Active := true; UniMainModule.QueryComuneGriglia.First; while not UniMainModule.QueryComuneGriglia.Eof do begin Result.Add(UniMainModule.QueryComuneGrigliaCOM_COMUNE.AsString); UniMainModule.QueryComuneGriglia.Next; end; UniMainModule.QueryComuneGriglia.Active := False; EXTEvent on unidbrid function reconfigure(sender, store, columns, oldStore, the, eOpts) { columns[6].getEditor().on("keydown", function(obj, e){ if(!columns[6].getEditor().store.findRecord("val", obj.getRawValue() + String.fromCharCode(e.keyCode)) && e.keyCode!=8 && e.keyCode!=35 && e.keyCode!=36 && e.keyCode!=37 && e.keyCode!=38 && e.keyCode!=39 && e.keyCode!=40 && e.keyCode!=46){ e.preventDefault() } } ); columns[6].getEditor().on("change", function(obj, e){ if (obj.getRawValue() == "") { columns[6].getEditor().triggerEl.elements[0].dom.click(); columns[6].getEditor().triggerEl.elements[0].dom.click() } } ) } Thanks for your help. Quote Link to comment Share on other sites More sharing options...
jeans_larghi Posted September 3, 2015 Author Share Posted September 3, 2015 I'm new with extjs. sorry for the mistakes. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 3, 2015 Share Posted September 3, 2015 I'm sorry, Please, Can you create a small test case? Best regards. Quote Link to comment Share on other sites More sharing options...
jeans_larghi Posted September 3, 2015 Author Share Posted September 3, 2015 ok 15 minutes. thanks. Quote Link to comment Share on other sites More sharing options...
jeans_larghi Posted September 3, 2015 Author Share Posted September 3, 2015 I use Firedac with Firebird database. I enter the database also within the zip file. Is it OK for you??? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 3, 2015 Share Posted September 3, 2015 Ok.., you can attach the test case Quote Link to comment Share on other sites More sharing options...
jeans_larghi Posted September 4, 2015 Author Share Posted September 4, 2015 Test case .thanks for your time . testUnigui.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 4, 2015 Share Posted September 4, 2015 Ok, I will try analyze.. Best regards. Quote Link to comment Share on other sites More sharing options...
jeans_larghi Posted September 4, 2015 Author Share Posted September 4, 2015 ok thanks. Ajax error is not present, but does not work , after the second step blocks the edit. Best regards. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 4, 2015 Share Posted September 4, 2015 Hi.. I will analyze later.. There you can still use the Lookup field.. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 7, 2015 Share Posted September 7, 2015 Hi, I'm sorry.., try to analyze this example (with the above decision): "C:\Program Files (x86)\FMSoft\Framework\uniGUI\Demos\Desktop\GridLookupField" Best regards. Quote Link to comment Share on other sites More sharing options...
jeans_larghi Posted September 7, 2015 Author Share Posted September 7, 2015 ok thanks. If there is news on the topic please contact me. Quote Link to comment Share on other sites More sharing options...
SayeyeZohor Posted January 21, 2020 Share Posted January 21, 2020 On 9/7/2015 at 5:53 PM, jeans_larghi said: ok thanks. If there is news on the topic please contact me. FUNCTION TUniHesabresi_Forms.GetIndexFromValueOfCombobox(UCombo: TUniComboBox; Value: string): Integer; var I: Integer; BEGIN Result := -1; FOR I := 0 TO UCombo.Items.Count - 1 DO BEGIN IF Trim(UCombo.Items[I]) = Trim(Value) THEN BEGIN Result := I; Break; END; END; END; procedure TUniHesabresi_Forms.UQ_ExcelPropertiesBeforePost(DataSet: TDataSet); begin UQ_ExcelPropertiesExcelSheetIndex.AsInteger := GetIndexFromValueOfCombobox(UCombo_ExcelSheetName, UQ_ExcelPropertiesExcelSheetName.AsString); end; 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.