is there a defined phpgrid option to focus a paticular column or field input first.

Questionsis there a defined phpgrid option to focus a paticular column or field input first.
toki asked 11 years ago

Hi,

Is there a defined phpgrid option to focus a paticular column or field input first?
e.g. To focus third field input not first field input when Add or Edit dialog form is opened.

Regards…

3 Answers
Abu Ghufran answered 11 years ago

For this case, you need to edit core lib (jqgrid_dist.php)

search for code …
$this->options["add_options"]["beforeShowForm"] = 'function(formid) { '.$str_add_form.' }';
and put following line after that.

$this->options["add_options"]["afterShowForm"] = 'function(formid) { jQuery("#gender").focus(); }';

This will focus e.g. gender field at form display.

Abu Ghufran answered 11 years ago

This would solve your problem.

$grid["add_options"]["afterShowForm"] = 'function(formid) { jQuery("#gender").focus(); }';
$g->set_options($grid);

PS: Ignore last reply.

TOKÄ° answered 11 years ago

Abu,

Yes, your code works perfect.

Thank you.
Regards….

Your Answer

1 + 13 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?