0

我有一个 EditorGridPanel,其中包含一些列,但我想根据某些值将其中一个类型更改为编辑器。

我的专栏如下:

header: dil('Fiyat'),
width: 30,
sortable: true,
renderer: Ext.util.Format.numberRenderer('$0.000,00/i'),
dataIndex: 'fiyat'

但更改后,我想像这样工作:

header: dil('Fiyat'),
width: 30,
sortable: true,
renderer: Ext.util.Format.numberRenderer('$0.000,00/i'),
dataIndex: 'fiyat'
editor: new Ext.form.NumberField({
    enableKeyEvents : true,
    allowBlank: false,
    allowNegative: false,
    style: 'text-align:left'
})

我的整个代码:

var po_combolu_toolbar2 = new Ext.Toolbar({
    items: [
    new Ext.form.ComboBox({
        id: 'po_combo_id',
        hiddenName: 'po_combo_hid',
        name: 'po_combo_name',
        store: PoTipStore,
        valueField: 'id',
        displayField: 'isim',
        typeAhead: true,
        triggerAction: 'all',
        emptyText: dil('Tip Seçiniz'),
        selectOnFocus: true,
        anchor: '100%',
        listeners: {
            select: {
                fn: function (combo, value) {
                    var modelCmp = Ext.getCmp('po_combo_id').getValue();
                    po_siparis_grid.store.setBaseParam("secim", modelCmp);

                    if (Ext.getCmp('po_combo_id').getValue() == 5) {

                    } else {

                    }
                    po_siparis_grid.store.load(); 
                }
            }
        },
        allowBlank: true
    })]
});

var po_siparis_grid = new xg.EditorGridPanel({
    sm: new Ext.grid.RowSelectionModel({
        singleSelect: true
    }),
    ds: new Ext.data.GroupingStore({
        reader: po_siparis_reader,
        writer: po_siparis_writer,
        autoSave: false,
        baseParams: {
            type: 'POSiparis'
        },
        proxy: new Ext.data.HttpProxy({
            api: {
                read: {
                    url: 'phps/POSiparisGetir.php?lang=dil(lang)',
                    method: 'POST'
                },
                create: 'app.php/users/create',
                update: 'phps/POKayit.php?lang=dil(lang)',
                destroy: {
                    url: 'app.php/users/destroy',
                    method: "DELETE"
                }
            }    
        }),

        sortInfo: {
            field: 'id',
            direction: 'ASC'
        },
        listeners: {
            save: function (store, batch, data) {
                Ext.Msg.alert(dil('Mesaj'), dil('Kayıt Yapıldı.Teşekkürler.'));

                window.bolgesel.siparisler.genel.mnt.dataStoreUpdate = 0;
            },
            update: function () {
                window.bolgesel.siparisler.genel.mnt.dataStoreUpdate = 1;
            }
        },
        groupField: 'grup'
    }),
    columns: [{
        header: dil('Grup '),
        width: 20,
        sortable: true,
        dataIndex: 'grup'
    }, {
        header: dil('Item No'),
        width: 20,
        sortable: true,
        dataIndex: 'item_no'
    }, {
        header: dil('Kod'),
        width: 40,
        sortable: true,
        dataIndex: 'code'
    }, {
        header: dil('Açıklama'),
        sortable: true,
        dataIndex: 'aciklama'
    }, {
        header: dil('Fiyat'),
        id: "fiyat_column",
        width: 30,
        sortable: true,
        renderer: Ext.util.Format.numberRenderer('$0.000,00/i'),
        dataIndex: 'fiyat'    
    }, {
        id: "tipikeadet",
        header: dil('Adet'),
        width: 30,
        sortable: true,
        dataIndex: 'adet',
        editor: new Ext.form.NumberField({
            enableKeyEvents: true,
            allowBlank: false,
            allowNegative: false,
            style: 'text-align:left'
        })
    }, {
        header: dil('Toplam'),
        width: 30,
        sortable: true,
        renderer: function (v, params, record) {

            return Ext.util.Format.number(record.data.fiyat * record.data.adet, '$0.000,00/i');
        },

        dataIndex: 'toplam',
        summaryType: 'totalCost',
        summaryRenderer: Ext.util.Format.numberRenderer('$0.000,00/i')

    }],

    view: new Ext.grid.GroupingView({
        forceFit: true,
        showGroupName: false,
        enableNoGroups: false,
        enableGroupingMenu: false,
        hideGroupedColumn: true,
        startCollapsed: true
    }),

    plugins: summary,
    frame: true,
    width: 800,
    height: 250,
    clicksToEdit: 1,
    collapsible: false,
    animCollapse: false,
    trackMouseOver: false,
    enableColumnMove: false,
    iconCls: 'siparis'
});

我想更改 po_combolu_toolbar2 选择函数中的 fiyat 列指定。

4

0 回答 0