-
Notifications
You must be signed in to change notification settings - Fork 110
Column added with Crud::addColumn after Crud::setModel should be added before autocreated column with UAs #1705
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
Comments
no,
I think we can: a) modify the |
@mvorisek An idea: If there are no columns to be rendered since code says parent:setModel($model, []], then Crud also should not add the UserAction buttons column. |
|
Would still see this as the most logical for a case when someone calls setModel with [] columns to customize crud: And code stays compact and clean. Right now you have a lot of coding if you want custom columns as you first pass all columns to setModel, and afterwards you have to decorate/customize each column again. Your take / community's take. I would vote for it. |
After having worked with it, that means first defining the array of displayed fields (in my case programmatically), then initializing Crud with that field list, and then using addDecorator is perfectly fine, even though seems more lines of code than before. Thus, I close this issue. |
I faced this issue as well, reopening, maybe we can find some way to fix it. |
slightly related #1934 (setup methods order should NOT matter) |
In previous versions, you could easily do for cruds:
This would render then properly having your custom-columns first, and then the Add/Edit user actions next to it.
In newest develop branch, this renders an error
Different model set
if you place setModel after addColum statements.So question:
$this->addDecorator($model->column1, [\Atk4\Ui\Table\Column\Link::class, ['test' => false, 'path' => 'interfaces/page'], ['_id' => 'id']]);
Option 2 is not very elegant for coding though...
The text was updated successfully, but these errors were encountered: