Hello,
I followed the info on changing normal buttons on the toolbar to custom ones… Unfortunately, the jQuery code shown in the example is NOT adding a button to my toolbar. So at the moment, there is no button anymore as I hide them (but re-add with jQuery).
Any help ?
Greetings,
Davy
Try adding custom button in grid load event.
php config:
$e["js_on_load_complete"] = "grid_onload";
$grid->set_events($e);
html part:
<script>
function grid_onload(id)
{
// try button add code here
}
</script>
Refer toolbar-button.php for custom button code.
Abu,
I will give that a try.
The way I was trying to do it, is with the information in the help section !
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('#list1').jqGrid('navButtonAdd', '#list1_pager',
{
'caption' : '',
'buttonicon' : 'ui-icon-pencil',
'onClickButton': function()
{
// your custom JS code …
function redireciona() {window.location="cadastrar.php";}
redireciona();
},
'position': 'first'
});
});
</script>
Greetings,
Davy
Abu,
I'm sorry if I'm sounding stupid, but where can I see the real code of the examples ?
If I go to the features tour page, I can look at the Source of the page, but can not see the internals of the example…
Is there an example package to download ?
As I'm quit new to PHP, I have no idea what to put inside the SCRIPT part of your example above ?
————–
$e["js_on_load_complete"] = "grid_onload";
$grid->set_events($e);
html part:
<script>
function grid_onload(id)
{
// try button add code here ???????
}
</script>
————–
Greetings,
Davy