On Dec 19, 7:01 am, AD7six <[email protected]> wrote:
> On Dec 18, 10:55 pm, Colin <[email protected]> wrote:
>
>
>
> > Thanks for your reply Mark.
>
> > The logic in my app is working fine, the issue I have is that when I
> > insert a row into my table table1_table2 all the weights get adjusted.
> > eg:
>
> > table1_id table2_id weight
> > 1 1 1
> > 1 2 2
> > 1 3 3
> > 2 4 1
> > 2 5 2
> > 2 6 3
>
> > Now if I insert
> > 1 7 2
>
> > I get
>
> > table1_id table2_id weight
> > 1 1 1
> > 1 2 3
> > 1 3 4
> > 2 4 2
> > 2 5 3
> > 2 6 4
> > 1 7 2
>
> > Note, all the weights have incremented, but I only want the weights
> > for table1_id == 1 toincrement.
>
> > any thoughts?
>
> There's nothing in cake that would do that so the code that you wrote
> is wrong ;)
Yes there is....
The sortable behaviour by Dardo Sordi - Forgot all about it hidden
away model.php
The change I needed was to define 'cluster' => 'table1_id'
So easy when you know how.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---