cristianotestai Posted November 5, 2017 Share Posted November 5, 2017 Hello! I did a simple test case attached with 1 UniComboBox, 1 UniEdit and 1 UniImage, where in the change of the selected item in the Combo, it makes simple changes in the properties of the components. How to accomplish this in clientside? Which UniComboBox event to use? Thank you for your help. ComboBox.rar Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 6, 2017 Share Posted November 6, 2017 Hi, UniComboBox -> ClientEvents -> ExtEvents -> function change : function change(sender, newValue, oldValue, eOpts) { } Best regards, Quote Link to comment Share on other sites More sharing options...
cristianotestai Posted November 8, 2017 Author Share Posted November 8, 2017 Hi, UniComboBox -> ClientEvents -> ExtEvents -> function change : function change(sender, newValue, oldValue, eOpts) { } Best regards, Hi Delphi Developer, I tried to use the change function as you indicated and just to test: function change(sender, newValue, oldValue, eOpts){ fmTaskEdit.edRegName.focus(); } But not work. Besides setting the focus i also need when changing the item in the ComboBox in clientside script: to set ReadOnly property of a UniEdit; to set Visible property of a UniImage; to set Hint property of a UniImage; Could you help? Thanks! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 8, 2017 Share Posted November 8, 2017 Ok, I will try Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 8, 2017 Share Posted November 8, 2017 Hi, I just tried to convert Delphi code to JS code, try this: function change(sender, newValue, oldValue, eOpts) { var me = sender; var indx = me.store.indexOf(me.findRecord(me.valueField || me.displayField, me.getValue())); MainForm.UniEdit1.setReadOnly(indx == 0); MainForm.UniImage1.setVisible(!MainForm.UniEdit1.readOnly); switch (indx) { case 1: MainForm.UniImage1.setElProp("title", me.getValue(), 2); break; case 2: MainForm.UniImage1.setElProp("title", me.getValue(), 2); }; if (MainForm.UniEdit1.readOnly == false) { Ext.defer(function() { MainForm.UniEdit1.focus(); }, 100); }; } Best regards, Quote Link to comment Share on other sites More sharing options...
cristianotestai Posted November 11, 2017 Author Share Posted November 11, 2017 Hi, I just tried to convert Delphi code to JS code, try this: function change(sender, newValue, oldValue, eOpts) { var me = sender; var indx = me.store.indexOf(me.findRecord(me.valueField || me.displayField, me.getValue())); MainForm.UniEdit1.setReadOnly(indx == 0); MainForm.UniImage1.setVisible(!MainForm.UniEdit1.readOnly); switch (indx) { case 1: MainForm.UniImage1.setElProp("title", me.getValue(), 2); break; case 2: MainForm.UniImage1.setElProp("title", me.getValue(), 2); }; if (MainForm.UniEdit1.readOnly == false) { Ext.defer(function() { MainForm.UniEdit1.focus(); }, 100); }; } Best regards, Thanks Delphi Developer! This work! Best Regards, Cristiano 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.