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

view table #4

Closed
tstapleton opened this issue Sep 25, 2012 · 3 comments
Closed

view table #4

tstapleton opened this issue Sep 25, 2012 · 3 comments

Comments

@tstapleton
Copy link

i'd like another option for a table. it should not use the action icons to the right, and the only action that can be performed on a row is clicking to go to some defined page for that row.

the table should be striped and have a hover style when the cursor is over the row.

i'm not sure how to give this to you, but this is what i imagined - https://github.com/tstapleton/YiiBooster/commit/e6a7409192f2dcf213e21011612209b400b8739d

@tonydspaniard
Copy link
Contributor

The display of the edition buttons are easily configurable, we can display the three, two, one, custom buttons or none...

Then the mouseover is done via CSS and then click on row to direct to a different page is programmatically available too. So the components are ready for that scenario.

@tstapleton
Copy link
Author

yes, configurable, but i'd venture to say that those buttons should not be the default.

CSS is fine, that can be set globally.

clicking on the row is programmatically available, yes, but is it as easy as something like -

$this->widget('bootstrap.widgets.TbGridView', array(
  'type'=>'view',
  'dataProvider'=>$gridDataProvider,
  'template'=>"{items}",
  'filter'=>$person->search(),
  'columns'=>$gridColumns,
));

if the developer has to write some code to make it happen for each table, it could be forgotten on some tables, there could be mistakes.

thinking about it more broadly, i was suggesting to make the default better.

@tonydspaniard
Copy link
Contributor

The way CGridView is by configuring your columns... if you do not wish to display buttons at all you do:

'columns'=>array(
            array('name'=>'id', 'header'=>'#', 'htmlOptions'=>array('style'=>'width: 60px')),
            array('name'=>'firstName', 'header'=>'First name'),
            array('name'=>'lastName', 'header'=>'Last name'),
            array('name'=>'language', 'header'=>'Language'),
            array('name'=>'hours', 'header'=>'Hours worked'),
        )

And then no buttons are displayed. In fact, the Grid should support all types of rendering... if you wish to make your grid behave without buttons by default, the best way is to extend your grid and force no buttonColumns to be displayed on project-wise scope... but, developers should follow developers guide lines at all times.

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

No branches or pull requests

2 participants