Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8405435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:51:10+00:00 2026-06-09T22:51:10+00:00

I have a CListView that uses ajaxLink() in the _view file. View (index.php) <?php

  • 0

I have a CListView that uses ajaxLink() in the _view file.

View (index.php)

<?php

Yii::app()->clientScript->registerScript('ajaxUpdate',
"
//javascript function to update the listview using ajax
function updateItemList(){
    $.fn.yiiListView.update('itemList');
    return false;
}

", CClientScript::POS_READY);

?>
<?php $this->widget('zii.widgets.CListView', array(
    'dataProvider'=>$dataProvider,
    'itemView'=>'_view',
    'id'=>'itemList',

)); ?>

partial (_view.php)

<?php echo CHtml::ajaxLink('Delete',array('libdbitems/delete','id'=>$data->id),
                array('type'=>'POST','success'=>'function(){updateItemList()}'),
                array('confirm'=>'Are you sure you want to delete this item?',
                    'id'=>'delete-'.$data->id));  ?>

The controller is basically just the default actionIndex() that is generated with Gii.

Here’s the problem: when I click my Delete link the first time after a page load, it behaves as expected. After that, clicking Delete does nothing. (It refreshes the ListView, but no changes are made.)

I’m pretty sure the problem lies in how Yii is binding click() events to my links in javascript, but I have no idea how to fix it. I have tried using the live=true option as others have suggested, but it does nothing.

Does anyone know how to fix this issue so that my Delete link works multiple times without having to reload the page?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T22:51:11+00:00Added an answer on June 9, 2026 at 10:51 pm

    Eh, a stupid fix. I realized I had accidentally left a CHtml::$liveEvents = false in my controller that I put there while I was still earlier in the troubleshooting phase.

    The solution is just to leave CHtml::$liveEvents = true (default) and to make sure all the links have unique IDs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple BlackBerry app i'm working on that uses JSONP and Zepto.js.
I'm developing for Android and I have an app (called Forget-Me-Not) that uses a
I have an Android App that uses a TabHost layout. Every tab calls the
We have an app that uses simple one way binding with a GridView to
I have developed a very simple app that uses a custom adapter for a
I have an app that uses a a paint flag to set strike-through on
I have a ListView that uses a custom layout that has 5 child View
I have a custom dialog that uses an xml file to setup the layout,
I have an android app that uses ActionbarSherlock and I want to put an
I'm creating a mobile view that uses backkbone.js and jquery mobile. I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.