EasyUI Forum
May 15, 2024, 10:07:30 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: element.focus is not working  (Read 11969 times)
manojvijayan
Newbie
*
Posts: 13


View Profile Email
« on: December 24, 2012, 01:03:12 AM »

Hi,

Please see the url:
http://cochinwebdesign.com/dance/admin/

username :admin
password: admin

Select any of one link from left, then press add button on top of the screen.
document.form.name.focus() and $('#mainForm')[0].focus(); both are not working.

Could u please provide some sample code?

Thanks in advance..................

Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: December 24, 2012, 02:39:41 AM »

The simple way to solve your problem is to override your 'loadPage' function as below:
Code:
function loadPage(url,a,contentPanel){
//...
var p = $('#'+contentPanel);
p.panel('options').onLoad = function(){
$('#mainForm').find('input[name=title]').focus(); // here is the focus code
};
p.panel('refresh',url);
//...
}

Another way is to add the following code snippets in your php file that will be loaded.
Code:
<script>
$('#mainForm').find('input[name=title]').focus();
</script>
Logged
manojvijayan
Newbie
*
Posts: 13


View Profile Email
« Reply #2 on: December 24, 2012, 05:16:44 AM »

Thanks  stworthy .

The first option is working.

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!