How to activate the function with the user-defined button on the top toolbar

QuestionsHow to activate the function with the user-defined button on the top toolbar
Steve asked 5 years ago

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);
}

3 Answers
Steve answered 5 years ago

Please answer me on my question

Abu Ghufran Staff answered 5 years ago

You can bulk-edit code. It uses similar toolbar button and php callback function code.

https://www.phpgrid.org/demo/demos/editing/bulk-edit.phps

line 230-241, line 161-166

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Abu Ghufran Staff answered 5 years ago

If you face any issue in integration, email me code and i’ll suggest changes.

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

16 + 12 =

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?