Jump to content

Multiple uniSession.AddJS


Recommended Posts

Hi , 

I have this code on activecolumn to show roweditor and set focus to the first field .

unisession.AddJS(Grid.JSName+'.getPlugin().startEdit('+Grid.CurrRow.ToString+',0); ');
unisession.AddJS(Grid.JSName+'.getPlugin().editor.focus();')  ;

Row editor is shown but it doesn't set focus to the first field.

If I execute second command with uniTimer then it gets focus .

If I want to insert a new record on the first row then I must do it in 3 steps:

1, move to first record 

2, timer event to insert record 

3, and then timer event to send focus to the first field of roweditor

Is there a easier way to execute scripts without timers ?

 

Link to post
Share on other sites

Hi,

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

Also you can try to use Ext.defer:
 

Ext.defer(function(){
    //...
}, 500); //-> 500 ms

 

Link to post
Share on other sites

Thank You, I'll try it.

I found an issue for that i need to manualy send focus to the first field.

When the grid is set to edit with uni_sencha theme then row editor doesn't gets focus .

With other theme for example uni_win10 the row editor gets focus and work as it should.

There is some bug in sencha theme ..

Link to post
Share on other sites

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...