ext 中 ajax怎么异步加载js文件 ?

2019-03-25 13:36|来源: 网路

ext 中 ajax怎么异步加载js文件 ? 谁能提供下代码?
问题补充:
想找个一好用的的 我找了个 不知道为什么加载js 总是失败,偶尔也能成功
var jsStr = "";
Ext.Ajax.request( {
	// method : 'POST', 
		url : "pages/UnitsInfo.js",
		//scope : this,
		success : function(response) {

			jsStr += response.responseText;// 把每次加载的内容都存入jsStr中 
			// 获取模块类 
			this[node.id] = eval(jsStr);
			// 实例化模块类
			model = new this[node.id]();

			tab.on('destroy', function() {
				model.destroy();
			});
		},
		failure : function(response) {
			Ext.Msg.show( {
				title : "错误信息",
				msg : "加载页面核心文件时发生错误!",
				buttons : Ext.MessageBox.OK,
				icon : Ext.MessageBox.ERROR
			});
		}
	});

相关问答

更多
  • 通过使用-Dosgi.parentClassloader=ext修复, -Dosgi.parentClassloader=ext问题通过OSGI运行时无法从已安装的扩展中实例化类 Fixed by using -Dosgi.parentClassloader=ext, as in question Can't instantiate class from installed extension when run via OSGI
  • 脚本文件可能是并行下载的,而ExtJs脚本文件非常大。 尝试将Ext.application附加到绑定到窗口onload事件的函数中。 This is my fault. i dont't create the jsp files right on my project. It is working now true.
  • 通过在C#提供以下代码找到解决方案 PagingToolbar1.PageSize = 25; PagingToolbar1.PageIndex = 1; Found the Solution by Providing the Following code in C# PagingToolbar1.PageSize = 25; PagingToolbar1.PageIndex = 1;
  • chrome开发人员工具中的Console.log()或firefox的firebug等同于System.out.print 如果你在一个函数中,那么“var”将创建一个局部变量,否则它将在全局范围内。 this它在javascript中的工作方式与java相比有所不同。 在JavaScript中,这总是指我们正在执行的函数的“所有者”,或者更确切地说,指向函数是其方法的对象。 这是在javascript中使用this的运行: javascript中的this关键字 Console.log() in chr ...
  • 第一个问题是,当您使用边框布局时,需要的项目很少: 使用Border布局的任何Container必须具有带区域的子项:'center'。 中心区域中的子项目将始终调整大小以填充布局中其他区域未使用的剩余空间。 具有西或东区域的任何子项都可以配置初始宽度,或Ext.layout.container.Box.flex值,或初始百分比宽度字符串(简单地除以100并用作flex值)。 'center'区域的flex值为1。 具有北或南区域的任何子项可以配置初始高度,或Ext.layout.container.Box ...
  • 您可以尝试此链接用于CORS http://www.sencha.com/forum/showthread.php?267051-extjs4-Ext.Ajax.Request-and-Cross-domain&p=978374&viewfull=1#post978374 You can try this link for CORS http://www.sencha.com/forum/showthread.php?267051-extjs4-Ext.Ajax.Request-and-Cross-doma ...
  • 好吧,Sencha团队尚未记录这一点,但它已经可用。 您必须使用网格的Ext.grid.View上的标头容器上提供的方法来执行此操作: renderer: function(val, meta, rec, rowIdx, colIdx, store, view) { var column = view.getHeaderAtIndex(colIdx); var dataIndex = column.dataIndex; } 这样做的原因是因为Ext.grid ...
  • https://moduscreate.com/associations-in-ext-js-5/用一个很好的例子和代码片段解释了ExtJS关联。 https://moduscreate.com/associations-in-ext-js-5/ explains ExtJS associations with a very good example and code snippet.
  • 即使包含ext-all(-debug).js,你仍然需要在此之前包含ext-base.js文件,否则你将得到“Ext is not defined error”。 如果你已经过去了,你不确定你的最后评论,但我想我会指出它。 有关如何设置包含的详细信息,请参阅此页面: http://www.extjs.com/learn/Tutorial:HTML_Page_Setup Even when including ext-all(-debug).js, you still need to include the ...
  • 只需使用以下代码即可下载该文件: doExportData: function(config){ window.location.assign(config.url + (config.params ? '?' + Ext.urlEncode(config.params) : '')); }); The file can be downloaded just with this code: doExportData: function(config){ window.locatio ...