# Add checkbox to order positions

**URL:** <https://forum.shopware.com/t/add-checkbox-to-order-positions/40707>\
**Category:** Programmierung\
**Created:** [21. Oktober 2016 um 08:49 UTC](https://forum.shopware.com/t/add-checkbox-to-order-positions/40707 "2016-10-21T08:49:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cera1991](https://avatars.discourse-cdn.com/v4/letter/c/9d8465/32.png) [@cera1991](https://forum.shopware.com/u/cera1991)\
**Post date:** [21. Oktober 2016 um 08:49 UTC](https://forum.shopware.com/t/add-checkbox-to-order-positions/40707/1 "2016-10-21T08:49:15Z")

</div>

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). &nbsp;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&nbsp;

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

```

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

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![ahmadsaad](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@ahmadsaad](https://forum.shopware.com/u/ahmadsaad)\
**Post date:** [28. Oktober 2016 um 14:27 UTC](https://forum.shopware.com/t/add-checkbox-to-order-positions/40707/2 "2016-10-28T14:27:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cera1991](https://avatars.discourse-cdn.com/v4/letter/c/9d8465/32.png) [@cera1991](https://forum.shopware.com/u/cera1991)\
**Post date:** [2. November 2016 um 13:13 UTC](https://forum.shopware.com/t/add-checkbox-to-order-positions/40707/3 "2016-11-02T13:13:00Z")

</div>

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

```
{
    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 '';
}

```

&nbsp;
