CHtml::ajaxSubmitButton

I’m trying to make an ajaxButton using this :


echo CHtml::ajaxSubmitButton('Delete selected',array('menu/delete','ajax'));

but i obtain :

POST http://127.0.0.1/menu/index?0=ajax

How i can obtain http://127.0.0.1/menu/index?ajax=yw0

?

Why the CHtml elements can’t accept a Controller::createUrl() as url parameter ?

What does the ajax param mean in your example? In order to set a param you would have to use a syntax like




array('menu/delete','ajax'=>'someValue')

//In your case

echo CHtml::ajaxSubmitButton('Delete selected',array('menu/delete','ajax'=>'yw0'));



Just keep in mind that you are obviously setting auto created widget ids as params (yw0). You should assign your own ids to widgets, otherwise another widget could have the same id and that can be hard to debug

greetings,

Hannes