+ Review, Search, Requery, etc. buttons image
I want to add new button to toolbar of php grid. and link to the user defined function.
How can I do for this?
$g–>set_actions(array(
“add”=>true, // allow/disallowadd
“edit”=>true, // allow/disallow edit
“delete”=>true, // allow/disallow delete
“rowactions“=>true, // show/hide row wise edit/del/save option
“search“ => “advance” // show single/multi field search condition (e.g. simple or advance) ) );
Thank you for your answer to me.
I want to use the below function with the user-defined button.
jQuery(document).ready(function(){
jQuery(‘#list1’).jqGrid(‘navButtonAdd’, ‘#list1_pager’,
{
‘id’ : ‘Update Calendar’,
‘caption’ : ‘Update Calendar’,
‘buttonicon’ : ‘ui-icon-save’,
‘onClickButton’ : function()
{
// how to code to use the below function
},
‘position’: ‘last’
});
// Is this function right ??? I think it doesn’t work at all. where should I change?
function update_master($data)
{
// you can also use grid object to execute sql, useful in non-mysql driver
global $grid;
$str = “update DPLSchedule as m
set UpCN51 = (select count(HHT) from DPLmigration as d where d.pid=m.id and d.MgStatus = ‘SUCCESS’ AND d.HHT = ‘CN51’),
UpCT40 = (select count(HHT) from DPLmigration as d where d.pid=m.id and d.MgStatus = ‘SUCCESS’ AND d.HHT = ‘CT40’)
where m.id = {$data[“pid”]}”;
$grid->execute_query($str);
}