Skip to content
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

added visible option for CButtonColumn #1346

Merged
merged 5 commits into from
Sep 8, 2012
Merged

added visible option for CButtonColumn #1346

merged 5 commits into from
Sep 8, 2012

Conversation

gregmolnar
Copy link
Contributor

pull request for issue #1345

@cebe
Copy link
Member

cebe commented Sep 6, 2012

Where is the code to hide buttons that have visible=false?

also your code has to be tab indented, by not spaces.

@gregmolnar
Copy link
Contributor Author

I fixed the intendation. My editor was playing with me.
That part already exists: https://github.com/yiisoft/yii/blob/master/framework/zii/widgets/grid/CButtonColumn.php#L311-312

@ghost ghost assigned cebe Sep 7, 2012
@@ -18,6 +18,7 @@ Version 1.1.13 work in progress
- Enh: Fixed the check for ajaxUpdate false value in jquery.yiilistview.js as that never happens (mdomba)
- Enh: Requirements checker: added check for Oracle database (pdo_oci extension) and MSSQL (pdo_dblib, pdo_sqlsrv and pdo_mssql extensions) (resurtm)
- Enh: Added CChainedLogFilter class to allow adding multiple filters to a logroute (cebe)
- Enh: #1345 CButtonColumn's default buttons(view, update, delete) has visible option now (gregmolnar)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enh #1345 + it should be ordered properly.

@samdark
Copy link
Member

samdark commented Sep 7, 2012

Aside from the changelog line everything looks fine.

@gregmolnar
Copy link
Contributor Author

I fixed it.

@@ -15,6 +15,7 @@ Version 1.1.13 work in progress
- Enh #486: CHttpSession::$gCProbability and CDbHttpSession::$gCProbability are floats now. Minimal possible $gCProbability value has been changed to the ≈0.00000005% (1/2147483647), was integer 1% before, default value left unchanged (1%) (resurtm)
- Enh #556: CDbColumnSchema::$comment property has been added. It stores comment for the table column, comment retrieving is working for MySQL, PgSQL and Oracle (resurtm)
- Enh #1289: Added support for column comments for MSSQL (CDbColumnSchema::$comment property) (resurtm)
- Enh #1345 CButtonColumn's default buttons(view, update, delete) has visible option now (gregmolnar)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing : ;)

@@ -15,6 +15,7 @@ Version 1.1.13 work in progress
- Enh #486: CHttpSession::$gCProbability and CDbHttpSession::$gCProbability are floats now. Minimal possible $gCProbability value has been changed to the ≈0.00000005% (1/2147483647), was integer 1% before, default value left unchanged (1%) (resurtm)
- Enh #556: CDbColumnSchema::$comment property has been added. It stores comment for the table column, comment retrieving is working for MySQL, PgSQL and Oracle (resurtm)
- Enh #1289: Added support for column comments for MSSQL (CDbColumnSchema::$comment property) (resurtm)
- Enh #1345: CButtonColumn's default buttons(view, update, delete) has visible option now (gregmolnar)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

has → have

@samdark
Copy link
Member

samdark commented Sep 7, 2012

The rest is OK. Ready to merge after spelling error corrected.

samdark added a commit that referenced this pull request Sep 8, 2012
@samdark samdark merged commit adebfbb into yiisoft:master Sep 8, 2012
@samdark
Copy link
Member

samdark commented Sep 8, 2012

Thank you for working on this one.

@gregmolnar
Copy link
Contributor Author

No worries. Thanks for merging.

@samdark
Copy link
Member

samdark commented Sep 9, 2012

@mdomba I'm aware that one can use buttons. This PR is adding a bit more consistency with other existing properties configuring default buttons.

@mdomba
Copy link
Member

mdomba commented Sep 9, 2012

But at the same time it's adding 3 new options that are just "shortcuts", and this way adding a bit of complexity...

the other "existing" options cannot be done by the developer with "buttons" as they are setting the functionality of the default buttons.

@creocoder
Copy link
Contributor

the other "existing" options cannot be done by the developer with "buttons" as they are setting the functionality of the default buttons.

@mdomba Easy can be done. Fresh project code for example:

            'buttons'=>array(
                'update'=>array(
                    'imageUrl'=>Yii::app()->assetUrl.'/admin/img/icons/pencil.png',
                ),
                'delete'=>array(
                    'imageUrl'=>Yii::app()->assetUrl.'/admin/img/icons/cross.png',
                ),
            ),

@mdomba
Copy link
Member

mdomba commented Sep 10, 2012

you did not understand my point. in your example you are setting a custom icon... but if you dont CButtonColumn has to set a default one for you... and thats why there is a separate property so that it can be more easily overwritten... but visible does not have an default values so I dont see the point in having 3 more properties for that.

@gregmolnar
Copy link
Contributor Author

@mdomba you are right. I haven't tried to set the visible like that. Would it be possible to document that feature somehow? Also I guess this PR can be reverted.

samdark added a commit that referenced this pull request Sep 10, 2012
@samdark
Copy link
Member

samdark commented Sep 10, 2012

Reverted.

@gregmolnar
Copy link
Contributor Author

Any thoughts on adding this to the docs?

@samdark
Copy link
Member

samdark commented Sep 10, 2012

@gregmolnar
Copy link
Contributor Author

the configuration for additional buttons.

Since it states additional buttons I wouldn't think I can use these options for the update, view, delete buttons.

@mdomba
Copy link
Member

mdomba commented Sep 10, 2012

We could add a new paragraph to that section after the last sentence "Note that in order..."

Something like:

Note that if the buttonID is 'view', 'update' or 'delete' the options will be applied to the default buttons.

@gregmolnar
Copy link
Contributor Author

@mdomba sounds good to me.

@ghost ghost assigned samdark Sep 10, 2012
@rawtaz
Copy link
Contributor

rawtaz commented Sep 10, 2012

I agree with @gregmolnar that the "additional" is better left out. It doesn't make sense to first say that this option is for additional buttons, and then further down say "oh, but it's also for the default buttons". Better to just say that it is for "the buttons", cuz that's what it is. It's for all buttons, both default and additional ones. It's not weirder than that.

@samdark
Copy link
Member

samdark commented Sep 12, 2012

Fixed 73a4003

@mdomba
Copy link
Member

mdomba commented Sep 12, 2012

@samdark should we mention the above line ?
if the buttonID is 'view', 'update' or 'delete' the options will be applied to the default buttons.

Some users on the forum wanted to create a custom button and tried to use "view" or "update" and then was wondering why it does not work as a custom button...

@samdark
Copy link
Member

samdark commented Sep 12, 2012

No. I've removed mentioning of "additional" so now it applies to all buttons.

@mdomba
Copy link
Member

mdomba commented Sep 12, 2012

yes for that part...

but is it clear enough that the buttonID's 'view', 'update' and 'delete' refers to the corresponding default buttons?

@gregmolnar
Copy link
Contributor Author

@mdomba
I think it is not clear enough yet.

On 12 September 2012 12:27, Maurizio Domba notifications@github.com wrote:

yes for that part... but is it clear enough that the buttonID's 'view',
'update' and 'delete' refers to the corresponding default buttons?


Reply to this email directly or view it on GitHubhttps://github.com//pull/1346#issuecomment-8488367.

samdark added a commit that referenced this pull request Sep 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants