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

  • Home
  • SEARCH
  • 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 6996233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:07:48+00:00 2026-05-27T20:07:48+00:00

FOUND THAT CStarRating is causing this error if it is removed it gets ok.Also

  • 0

FOUND THAT CStarRating is causing this error if it is removed it gets ok.Also CStarRating makes page render extremely slow plus it also causes other jquery plugins to malfunction

I have used confirmation inside a Jquery acordin. main tabs of acordin are Categories and in side there is Items. User can delete both Items and Categories(of course different tables and models).

Now when I click on delete category it asks should it delete or not …..Till now everything is fine but as long as I click cancel AND category has Items in its panel confirm repeats itself for number of items time. following is my code. Please help me out

Following Image will illustrate what I mean enter image description here
Thanks

<?php
foreach($model->categories as $Category){
        echo  CHtml::link('<span id="add_new_item">Add New Item </span>', array('items/create','id'=>$Category->id));
        echo ' <span id="update_del_category">';
        $image = CHtml::image('/Hunt2Eat/assets/b4e73c2b/gridview/update_item.png', 'Update', array('class' => 'view'));
        echo  'Edit';
        echo  CHtml::link($image, array('category/update', 'id'=>$Category->id));
        $image = CHtml::image('/Hunt2Eat/assets/b4e73c2b/gridview/delete_item.png', 'Delete', array('class' => 'view'));
        echo  ' Delete';
        echo  CHtml::link($image,'#',array('submit'=>array('category/delete','id'=>$Category->id),'confirm' => 'Are you sure you want to delete '.$Category->name.'?'));

    echo  '</span>
          <ul style="width:99%;" id="menu3" class="menu noaccordion">
            <li style="width:100%; ">
                <a href="#" style="color:white; padding:6px 0 6px 5px;">'.$Category->name.'</a>
                    <ul style="width:99%">
                        <div id="item_headings">
                             <label id="item_name"> Name </label>
                             <label id="item_price"> Price (PKR)</label>
                             <label id="item_rating"> Rating </label>
                        </div>';

foreach($Category->items as $Item)
    {
    echo  '<div id="update_del_item">';
    echo   CHtml::link('Edit', array('items/update', 'id'=>$Item->id));
    echo  '</div>
                 <div id="update_del_item">';
    echo  CHtml::link('Delete','#',array('submit'=>array('items/delete','id'=>$Item->id),'confirm' => 'Are you sure?'));
    echo  '</div>
                <li >
                <a href="#" name="Item">
                    <div style="height:20px; width: 360px;">
                        <span id="item_list">'.$Item->name.'</span>
                        <span id="item_list">'.$Item->price.'</span>
                        <span style="float:right;">'.$this->renderPartial('_rating',array('model'=>$model),TRUE,TRUE).'</span>
                    </div>    
                </a>                
            </li>';
}//For Loop to Extract category Items from category Array
    echo 
           '</ul>
        </li>
     </ul>';
}//For Loop to Extract Categories from Hotel array

?>
  • 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-05-27T20:07:49+00:00Added an answer on May 27, 2026 at 8:07 pm

    I think the problem is from multiple event delegations of jquery.
    For

    echo  CHtml::link('Delete','#',array('submit'=>array('items/delete','id'=>$Item->id),'confirm' => 'Are you sure?'));
    

    Yii framework will give the anchor a unique id and register a piece of javascript(jquery) in html as:

    jQuery('body').undelegate('#yt0', 'click').delegate('#yt0', 'click', function() {
        if (confirm('Are you sure?')) {
            jQuery.yii.submitForm(this, '/index.php/items/delete/4', {});
            return false;
        } else return false;
    });
    

    where yt0 is the unique id assigned. Usually there is no problem since it does undelegating first. Can you check the javascript registered by Yii?

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

Sidebar

Related Questions

I found that the $.each is very slow and makes problems to the web
I found that this C++ code: vector<int> a; a.push_back(1); a.push_back(2); vector<int>::iterator it = a.begin();
I found that each thread still has its own registers. Also has its own
I found that this answer was asked and answered before VS2010 was actually released.
I found that quite a few toolbar in web page is implemented with HTML
I found that using BmpBitmapEncoder to render any type of image works, the only
I found that in Google+ Project's page that buttons are all made from divs
I found that in the center of Mozilla home page , there is a
I found that making a table with <table style=padding-left: 100px; width: 200px> makes the
I found that sometimes when I write the name of a site it gets

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.