Jump to content


set_relation_n_n with a value

set_relation_n_n set value on relation

  • Please log in to reply
5 replies to this topic

#1 dinhopereira

dinhopereira

    Member

  • Members
  • PipPip
  • 10 posts

Posted 18 June 2014 - 03:59 PM

Hi all...

 

In the image I have an example of what I really need.

 

I would like set a value on price field during on set_relation_n_n. Its possible?

 

 

 

Attached Thumbnails

  • realestate.jpg


#2 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 19 June 2014 - 04:45 PM

well.. tell me 1 thing.. do u want to make manual entry for the same or you want to make automatic entry for value based on key selection ?? what is the requirement. Based on that, a solution can be provided for



#3 dinhopereira

dinhopereira

    Member

  • Members
  • PipPip
  • 10 posts

Posted 19 June 2014 - 10:14 PM

well.. tell me 1 thing.. do u want to make manual entry for the same or you want to make automatic entry for value based on key selection ?? what is the requirement. Based on that, a solution can be provided for

 

I want to make manual entry for value based on key selection, example:

A propertie for rent with a especific value, and the same propertie for sale with other value.



#4 dinhopereira

dinhopereira

    Member

  • Members
  • PipPip
  • 10 posts

Posted 25 June 2014 - 01:33 AM

?



#5 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 25 June 2014 - 03:08 AM

Well 1 simple thing... if there are not many objectives .. then u can reduce the relation and store the objective prices in the property table itself.

Other way for the same can be - you can add action to property in listing to manage objectives for the property. There u can keep adding objective and price keeping the property id selected / hidden by default. This way u can manage it with ease...

Other is a complex way where u can have add objective / price button .. when clicked, u dynamically add the fields  - select the objective - set price.
And before insert, u can pickup each entries .. store them into a session variable, remove from the post ... and in post insert callback,
retrieve the data from the session and store each entry into the respective table.

Hope this works out for you.

Happy GCing :)



#6 holmesii

holmesii

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 25 June 2018 - 01:01 PM

mark







Also tagged with one or more of these keywords: set_relation_n_n, set value on relation

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users