jquery - how to call php function from jqgrid button -
i'm trying when submit value jqgrid box on multiple selected rows update data of specific columns.my code when click ok in jqgrid nothing happens , function not called :
jquery(document).ready(function(){ jquery('#list1').jqgrid('navbuttonadd', '#list1_pager', { 'caption' : 'resubmit', 'buttonicon' : 'ui-icon-pencil', 'onclickbutton': function() { var str = prompt("please enter data of column") var selr = jquery('#list1').jqgrid('getgridparam','selarrrow'); $(selector).load('updatestatus.php', {'string': str,'box[]' : selr }) }, 'position': 'last' }); });
the function updates column of table:
function update_data($data) { // if bulk operation requested, (default otherwise) if ($data["params"]["bulk"] == "set-status") { $selected_ids = $data["cont_id"]; $str = $data["params"]["data"]; mysql_query("update out_$cmpname set cont_status = '$str' cont_id in ($selected_ids)"); die; } }
i'm new jqgrid , jquery.what can call , execute function when click ok? in advance!
you'll need ajax-call this. see you're using jquery, have @ http://api.jquery.com/load/
with function, can load php or html jquery element.
Comments
Post a Comment