-
24 Jun 2012 10:57 PM #1
Answered: How to show checkbox and its label in one field in xtype:checkcolumn column type
Answered: How to show checkbox and its label in one field in xtype:checkcolumn column type
Hi,
One of my columns of type checkcolumn, i would like to show to the user in this column both, the checkbox and the label - text related to it.
thank you.
-
Best Answer Posted by Romick
I think you just need to ovveride checkcolumn renderer. Like here:
PHP Code:xtype: 'checkcolumn',
renderer: function (val, metadata, record, rowIndex, colIndex, eOpt, treeView){
var cssPrefix = Ext.baseCSSPrefix,
cls = [cssPrefix + 'grid-checkheader' + additionalCls];
if (val && val == 'true') {
cls.push(cssPrefix + 'grid-checkheader-checked' + additionalCls);
}
return '<div class="' + cls.join(' ') + '"> </div><div>Add your label here</div>';
}
-
25 Jun 2012 2:15 AM #2
I think you just need to ovveride checkcolumn renderer. Like here:
PHP Code:xtype: 'checkcolumn',
renderer: function (val, metadata, record, rowIndex, colIndex, eOpt, treeView){
var cssPrefix = Ext.baseCSSPrefix,
cls = [cssPrefix + 'grid-checkheader' + additionalCls];
if (val && val == 'true') {
cls.push(cssPrefix + 'grid-checkheader-checked' + additionalCls);
}
return '<div class="' + cls.join(' ') + '"> </div><div>Add your label here</div>';
}
-
25 Jun 2012 6:19 AM #3
It works really good, thanks alot.
It works really good, thanks alot.
It works really good, thanks alot, but i have additional qiestion (probably trivial) how i can show the text on the same row as checkbox and not under?
-
25 Jun 2012 6:54 AM #4
I found a solution, it works great, thanks.
I found a solution, it works great, thanks.
use this line:
return '<div class="' + cls.join(' ') + '">' + record.data["${valueHeader.key}"] + '</div>';


Reply With Quote