Default value pulldown with bulkedit

QuestionsDefault value pulldown with bulkedit
Michael Stender asked 3 years ago

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.

4 Answers
Abu Ghufran answered 3 years ago

On line:

var rowid = jQuery(this).jqGrid('getGridParam','selrow');

Instead of 'this', use:

var rowid = jQuery('#list1').jqGrid('getGridParam','selrow')

Michael Bawden answered 3 years ago

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.

Abu Ghufran answered 3 years ago

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.

Michael Bawden answered 3 years ago

Thanks Abu, you have no idea how much easier phpgrid makes my site for my clients.
Keep up the good work!

Your Answer

9 + 18 =

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?