Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/382.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 带有超链接的ExtJs组合框显示字段_Javascript_Combobox_Extjs4 - Fatal编程技术网

Javascript 带有超链接的ExtJs组合框显示字段

Javascript 带有超链接的ExtJs组合框显示字段,javascript,combobox,extjs4,Javascript,Combobox,Extjs4,我想要带有超链接的组合框显示字段值。选定的组合框值应显示一个超链接,如果单击该选定的组合框值,它将在新选项卡中打开 var multiComboMap = Ext.create('Ext.form.field.ComboBox', { fieldLabel: 'Select multiple states', renderTo: 'combo-map', multiSelect: true, //disabled: true, displayField:'

我想要带有超链接的组合框显示字段值。选定的组合框值应显示一个超链接,如果单击该选定的组合框值,它将在新选项卡中打开

var multiComboMap = Ext.create('Ext.form.field.ComboBox', {
    fieldLabel: 'Select multiple states',
    renderTo: 'combo-map',
    multiSelect: true,
    //disabled: true,
    displayField:'locationMap',
    valueField:'locationId',
    id:'combo-map',
    width: 500,
    labelWidth: 130,
    emptyText: 'To view map select it',
    store: Ext.create('Ext.data.Store', //get data for the combobox
            {

        fields: [
            {

                name: 'locationId',
                type: 'int'
            },{
                name: 'locationName', 
                type: 'string'
            },{
                name: 'locationMap', 
                type: 'string'
            }
        ],

        proxy: {
            type: 'ajax',
            //url: '../data/users.asp',
            url: '/AOP_MEETING/venueMaster.json',
            reader: {
                type: 'json',
                root: 'venueMasterc'
            }
        },                            
        autoLoad: true
    }),
   triggerAction:'all',
   mode:'local',
   typeAhead: true,
   lastQuery:''
});

提前感谢。

您可以使用“Ext.XTemplate”向combobox displayfield添加超链接,但用户必须按住ctrl键并单击它,然后在新选项卡中打开它

var multiComboMap = Ext.create('Ext.form.field.ComboBox', {
    fieldLabel: 'Select multiple states',
    renderTo: 'combo-map',
    multiSelect: true,
    //disabled: true,
    displayField:'locationMap',
    valueField:'locationId',
    id:'combo-map',
    width: 500,
    labelWidth: 130,
    emptyText: 'To view map select it',
    store: Ext.create('Ext.data.Store', //get data for the combobox
            {

        fields: [
            {

                name: 'locationId',
                type: 'int'
            },{
                name: 'locationName', 
                type: 'string'
            },{
                name: 'locationMap', 
                type: 'string'
            }
        ],

        proxy: {
            type: 'ajax',
            //url: '../data/users.asp',
            url: '/AOP_MEETING/venueMaster.json',
            reader: {
                type: 'json',
                root: 'venueMasterc'
            }
        },                            
        autoLoad: true
    }),
   triggerAction:'all',
   mode:'local',
   typeAhead: true,
   lastQuery:''
});

此处示例:

我不知道您想在这里做什么,所谓“在新选项卡中打开”是指打开新的浏览器选项卡/窗口以显示链接?或者你想为打开一个新的?我想打开一个新的浏览器选项卡来显示链接。谢谢@newmount。但超链接仅在下拉列表中提交。选择显示字段后,超链接消失。我希望所选显示字段具有超链接。将target=“\u blank”添加到链接可解决ctrl+单击的问题problem@abhishek检查:谢谢@newmount。。我已经像listConfig一样解决了它:{//每个项的自定义呈现模板getInnerTpl:function(){return';}}}我添加了这个,现在它可以工作了