The difference is that in the on that works you have ‘$data->id’ (with quotes), CGrid evals this parameter with the grid data. And in your ajax statement it is the value of the current page.
try to put everything under quotes but im not sure it will work:
The value in ‘updateButtonOptions’ is treated as static value, not PHP expression. Therefore, your approaches won’t work.
Because each button (link) already has a ‘href’ attribute which contains the URL you want, you could drop ‘ajax’ option and write the following js code instead to achieve your goal:
$('...selector for buttons..').click(function(){
var url=$(this).attr('href');
$.ajax({
url: url
});
});
but if i use this aproach, my url will be define, and when there is an onclick event triggered, then it wont be an ajax action anymore, but an actual page reload, isnt it? (of course the aja action will be also executed)
what do you mean click handler? for the javascript stuff? But if i make that as a false, then it wont be an ajax action. And i want just ajax action instead of reload the page