Checkbox select column works not properly

72 views
Skip to first unread message

BMIJ

unread,
Sep 23, 2013, 3:17:29 PM9/23/13
to yui-s...@googlegroups.com

The example on
http://yuilibrary.com/yui/docs/datatable/datatable-chkboxselect.html
has some problems if you select the header checkbox.

If you check and then uncheck the header checkbox the checkboxes in the rows are check. But if you click "Process Selection" no output appears in the "processed" frame.

The next problem:
If you uncheck a row checkbox an then click once again the checkbox:
the checkboxes appears unchecked but if you click "Process Selection" this row will print out.
And the you have to click again on the checkbox to set the marker.

That's very confusing.

Is there an attempt to resolve the bug?

Samy

unread,
Sep 24, 2013, 8:19:54 AM9/24/13
to yui-s...@googlegroups.com
The example code works up to version 3.8.1.
In 3.9.0 it doesn't work anymore.

Changing the formatter for the checkbox column to a function makes it work again:

{   key:        'select',
                        allowHTML
:  true, // to avoid HTML escaping
                        label
:      '<input type="checkbox" class="protocol-select-all" title="Toggle ALL records"/>',
                        formatter
:      
                           
function(o){
                           
if (o.data.select){
                               
return '<input type="checkbox" checked />';
                           
}
                           
else{
                               
return '<input type="checkbox"  />';
                           
}
                       
}
                       
,
                        emptyCellValue
: '<input type="checkbox"/>'
                   
}

But maybe there is a more simple solution.
Reply all
Reply to author
Forward
0 new messages