如何从一个js文件中检索值到extjs5中的另一个js文件 [英] How to retrieve a value from one js file to another js file in extjs5

查看:66
本文介绍了如何从一个js文件中检索值到extjs5中的另一个js文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

这里我使用extjs 5创建了组合,这里我的问题是当用户从组合中选择项目时,如何从另一个js文件中检索所选项目值。



这里我使用以下代码



Hi all,
Here i have created combo using extjs 5, here my issue is when user selected item from the combo, how can i retrieve selected item value from another js file.

here i am using the below code

Ext.define('doscore.view.panel.Addpanel', {
    extend: 'Ext.container.Container',
    // alias: 'widget.Addpanel',
    xtype: 'app-addpanel',
    cls: 'app-addpanel',
    title: false,
    requires: [
        'Ext.form.field.ComboBox',
        'doscore.view.grids.Watchlist',
        'doscore.view.panel.AddpanelController',
        ],
    layout: 'hbox',
    reference: 'add-panel',
    hidden: true,
    itemId: 'add-panel',
    items: [
    {
        xtype: 'combo',
        emptyText: 'Search for Company',
        // cls: 'qsearch-combo',
        width: '500',
        margin: '20 20 15 20',
        valueField: 'DataText',
        displayField: 'DataId',
        reference: 'source1',
        matchFieldWidth: false,
        listConfig: {
            listeners: {
                beforeshow: function(picker) {
                    picker.minWidth = picker.up('combobox').getSize().width;
                }
            }
        },
            listeners: {
    select: 'itemSelected'
            }

    },
    {
        xtype: 'button',
        text: 'Add Company',
   //     width: 75,
        margin: '20 20 15 10',
        // handler: 'login'

        //listeners: {
        //    select: 'itemSelected'
        //}
    }
    ]

});





当用户根据该名称创建选项卡单击任何列并将该列值设置为另一个ext js文件时。



这里js表示不是javascript它的ext js文件

请将任何信息分享给我。



when user click any column based on that name create tab and that colum value to be paased to another ext js file.

here js means not javascript it's ext js file
please share any information to me.

推荐答案

基本上,有另一个文件这样的东西。所有包含都在HTML < script> 标记中按照所需的执行顺序完成。所有代码的行为就像它在一个更大的JavaScript文件中一样。



请参阅:

如何在其他javascript文件中嵌入脚本代码? [ ^ ]



-SA
Essentially, there is such thing as "another file". All includes are done in the HTML <script> tags, in the required order of execution. All code behaves as if it was in one bigger JavaScript file.

Please see:
How to embed script code in other javascript file?[^]

—SA


这篇关于如何从一个js文件中检索值到extjs5中的另一个js文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆