Add checkbox to order positions

Hi there,
I’m new to Shopware development and I need help. I have successfuly extended order positions list and added some new columns. One of them should have checkbox (checked or not, regarding flag in db).  I’ve tried with this code

var isOrdered = {
      xtype: 'booleancolumn',
      header: 'Is ordered',
      dataIndex: 'isOrdered',
      flex: 1,
      editor: {
           xtype: 'checkbox',
           inputValue: 1,
           uncheckedValue: 0
      }
};

but it renders only bool values (true/false). I’ve also tried to google and found this code 

xtype: 'checkcolumn',
header: 'Is ordered',
dataIndex: 'isOrdered',
width: 60,
editor: {
 xtype: 'checkbox',
 cls: 'x-grid-checkheader-editor'
}

but it’s not working at all. 
Can someone help me with this, what am I doing wrong?

Thanks in advance.

Hallo,

I have not enough experience in this field. but as I know you can use custom function to show the value you want and then assign this function to ‘render’ parameter

{
      xtype: 'booleancolumn',
      header: 'Is ordered',
      dataIndex: 'isOrdered',
      flex: 1,
      renderer: yourfunction,
      editor: {
           xtype: 'checkbox',
           inputValue: 1,
           uncheckedValue: 0
      }
}

//this is a example on your function you can find it in themes/Backend/ExtJs/backend/order/view/list/position.js

    totalColumn: function(value) {
        if ( value === Ext.undefined ) {
            return value;
        }
        return Ext.util.Format.currency(value);
    }

I hope this will help you

Regard’s,

Ahmad

I did it that way. Here is the code, maybe someone will find it useful one day :slight_smile:

{
    header: 'Is ordered',
    flex: 1,
    align: 'center',
    renderer: me.columnRenderer,
    sortable: false
}

columnRenderer: function(value, metaData, record) {
    var isOrdered = record.get('isOrdered');
    var articleId = record.get('articleId');
    if (isOrdered) {
        return '';
   }

   return '';
}