Suggestion On Yii2 If It Is Or Will Be Some How Problem

Hi I am web developer, some may think I am lazy, but it will save my numbers of hours and other developers time too.

When I generate the curd for basic admin section the field are sorted, and why we need auto sorting of generated form element.

I design database with the field which come first and which come after that, there may be only few up and down field but most of are in sorted during database design.

So when i generate the curd using Yii they their order get messed, and I don’t this this will be easier and handier for other, we have work but we don’t want to work.

I am just asking for suggestion, but If there is any mean to make not to sort those field than I am ready to make changes and implement it.

“This is only suggestions to Yii Development team, I can’t be your part I am growing in your platform”

Thank you.

Can you please clarify of what kind of order you are talking? Order of columns or order of rows?

I believe he is referring to the sequence of table columns in his EER diagram versus the order of the columns in the generated CRUD views. That is, he designs his tables with the columns in the order in which they should appear in the views, but that order is not followed when the CRUD is generated.

there is not much we can do about that. Yii relies on the schema information from the DBMS and the order that is returned from that.

I use MySQL Workbench and place my columns in a specific order. When the database is generated or updated, the columns remain in the same order as the EER diagram. Gii changes the order when crud is generated.

I think this isn’t any issue, it must be done for some reason, but we as developer must to know the reason

The columns metadata is probably queried from internal sources like INFORMATION_SCHEMA as per the Schema::findColumns method. I think the query to retrieve this data can be sorted/ordered by ORDINAL_POSITION for each table_name and table_schema to get the column sorting as per original table definition.

Do you think this is will be helpfull or worthless in future. Is there any chances of being solved not to auto sort if user don’t want to sort its table field

you could report an issue on github when you want this to be fixed.