We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47635
    • 33 Posts
    Hello.
    1) How do I dynamically fill a textfield with AJAX?
    2) How to convert it in textfield?

    Shop.combo.Price = function(config) {
        config = config || {};
        Ext.applyIf(config,{
            allowBlank: true,
            anchor: '100%',
            baseParams: {
                action: 'mgr/products/getprice',
                resource: MODx.request['id']
            },
            description: 'Price',
            displayField: 'pagetitle',
            editable: false,
            enableKeyEvents: true,
            fieldLabel: 'Price',
            hiddenName: 'price',
            id: 'qsproduct-price',
            maxLength: 255,
            name: 'price',
            url: Shop.config.connector_url,
            value: 0,
            valueField: 'id',
            width: '100%'
        });
        Shop.combo.Price.superclass.constructor.call(this,config);
    };
    Ext.extend(Shop.combo.Price, MODx.combo.ComboBox,{
        _onblur: function(t,e) {
            var v = this.getRawValue();
            this.setRawValue(v);
            this.setValue(v,true);
        }
    });
    Ext.reg('Shop-combo-price', Shop.combo.Price);