Yii Framework Forum: Unable To Delete A Record With Yii Crud - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Unable To Delete A Record With Yii Crud Rate Topic: -----

#1 User is offline   developer! 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 110
  • Joined: 28-November 12

Posted 24 January 2013 - 08:01 AM

Hi Experts,

I have generated crud using gii and when i'm trying to delete a record its not happening.. anyone any idea pls...

this is the delete menu code generated by yii's gii

array('label'=>'Delete Record', 'url'=>'#', 
'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),
'confirm'=>'Are you sure you want to delete this item?')),




Many Thanks
0

#2 User is offline   Keith 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,520
  • Joined: 04-March 10
  • Location:UK

Posted 24 January 2013 - 08:07 AM

Are you getting an error of any kind?
0

#3 User is offline   developer! 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 110
  • Joined: 28-November 12

Posted 24 January 2013 - 08:08 AM

View PostKeith, on 24 January 2013 - 08:07 AM, said:

Are you getting an error of any kind?

nothing..its just staying in view itself :(. its not even firing or coming up any message
0

#4 User is offline   Keith 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,520
  • Joined: 04-March 10
  • Location:UK

Posted 24 January 2013 - 08:12 AM

Is the deletion confirmation message appearing?
0

#5 User is offline   developer! 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 110
  • Joined: 28-November 12

Posted 24 January 2013 - 08:29 AM

View PostKeith, on 24 January 2013 - 08:12 AM, said:

Is the deletion confirmation message appearing?

no nothing happening keith..its just staying in view page..except #coming up in end of the url..what could be the reason??
0

#6 User is offline   samilo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 228
  • Joined: 04-October 12

Posted 24 January 2013 - 08:37 AM

Use firebug or tamper data to check if your request sent

also try to delete this line in your controller :
public function filters()
{
return array(
'accessControl', // perform access control for CRUD operations
////// 'postOnly + delete', // delete this line
}

let me know what happened with you
0

#7 User is offline   developer! 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 110
  • Joined: 28-November 12

Posted 24 January 2013 - 08:45 AM

thanks for your response samilo,

request is not going.. and just # appearing in url at the end.

now, I found some jquery script is blocking it to fire which i have written a week ago. how can i solve this now ...
0

#8 User is offline   samilo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 228
  • Joined: 04-October 12

Posted 24 January 2013 - 08:55 AM

1- check your browser if Javascript was disabled
2- Add your controller code to check your delete problem
0

#9 User is offline   developer! 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 110
  • Joined: 28-November 12

Posted 24 January 2013 - 09:02 AM

Solved
this was the javascript error "Uncaught TypeError: Object [object Object] has no method 'apply'" stopped me to delete it by showing dialogue box...

http://stackoverflow...no-method-apply

i've solved this by wrapping my function with function(){}.
as described in the link above. Its working fine now..

.hover(function(){ ... });

now i'm getting this "javascript uncaught syntaxerror unexpected token" error after wrapping function with function(){}

trying to solve this error in order to prevent any this kind of problem in future.

but my problem solved :)


Thanks everyone :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users