I write code using the grid.panel + combobox multiSelect:true.


Example does not work,
1 values when choosing not save.
2 combobox does not set the value.


I suspect that the renderer written correctly, how to write code?


https://fiddle.sencha.com/#view/editor&fiddle/1r0v


Code:
    var store_user = Ext.create('Ext.data.Store', {
        fields: ['id', 'city'],
        data: [{
            "id": "1",
            "city": "1"
        }, {
            "id": "2",
            "city": "1,2"
        }, {
            "id": "3",
            "city": "3,1"
        }, {
            "id": "4",
            "city": "4,1,2"
        }]
    });


    var store_citys = Ext.create('Ext.data.Store', {
        fields: ['id', 'name'],
        data: [{
            "id": "1",
            "name": "USA"
        }, {
            "id": "2",
            "name": "FRANCE"
        }, {
            "id": "3",
            "name": "RUSSIA"
        }, {
            "id": "4",
            "name": "ISLAND"
        }]
    });


    Ext.application({
        name: 'Fiddle',


        launch: function () {


            Ext.create('Ext.grid.Panel', {
                renderTo: Ext.getBody(),
                store: store_user,
                width: 600,
                height: 400,
                title: 'Grid users',
                plugins: {
                    ptype: 'cellediting',
                    clicksToEdit: 1
                },


                columns: [{
                    text: 'id',
                    dataIndex: 'id',
                    width: 40
                }, {
                    flex: 1,
                    header: 'City',
                    dataIndex: 'city',
                    renderer: function (value) {
                        ret = '';
                        replacer = "";
                        if (typeof value === "object") {
                            value=value[0];
                        }


                        if (typeof value === "string") {
                            if (value === "") {
                                return ret;
                            }
                            var n = value.search(",");
                            if (n == -1) {
                                ret = store_citys.findRecord('id', value).get('name');
                                return ret;
                            }
                            var citys = value.split(",");
                            for (var a in citys) {
                                namecity = store_citys.findRecord('id', citys[a]).get('name');
                                ret = ret + replacer + namecity;
                                replacer = ",";
                            }
                            return ret;
                        }
                        return ret;
                    },


                    editor: new Ext.form.field.ComboBox({
                        multiSelect: true,
                        displayField: 'name',
                        valueField: 'id',
                        store: store_citys,
                        delimiter: ','
                    })


                }]
            });


        }


    });
Ext JS 5.1.1.451