When using bulkedit instead of edit the function stops working.
Code used:
$opt["bulkedit_options"]["afterShowForm"] = "function (id)
{
var rowid = jQuery(this).jqGrid('getGridParam','selrow')
var rd = jQuery('#list1').jqGrid('getCell', rowid, 'temp_id');
jQuery('select[name=assigned].FormElement').val(rd);
jQuery('select[name=assigned].editable').val(rd);
}";
"rowid" remains empty.
Using the same code for normal edit works just fine.
On line:
var rowid = jQuery(this).jqGrid('getGridParam','selrow');
Instead of 'this', use:
var rowid = jQuery('#list1').jqGrid('getGridParam','selrow')
Silly me, totally overlooked that part. You don't want to know how long I stared at it.. Anyway, the "rowid" and the "rd" are no longer empty!
But, jQuery('select[name=assigned].editable').val(rd); does not set the default on the pulldown in the bulkedit box.
Working demo for text box:
https://gist.github.com/gridphp/8df9a1499013fb49fdab979c5638f028#file-gistfile1-txt-L37
For your dropdown code to select default, the passed value must be an option of select to auto-select.