-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to work with ActiveRecord models? #303
Comments
Should I use the JSON column database type for fields? Also, I noticed, that 'sortable' has some strange behavior when using JSON database column type: it doesn't change row indexes after sorting, so after saving the result has no effect (the order is based on row numeric "keys", they don't changing after sorting). |
did you read the article https://github.com/unclead/yii2-multiple-input/wiki/Basic-scenario-of-usage ? Originally it was created only to provide a simple way to manage similar data such as email/phones without the necessity to reinvent the wheel each time. If you want to implement a trait or a yii behavior to simplify processing data on server-side, PR is always welcome |
And what about JSON type in database column? Sortable not working in this case, because of fixed array indexes. JSON type is preferable for such data. |
@kwazaro still relevant or I can close the issue? |
You should mention in description that this component doesn't support sorting for JSON fields. There is no solution for now. |
How to automatically save data to database and read it for widget using ActiveRecord models? No information or examples provided, only examples with \yii\base\Model. Maybe, some Trait should be created, to convert data to JSON and back to PHP array? It is not good idea to edit controllers. I think data conversion should be done by this extension automatically, because without this using of extension is not convenient.
The text was updated successfully, but these errors were encountered: