1

inputbox1 が空の場合、リスナーで null 値を取得しています。null 値の代わりに空の文字列 "" を取得するにはどうすればよいですか?

ありがとう。以下は私が持っているコードです。関数を使用して変換できると思いますが、その関数をextjsコードのどこに置くべきかわかりません。

ありがとう

var form = new Ext.FormPanel({
renderTo: 'SimpleForm',
title:'testing',
items:  [{
xtype:'fieldcontainer',
layout:'hbox',
combineErrors: true,
msgTarget: 'side',
defalts:{
        hideLabel:false,
        labelAligh: 'right'},
items:[{
    itemId: 'testing1',
    fieldLabel: 'Test1',
    name: 'test1',
    value:'',
    displayField:'name',
    xtype:'combo',
    valueField: 'name',
    store: 'input1store',
        listeners:{
            'change':{
                fn:function(combo,value){
                    Ext.getCmp('combo-testing2').clearValue();
                    input2store.setProxy({
                        type:'ajax',
                        url:'www.requesturl.com?format=json&source2'+combo.getValue(),
                        reader:{
                            type:'json',
                            root:'xml.result'
                        }
                    });
                    input2store.load();
                    }
                }
            }
        },{
            itemId: 'testing2',
            value:'',
            fieldLabel:'testing2',
            displayField: 'name',
            xtype:'combo',
            name:'testing2',
            valueField:'name',
            id:'combo-testing2',
            listeners:{
                onclick :{
                            single:true,
                            fn:function(){
                                input2store.load();
                            }
                }
            }
        }]
        }]

}))

4

1 に答える 1

1

値をその場で変換してみませんか?

valueFromたとえば、次のように使用します。

    url: 'www.requesturl.com?format=json&source2' + Ext.valueFrom(combo.getValue(), ''),
于 2013-06-03T14:32:02.013 に答える