Page 1 of 4 123 ... LastLast
Results 1 to 10 of 38

Thread: [2.0b1] Ext.ux.grid.plugins.GroupCheckboxSelection

  1. #1

    Default [2.0b1] Ext.ux.grid.plugins.GroupCheckboxSelection

    Hi,
    This plugin allows you to select all items of a group using a checkbox in the group header.

    The grid must use a GroupingView and a selection model with singleSelect=false. Usage in combination with CheckboxSelectionModel is optional.

    To try it, just extract the attached files to Ext "examples/grid" directory and open group-checkbox.html (this example is derived from the built-in "grouping" example).
    Attached Files Attached Files
    Last edited by rstuven; 5 Nov 2007 at 11:12 AM. Reason: Example fixed

  2. #2
    Sencha Premium Member
    Join Date
    May 2007
    Posts
    57

    Default

    Great plug-in. Few points: after regrouping by any other column, the selections need to be reset or if you would like to keep the selection rows, you need to apply "checked" status to all new group checkboxes.

    Thank you
    Nik

  3. #3
    Ext User Grimsk's Avatar
    Join Date
    Jul 2007
    Location
    Saint-Georges, Canada
    Posts
    101

    Default

    good job needed it

  4. #4
    Sencha Premium Member andrei.neculau's Avatar
    Join Date
    Jul 2007
    Location
    Sweden
    Posts
    197

    Default

    First of all - your plugin doesn't work. I tried your testcase, and when ticking the group checkbox, only the last item in the group gets ticked.

    Second of all - a live demo is a must for all extensions and plugins, as a form of respect to developers' time!

  5. #5

    Default

    Quote Originally Posted by andrei.neculau View Post
    First of all - your plugin doesn't work. I tried your testcase, and when ticking the group checkbox, only the last item in the group gets ticked.
    The plugin works (though it's not the panacea, I welcome every constructive suggestion)... but the example didn't. As myself remarked above, singleSelect option must be false, but I uploaded a wrong test example with singleSelect:true... I'm sorry. Thanks for pointing my mistake. It's already fixed in the attachment.

    Quote Originally Posted by andrei.neculau View Post
    Second of all - a live demo is a must for all extensions and plugins, as a form of respect to developers' time!
    You must be kidding... I do respect the community contributing back at least a little part of all I have received. Each of us has its own resources and constraints, so please you respect that. I prefer to share something than to share anything. Besides, it seems the other commenters did save time

  6. #6
    Sencha User
    Join Date
    Nov 2007
    Posts
    13

    Default It _is_ really great, but here's a needed patch

    As heidtmare pointed out here:
    http://extjs.com/forum/showthread.php?t=16346&page=2
    the groupTextTpl sadly pulls its text from the rendered field, not from the core data...

    So your great plugin (*and it is indeed very cool - and I really needed it, so thanks.) breaks down when grouping by a rendered field.

    Until they fix this issue, here's an ugly patch I used to make your plugin work:

    1. In the field renderer function I wrapped the data value with a special delimiters, e.g.
    Code:
    return '<span style=\'font-weight:bold;color:green;\'><XXX>' + val + '</XXX></span>';
    2. Inside GroupCheckboxSelection.js, right after the line
    Code:
    var value = parts[1].trim();
    I've put this unobtrusive patch:
    Code:
    				//////PATCH: the renderer used for the grouped field injects all its rendered HTML to the value... so try to extract a <XXX>val</XXX> value
    				try{
    					var tmp1 = (text.split("<XXX>"))[1];
    					var tmp2 = (tmp1.split("</XXX>"))[0];
    					value = tmp2;
    				}
    				catch(e){}
    This of course doesn't yet help with the fact that the group text shows the rendered HTML, but at least your plugin still works...
    Anyway, thanks!
    --
    No'am Peled
    http://www.NoamPeled.com/

  7. #7
    Sencha User
    Join Date
    Mar 2007
    Posts
    464

    Default

    andrei.neculau don't start about the respect blabla. You should respect the people who share their efforts.

    Rstuven I didn't try your extension yet, but I like the idea, so thnx. (and a live demo would be nice)

  8. #8

    Exclamation

    It is very useful function.

    I see one issue:

    Whenever I click on any other place in the grid other then the check box, the entire previous selections are unchecked. I have to recheck again, this will be frustration expereience for the end user.

    Do you have any suggestions, on how to fix?

    Thanks

    Aarif

  9. #9
    Ext User
    Join Date
    Sep 2008
    Location
    Bangalore, India
    Posts
    17

    Question Checkbox before group collapse/expand image

    Please help me out in placing the checkbox before the group collapse/expand image. Currently, it is being displayed between that image and the header text. Find the attached thumbnail.



    Thanks,
    Innovator2
    Attached Images Attached Images

  10. #10
    Sencha Premium Member
    Join Date
    Jun 2008
    Posts
    9

    Default Use of Ext checkbox

    Awesome plugin rstuven! I saw that you were using a normal input checkbox element to control the selecting/deselecting of all rows, so I thought I'd spruce it up and use the Ext checkboxes instead. Here's what I did:

    Near the top, change the grid.view.groupTextTpl setter to the following (had to use dl/dd elements instead of div's because the grouping css overrides all divs ):

    Code:
        grid.view.groupTextTpl = 
            ['<dl class="x-grid3-td-checker" style="height:18px; border:0px !important">',
            '<dd class="x-grid3-row-checker" style="width:18px; float:left;" x-grid-group-hd-text="{text}">&nbsp;</dd>',
            '<dd style="float:left; padding:3px 0px 0px 3px;">',
            grid.view.groupTextTpl,
            '</dd>',
            '</dl>'
            ].join('');
    Next, change the behaviors to check the ".x-grid3-row-checker" instead of the ".x-grid-group-checkbox" class (do this for the mousedown event too):

    From:
    Code:
    behaviors[id + ' .x-grid-group-hd [email protected]']
    To:
    Code:
    behaviors[id + ' .x-grid-group-hd [email protected]']
    Finally, add the following lines right above the loop that checks/unchecks all rows:

    Code:
        var hd = Ext.fly(target.parentNode)
        target.checked = !hd.hasClass('x-grid3-row-selected');
        if (target.checked) 
            hd.addClass('x-grid3-row-selected');
        else 
            hd.removeClass('x-grid3-row-selected');
    That should do it. I've tested in FF3 and IE7.

Page 1 of 4 123 ... LastLast

Posting Permissions

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