Column Order Number Error
Hi,
I'm trying to use column_order for my relation manager. This is my code:
Track Model
Release Model
Relation manager
Why when I create/attach data, the column_order (in my case track_order) is not auto created? I need to reorder it first so the order number is showed and save into database.
Is this a bug or what? because I didn't get this error before
3 Replies
Sorry for the last file
Up
It's not a bug, You have to set it manually. If in your database you didnt define a default value the data is null if column is nullable.
What I do is when I create the record I count all the models and set the sort column to be $totalcount + 1.
Ex: If you have 5 tracks already on DB, when I create another, the order will be 6 because 5 + 1
Something like that (not tested)