1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    13
    Vote Rating
    0
    Answers
    1
    ilawai is on a distinguished road

      0  

    Default 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.

  2. I think you just need to ovveride checkcolumn renderer. Like here:
    PHP Code:
    xtype'checkcolumn',
    renderer: function (valmetadatarecordrowIndexcolIndexeOpttreeView){
      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>';


  3. #2
    Sencha User
    Join Date
    Oct 2011
    Location
    Ukraine
    Posts
    154
    Vote Rating
    6
    Answers
    11
    Romick is on a distinguished road

      0  

    Default


    I think you just need to ovveride checkcolumn renderer. Like here:
    PHP Code:
    xtype'checkcolumn',
    renderer: function (valmetadatarecordrowIndexcolIndexeOpttreeView){
      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>';


  4. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    13
    Vote Rating
    0
    Answers
    1
    ilawai is on a distinguished road

      0  

    Default 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?

  5. #4
    Sencha User
    Join Date
    Oct 2011
    Posts
    13
    Vote Rating
    0
    Answers
    1
    ilawai is on a distinguished road

      0  

    Default 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>';

Thread Participants: 1

Tags for this Thread