Hello everyone
I have been using PRADO for 2.5 years now,earlier this month we decided to abandon it completely and migrate our projects on Yii, which is one of the best frameworks existing as I believe.
I have been able to fix mostly all problems I had, but I have small problem I couldn’t fix in using ajax.
I have a clistview, which populates render items according to received data, inside each item there is an ajaxLink, this link sends a request to the controller with data unique to each rendered item.
it works fine on the first page, but when i change the page (ajax pager), it stops working.
the viewer
<?php echo CHtml::ajaxLink(
$img,
array('shout/ajaxTest'),
array(
'update'=>'#req_res'.$data->id,
'data'=>array('fileurl'=>$data->Url(),'imageurl'=>$data->getRecord('ImageUrl')),
'type'=>'post',
)
);
?>
</div>
<div id="req_res<?php echo $data->id; ?>"><?php echo $data->id; ?></div>
What i figured out so far is that a unique javascript for each item is populated in the page , attached to id of the item container "yw0, yw1 …etc", so when i change the page, the first new item in the new page will trigger the js for yw0, which is populated for the first page.
The question is, is there a way to update the js from CListView so it works even when i change the page? I saw several ajax problems used clientscript and other solutions that didn’t work with me.
If there is no solution in yii, what would be the jquery method best for this scenario?
Thanks !