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

Checkbox for checkbox field in table view? #61

Closed
wiretail opened this issue Jul 14, 2016 · 4 comments
Closed

Checkbox for checkbox field in table view? #61

wiretail opened this issue Jul 14, 2016 · 4 comments
Milestone

Comments

@wiretail
Copy link
Contributor

wiretail commented Jul 14, 2016

What would you think about showing a checkbox field in the list table view, as a checkbox vs 1/0? (Not sure the direction you might be going on these, so didn't want to just create a pull request.)

I'm using this, around line 90 in list.blade.php, myself:

@elseif (isset($column['type']) && $column['type']=='checkbox')   
    {{-- checkbox with loose false/null/0 checking --}}
    <td><input type="checkbox"
        @unless(strip_tags($entry->{$column['name']}) == false)
            checked = "checked"
        @endunless
    ></td>

PS. Started using backpack pretty heavily on a new project -- thanks so much for creating this, and making it so flexible!

@tabacitu
Copy link
Member

Hmm... I think it's a great idea and I'd be happy to merge it, but perhaps the font-awesome checkbox icons would be more appropriate? Checkboxes are actionable, people expect them to do something, while icons are just informative, so I think icons would be a better match here.

Great to hear that you're enjoying it. I'm pretty busy right now, but as soon as I find some time, I'll be working on the next major version, which comes with:

  • extending columns just like fields
  • extending buttons
  • more flexible form view
    You're gonna love it :-)

@wiretail
Copy link
Contributor Author

Awesome!

If you want to close this, I can create a pull once I get the final icon version done. Although might make more sense to wait for the next version with custom fields so it works more like the other form template snippets, that are easy to override.

Also have done some other things like user login-as/impersonation and filtered/sublist reordering (with foreign key labels, as I'm actually reordeing a pivot in one case) ...but those rely on hacked-in new buttons and such, so probably best to send your way, into the next version you mentioned.

I'm also still transitioning from an overdue and long time use of CodeIgniter to Laravel this year, so sometimes still learning the best ways to do things. :) That'll give me some time to refine the code too...

Thanks again!

@tabacitu
Copy link
Member

That. Sounds. AWESOME :-) Always happy to see what you've done with it and see new solutions.

It's ok either way - you can submit the pull request now and I'll port it to v3 OR you can submit a pull request then. Let's leave the issue open until we do it, so we don't forget.

Cheers!

@tabacitu
Copy link
Member

I beat you to it! :-) I've done it for 2.1, where extending columns is just like extending fields (just another blade file). 2.1 is on the dev branch righ now - will release after more testing and documentation.

I say it looks pretty good, right?
screen shot 2016-07-22 at 15 12 10

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