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 2 months 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 1 month ago

Please answer me on my question

Abu Ghufran Staff answered 1 month 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
PHP Grid Framework
 
Abu Ghufran Staff answered 1 month ago

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

_________________________
Abu Ghufran - Dev Team
PHP Grid Framework
 
Your Answer

14 + 9 =

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 / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!