How to refresh button show current page

QuestionsHow to refresh button show current page
chococat asked 9 years ago

$grid["reloadedit"] = true;

$grid["edit_options"]["afterSubmit"] = 'function(response) { $("#list1").trigger("reloadGrid", [{current:true}]);}';

..

$g->set_actions(array(
"refresh" => true, // show/hide refresh button
) );

..

Not work. You can help me

2 Answers
Abu Ghufran answered 9 years ago

You will need to remove the default refresh button.

$g->set_actions(array(
"refresh" => false
) );

And make a new toolbar button, that will have current page refresh js code.

To add custom toolbar button, refer demos/appearance/toolbar-button.php

<script type="text/javascript">
jQuery(document).ready(function(){

jQuery('#list1').jqGrid('navButtonAdd', '#list1_pager',
{
'caption' : 'Refresh',
'buttonicon' : 'ui-icon-refresh',
'onClickButton': function()
{
$("#list1").trigger("reloadGrid", [{current:true}]);
},
'position': 'last'
});
});
</script>

chococat answered 9 years ago

Thank You 😀

Your Answer

7 + 15 =

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?