如何在EXTJS中查找自定义类的来源

时间:2017-06-14 07:24:05

标签: extjs extjs6-classic

我在JS文件中有这个特定的代码片段:

var fileView = Ext.create('My.ext.File.Panel', {
            style: 'border:none;',
            loadMask: {
                msg: 'Please wait ...'
        ...

当我搜索时,我可以看到My.ext.File.Panel出现在各种自定义组件的requires配置中。

但我无法在来源的任何地方找到Ext.define('My.ext.File.Panel'

任何人都可以解释一下,或者指出我如何找到这个自定义面板的来源 - My.ext.File.Panel。我已尝试使用chrome和firefox中的dev-tools进行调试但无法获取它,不知道在哪里查看。

谢谢

1 个答案:

答案 0 :(得分:1)

有一些方法可以在ExtJs中创建一个类或分配一个别名。也许类名是使用变量组装的。

void Start () { if(!File.Exists(Application.dataPath.ToString() + "/Save.txt")) { File.CreateText(Application.dataPath.ToString() + @"/Save.txt"); saveFilePath = Application.dataPath.ToString() + @"/Save.txt"; TextWriter writer = new StreamWriter(saveFilePath, false); writer.WriteLine("10:21:59", "13 / 06 / 2017", "1", "1", "-21", "20000", "100", "500", "50", "20", "500","2","1","1","5000", "10"); writer.Close(); } if(!File.Exists(Application.dataPath.ToString() + "/AutoSave.txt")) { File.CreateText(Application.dataPath.ToString() + @"/Autosave.txt"); saveFilePath = Application.dataPath.ToString() + @"/Autosave.txt"; TextWriter writer = new StreamWriter(saveFilePath, false); writer.WriteLine("00:00:00", "01 / 01 / 2017", "1", "1", "-21", "20000", "100", "500", "50", "20", "500", "2", "1", "1", "5000", "10"); writer.Close(); } } 具有调试功能,可以记录任何类的注册。在启动应用程序之前插入下面的代码示例。这应该可以帮助您获得定义类的代码。

    public void OnSaveGame()
{
    saveFilePath = Application.dataPath.ToString() + @"/Save.txt";
    isNewGame = false;

    TextWriter writer = new StreamWriter(saveFilePath, false);
    theTime = System.DateTime.Now.ToString("hh:mm:ss"); theDate = System.DateTime.Now.ToString("dd/MM/yyyy");
    string ZeroPart = theTime + "," + theDate + ",";
    string FirstPart = income;
    writer.WriteLine(ZeroPart + FirstPart);
    writer.Close();

    SavingPanel.SetActive(true);
    Invoke("WaitTime",2);



}