Results 1 to 8 of 8

Thread: Centralizing checkboxes for widgetcolumn

  1. #1
    Sencha Premium Member
    Join Date
    Jul 2015
    Posts
    22

    Question Centralizing checkboxes for widgetcolumn

    Hi!

    I have a Contact Book grid panel containing Name, Email and "Select" (widgetcolumn with checkbox) columns.

    I would like to have the checkboxes (without any box label) to be aligned in the center? just like the "Select" header.

    Please advise how can I align the checkboxes to the center of the "Select" column.

    Fiddle: https://fiddle.sencha.com/#fiddle/1bbe

  2. #2
    Sencha Premium Member yorl1n's Avatar
    Join Date
    Mar 2015
    Location
    Germany
    Posts
    294
    Answers
    30

    Default

    Hi, actually it is a bug https://www.sencha.com/forum/showthread.php?307438 but as I can see it was moved to as not reproducible. There is override provided to fix this behavior.

  3. #3
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    That bug (EXTJS-20017) was marked as Won't Fix. As I understand the explanation, the 'align' option is for aligning the text in the column. Because the widget is always sized to the full width of the cell, the 'align' option is not relevant here.

  4. #4
    Sencha Premium Member
    Join Date
    Jul 2015
    Posts
    22

    Default

    Quote Originally Posted by yorl1n View Post
    Hi, actually it is a bug https://www.sencha.com/forum/showthread.php?307438 but as I can see it was moved to as not reproducible. There is override provided to fix this behavior.
    Hi, thanks for posting! This fix works for Chrome but not Internet Explorer. Do you have a fix for Internet Explorer?

  5. #5
    Sencha Premium Member yorl1n's Avatar
    Join Date
    Mar 2015
    Location
    Germany
    Posts
    294
    Answers
    30

    Default

    Hi, unfortunately I have no solution at the moment. I will try to find some solution.

  6. #6
    Sencha Premium Member
    Join Date
    Jul 2014
    Posts
    9

    Default

    A possible visual solution to what 0zz asked for is using a font icon as a column header and shrinking the column width, i.e.

    Code:
    text: '<i style="font-size:1.2em;" class="fa fa-check-square-o" aria-hidden="true"></i>',
    width : 35,
    https://fiddle.sencha.com/#fiddle/1blt

  7. #7
    Sencha Premium Member yorl1n's Avatar
    Join Date
    Mar 2015
    Location
    Germany
    Posts
    294
    Answers
    30

    Default

    Quote Originally Posted by artray View Post
    A possible visual solution to what 0zz asked for is using a font icon as a column header and shrinking the column width, i.e.

    Code:
    text: '<i style="font-size:1.2em;" class="fa fa-check-square-o" aria-hidden="true"></i>',
    width : 35,
    https://fiddle.sencha.com/#fiddle/1blt
    In this case the html-native checkbox can be used:

    Code:
    {
                    xtype: 'widgetcolumn',
                    width: 200,
                    align: 'center',
                    widget: {
                        xtype: 'component',
                        html: '<input type="checkbox">'
                    }
                }
    The label and the html input are placed correctly, according specification. The only component which is not aligned is span component with custom checkbox image - and it is definitely a bug, but extjs team says it is correct. So actually it is not a problem of widget column it is a problem of text-align css property in conjunction with extjs'es checkbox - it will be newer properly aligned with text-align property.

  8. #8
    Sencha Premium User
    Join Date
    Feb 2017
    Posts
    9

    Default

    I'm aware that this is an old thread. But since I came across it and have a different solution, I figured I'd share it.

    Code:
                {
                    xtype: 'widgetcolumn',
                    width: 200,
                    widget: {
                        xtype: 'container',
                        layout: {            
                            type: 'vbox',
                            align: 'center',
                        },
                        items: [{
                            xtype: 'checkbox'
                        }]
                    }
                }

Similar Threads

  1. [OPEN] TreePanel and widgetcolumn
    By ray_qwer in forum Ext 5: Bugs
    Replies: 14
    Last Post: 12 Jul 2017, 4:33 AM
  2. Widgetcolumn
    By dolev in forum Ext JS 6.x Q&A
    Replies: 2
    Last Post: 12 Aug 2015, 6:43 AM
  3. Replies: 2
    Last Post: 13 Jan 2015, 11:01 PM
  4. Centralizing ST2 SDK installations in OS X
    By CarlosMS in forum Sencha Touch 2.x: Examples and Showcases
    Replies: 2
    Last Post: 18 Jun 2012, 2:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •