Using JavaScript for URL variable in an AjaxLink ?

I am trying to use a select box value as the url for an AjaxLink but my code doesn’t seem to be working. Is this possibile ?




echo CHtml::ajaxLink(Yii::t('admin','Apply to selected'),

	"js:$(#".$this->getId()."-actions).val())",

	array( // ajaxOptions

		'type' => 'POST',

		'beforeSend' => "js:function(request) {

			//pre-sending

			var checked = $.fn.yiiGridView.getChecked;

		}",

		'success' => "js:function(data) { // return data

			alert(data);

		}",

		'data' => "js:{chk:$.fn.yiiGridView.getChecked('".$this->getId()."','chk')}"

	),

    .......



Did you end up figuring this out or find another way? I’m also looking to do something similar using a javascript variable in the ajaxUrl of a cgridview

you cannot use javascript inside php since php is serverside,js is not…

What u have to do is to look at the javascript src ajaxLink produces thrue example firebug, copy that into your app,remove the widget,put your javascript variable as the url (will be obvious where it fits) and be happy