Yii Framework Forum: [Solved]Keep Cgridview Selection After Submit - Yii Framework Forum

Jump to content

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

[Solved]Keep Cgridview Selection After Submit [SOLVED] Rate Topic: -----

#1 User is offline   lagogz 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 453
  • Joined: 30-November 12
  • Location:Galiza

Posted 23 January 2013 - 06:11 AM

Good morning.

Is there any way to keep the selection of a CGridView if form submit fails because the data already exists?

I want save into database FiledName='xxx', but 'xxx' data already exists in database. Then, it shows the validation notice, but loses the seleccion of a possible CGridView in same page.

Thanks.
-----------------------------------------------------------------------------------------------
------------------------------- VISITEN FOCUCHASART --------------------------------
-----------------------------------------------------------------------------------------------
0

#2 User is offline   lagogz 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 453
  • Joined: 30-November 12
  • Location:Galiza

Posted 24 January 2013 - 05:40 AM

Anybody has faced this scenario?
-----------------------------------------------------------------------------------------------
------------------------------- VISITEN FOCUCHASART --------------------------------
-----------------------------------------------------------------------------------------------
0

#3 User is offline   MadAnd 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 109
  • Joined: 16-June 11
  • Location:Ukraine

Posted 24 January 2013 - 06:43 AM

Hi,

if I understand you correct, you have both a grid view and a form on the same page. If so, you could try to use CActiveForm and utilize its ajax-validation capability. It will allow to perform validation without page reload, unless we sure that data in the form is correct.
1

#4 User is offline   lagogz 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 453
  • Joined: 30-November 12
  • Location:Galiza

Posted 25 January 2013 - 07:44 AM

Thanks for reply.

I'm thinking another way to do it, and if I get, I'll post here.

Anyway any idea is welcome.

Regards.
-----------------------------------------------------------------------------------------------
------------------------------- VISITEN FOCUCHASART --------------------------------
-----------------------------------------------------------------------------------------------
0

#5 User is offline   lagogz 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 453
  • Joined: 30-November 12
  • Location:Galiza

Posted 05 February 2013 - 09:28 AM

I used SelGridView extension and it works!

Regards.
-----------------------------------------------------------------------------------------------
------------------------------- VISITEN FOCUCHASART --------------------------------
-----------------------------------------------------------------------------------------------
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