View Full Version : How to enable/disable checkbox in a grid using renderer

14 Oct 2014, 1:13 PM
I need to load a grid based on the query results I get. I am not having any issues with loading the text fields in the grid but there is one particular column which is a check box type. I am using the xtype: 'checkcolumn' for this purpose. The object that returns the query results returns a "Y" or "N" for this particluar column. If it is "Y", I need to enable the checkbox and if it is "N", the checkbox should be disabled. I am using the following code for defining my checkbox field.
xtype: 'checkcolumn',
header: "Old User",
disabled: true,
width: 170,
dataIndex: 'oldUser',
itemId: 'oldUser',
renderer: this.checkOldUser

checkOldUser: function (oldUser) {
if(oldUser== 'Y') {
This renderer function is not working for me. How should the renderer look like?. Can you please let me know how to resolve this issue?. Thanks....

14 Oct 2014, 8:29 PM
Check the code in this SO post: (code in answered post)