How to update grid options $opts['edit_options']['bottominfo']

QuestionsHow to update grid options $opts['edit_options']['bottominfo']
CJ asked 7 years ago

I have a grid with an action button within the child grid. When the user clicks it, an edit form is presented, and I use the edit_options to display important information to the user. When the submit their changes, and click another button in the grid, the same bottom info is shown. I need to change it to something else (a PHP function already has the updated text)…how do I update the grid option? Here is what I have now:

$opts['edit_options']['bottominfo'] = "To make new sample code:<br><b>{$rechk_vars['sample_code']}</b><br>";
$grid->set_options($opts);

3 Answers
CJ answered 7 years ago

Sorry…forget "child grid". Just a grid…

CJ answered 7 years ago

Was able to fix the problem myself. Ended up using the "edit_options"'s "afterShowForm", and associate that option with a client-side script that loaded a new PHP page and replaced the bottominfo with the desired data. edit option looked something like this:

$opts['edit_options']['bottominfo'] = "RESULT";
$opts["edit_options"]["afterShowForm"] = 'function(formid) {
$.post("/path/to/phpfile/myresultmsg.php", function(data){
jQuery("td.bottominfo").text(data);
});
}';

The myresultmsg.php file simply returned the text I was needing to show to the user.

Abu Ghufran answered 7 years ago

Thanks for sharing.

Your Answer

9 + 2 =

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?