Reload grid on update

QuestionsReload grid on update
Ananda Theerthan asked 11 years ago

Hi,
How do I refresh or reload the grid after on_update event is fired.

8 Answers
Abu Ghufran answered 11 years ago

You can force reload grid after each edit by setting:

$opt["reloadedit"] = true;

$g->set_options($opt);

Arne answered 11 years ago

hi!
it seems to me that the $opt["reloadedit"] = true; does not have any effect.
Every time I edit a record, the hole grid is uploading (is shows the massage 'Loading').

I like to have all the record on the screen and then use a scollbar to find and edit my records. That works fine, but If I edit a row that I found using the scrollbar (that is not on the first page), the grid is refreshed and I loose the focus as now the first page is in the present window.

So if the grid was not refreshed I think it would be better.

Here is my setting:

$grid["rowNum"] = 2000; // big so all records is in one page!
$grid["height"] = "460";
$grid["autowidth"] = false;
$grid["sortname"] = 'anleggNavn';
$grid["sortorder"] = "asc";
$opt["reloadedit"] = false; // DOES NOT WORK?

$g->set_options($grid);
$g->set_actions(array(
"add"=>false, // allow/disallow add
"inlineadd"=>true,
"edit"=>true, // allow/disallow edit
"delete"=>true, // allow/disallow delete
"view"=>true, // allow/disallow delete
"rowactions"=>true, // show/hide row wise edit/del/save option
"export"=>true, // show/hide export to excel option
"autofilter" => true, // show/hide autofilter for search
"search" => false // show single/multi field search condition (e.g. simple or advance)
)
);

Abu Ghufran answered 11 years ago

Instead of $opt … it should be $grid as per your code.

$grid["sortorder"] = "asc";
$grid["reloadedit"] = true; // <——–
$g->set_options($grid);

Arne answered 11 years ago

yes of course it has to be $grid. Sorry.
But after I changed it, it still reload when I edit a row….
?
Do I need to set some other options too?

Abu Ghufran answered 11 years ago

If you are using edit dialog, set:

$grid["edit_options"]["reloadAfterSubmit"]=false;

Arne answered 11 years ago

lovely!
This work perfect!

🙂

[email protected] answered 5 years ago

for me doesn’t work on that…

$grid = new jqgrid($db_conf);

$opt[“toolbar”] = “bottom”;
$opt[“caption”] = “Bancos”;
$opt[“height”] = “320”;
$opt[“sortname”] = ‘fecha’; // by default sort grid by this field
$opt[“sortorder”] = “DESC”; // ASC or DESC
$opt[“rowNum”] = 60; // by default 20
$opt[“width”] = “1320”;
$opt[“toolbar”] = “both”;
$opt[“form”][“position”] = “center”; // or “all”
$opt[“resizable”] = true;
$opt[“altRows”] = true;
$opt[“altclass”] = “myAltRowClass”;
$opt[“footerrow”] = true;
$opt[“reloadedit”] = true;

$grid->set_options($opt);

 

 

 

Abu Ghufran Staff answered 5 years ago

Hi,

Check browser console for possible JS errors. Also check the response of the update ajax call in network tab for possible error.

Send error details and share full grid code.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

1 + 0 =

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?