Jump to content

Recommended Posts

Posted
function specialkey(sender, e, eOpts)
{
     if (! (e.shiftKey) && (e.getKey () == 13)) 
    {
 
       e.stopEvent ();
       frmOrder.FindAccountFrame.cmbAccount.focus();
    }
}

I want to set focus of cmbAccount control

cmbAccount is owned by FindAccountFrame frame.

 

thanks for help

Posted

i have a frame as Component (TFindAccountFrame)
this frame contain a combobox named cmbAccount
I want to move the focus from a control to
cmbAccount by Enter key

but this code note work : frmOrder.FindAccountFrame.cmbAccount.focus();

How I can get the right name of cmbAccount in specialkey evevt.

 

thanks

Posted

i made similar thing .. for me works:

 

 

 

(MainForm.FCurrentFrame1 as Tmy_frame_name).uniedit .. set focus

 

 

 

 

FCurrentFrame1 is TUniFrame

 

 

i load frames with:

procedure TMainForm.InsertFrame1(Name: string);   
begin
      if FFrameName1 <> '' then FreeAndNil(FCurrentFrame1);
      FFrameName1:=Name;
      FCurrentFrame1:=TUniFrameClass(FindClass(Name)).Create(self);
      FCurrentFrame1.Align:=alClient;
      FCurrentFrame1.Parent:=display;//uniscrollbox1;
Posted

Thanks all

my problem in javascript code

finally I slove it by this code

 s:='function specialkey(sender, e, eOpts) '+
    ' { '+
    '  if (!(e.shiftKey) && (e.getKey() == 13))'+
    '  {   '+
    '       e.stopEvent();  '+
    '     '+FindAccountFrame.cmbAccount.JSName+'.focus();'+
    '  }'+
    ' }';

 cmbType.ClientEvents.ExtEvents.Values['specialkey']:=s;

but why frmOrder.FindAccountFrame.cmbAccount.focus(); not work?

Posted

Hi,

 

But why frmOrder.FindAccountFrame.cmbAccount.focus(); not work?

 

ExtJS's focus( [selectText], [delay] ) method accepts defer (delay) as an argument, so you can try to use it:

frmOrder.FindAccountFrame.cmbAccount.focus(false, 250);

Best regards,

Posted

Hi,

 

frmOrder.FindAccountFrame.cmbAccount.focus(false, 250);

 

Sorry, I did not notice it, yes it will not work

 

FindAccountFrame.cmbAccount - it is Correct

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...