Hello. when you press <TAB> the focus moves between the fieds of a record. Now, how can i do to select the text automatically the text of the field?.
Thanks.
You can set: $col["editoptions"]["onfocus"] = "this.select();";
$col = array();
$col["title"] = "Gender";
$col["name"] = "gender";
$col["width"] = "30";
$col["editable"] = true;
$col["editoptions"]["onfocus"] = "this.select();";
$cols[] = $col;
Hello. It doesn´t work. I look for $col["editoptions"]["onfocus"] in jqgrid_dist.php and i can´t find it.
Thanks.
In following demo, click on row > edit from toolbar > tab to gender field.
Live: http://www.phpgrid.org/demo/demos/appearence/group-headers.php
Code: http://www.phpgrid.org/demo/demos/appearence/group-headers.phps
Hello.It doesn´t work yet. The version if the file jqgrid_dist.php that i have is @version 1.5.2 build 20140707-0413. Besides, i can´t find where is implemented the event ONFOCUS.
Thanks for your help.
I want to add that i implement the code as you show me in the demo. I seems that the grid doesn´t know the event.
Thanks.
Grid internally translates editoptions array keys to input element attributes, so onfocus is handler by this rule.
You can put alert('test') statements there to show the effect.
Hello. I find that when the field is of type text it works, but when the type is textarea it doesn´t. Can you tell me why?.
Thanks aganin for your help!!.
First of all i must apoligize!!.I was making a mistake, objects of type textarea don´t work the same as thats of type text.
This:
$col["editoptions"]["onfocus"] = "this.select();";
will not work because the standart doesn´t allow.
So my solution was:
$col["editoptions"]["onclick"] = "this.focus(); this.select();";
Thanks.