Results 1 to 7 of 7

Thread: (4.1 Beta) injectCheckbox:false prevents check rendering in data rows

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-5313 in a recent build.
  1. #1
    Sencha User
    Join Date
    Oct 2011
    Location
    Durham, NC
    Posts
    11

    Default (4.1 Beta) injectCheckbox:false prevents check rendering in data rows

    When using checkbox selection model for grid, setting injectCheckbox:false stops the column from being inserted. It should create a blank header but still render checkboxes in the rows, correct? (See 'Issue??' in code below extracted from Ext source).

    Code:
    /**     * Add the header checkbox to the header row     * @private     * @param {Boolean} initial True if we're binding for the first time.     */
    addCheckbox: function (initial) {
        var me = this,
            checkbox = me.injectCheckbox,
            view = me.views[0],
            headerCt = view.headerCt;
        if (checkbox !== false) {
            if (checkbox == 'first') {
                checkbox = 0;
            } else if (checkbox == 'last') {
                checkbox = headerCt.getColumnCount();
            }
            headerCt.add(checkbox, me.getHeaderConfig());
        }
        //**Issue?? - need 'else' here with alternate col config
        if (initial !== true) {
            view.refresh();
        }
    }
    Patrick Dillon
    integrify.com

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,450

    Default

    Using the grid-plugins.html example, the 2nd grid uses CheckboxModel and changed it to:

    Code:
        var sm = Ext.create('Ext.selection.CheckboxModel', {
            injectCheckbox : false
        });
    and the checkbox is still there. We will fix this.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Touch Premium Member
    Join Date
    Oct 2011
    Posts
    16

    Default ETA for fixing this?

    Is there an ETA for fixing this? For our particular application we are noticing that rendering a grid with 20 rows and 20 columns, a four-fold to five-fold performance increase by setting injectCheckbox to false.

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    So your problem is that using a CheckboxSelectionModel with injectCheckbox: false doesn't "work"?

    Why would you use a CheckboxSelectionModel if you don't want checkboxes? Why wouldn't you just use a SelectionModel?

  5. #5
    Sencha User
    Join Date
    Oct 2011
    Location
    Durham, NC
    Posts
    11

    Default

    'injectCheckbox=false' should disable rendering a checkbox in the header item. I want to retain checkboxes in the data items while disabling "check/uncheck all".
    Patrick Dillon
    integrify.com

  6. #6
    Sencha User
    Join Date
    Oct 2011
    Location
    Durham, NC
    Posts
    11

    Default

    Looking at it closer, the solution is to set the undocumented property

    showHeaderCheckbox : false

    instead of using injectCheckbox. Might make more sense to doc that prop and not have injectCheckbox:false be an option, since you may want render the checkboxes in another column index without the header checkbox. Call 'injectCheckbox' 'injectColIndex' instead?
    Patrick Dillon
    integrify.com

  7. #7
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    OK, it's a documentation issue.. I'll add docs for showHeaderCheckbox

    I agree about the badly named config. We can't really change it now because it's in use!

Posting Permissions

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