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) 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. 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. 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. 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. 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. 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. 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 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? 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. 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. 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. 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. 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. 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??? 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 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 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. 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. 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.. 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. 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. 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; Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now