解决问题:
1:Extjs的智能提示
2:找不到对象Ext
3:对象不支持“createContextualFragment”属性或方法
4:界面没有显示
代码:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.milton-icon
{
background: url(ext-3.3.1/resources/images/access/button/btn.gif) no-repeat;
}
</style>
<%--Extjs智能提示--%>
<script src="js/vswd-ext_2.0.2.js" type="text/javascript"></script>
<%--Extjs脚本引入的顺序,ext-base.js,ext-all-debug.js,解决“找不到对象Ext”--%>
<script src="../../ext-3.3.1/adapter/ext/ext-base.js" type="text/javascript"></script>
<script src="../../ext-3.3.1/ext-all-debug.js" type="text/javascript"></script>
<link href="../../ext-3.3.1/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
<%--该脚本解决对象不支持“createContextualFragment”属性或方法--%>
<script type="text/javascript">
if ((typeof Range !== "undefined") && !Range.prototype.createContextualFragment) {
Range.prototype.createContextualFragment = function (html) {
var frag = document.createDocumentFragment(),
div = document.createElement("div");
frag.appendChild(div);
div.outerHTML = html;
return frag;
};
}
</script>
<script type="text/javascript">
//直接写在onReady里面则为匿名函数,用来一次性调用特定的函数,为了不使程序过于庞大,不要使用匿名函数
Ext.onReady(function () {
Ext.Msg.show({
title: 'Milton', //标题
msg: 'Have you see my staper', //提示信息
buttons: //按钮
{
yes: true,
no: true,
cancel: true
},
icon: 'milton-icon', //图标
fn: function (btn)//函数
{
switch (btn) {
case 'yes':
Ext.Msg.prompt('Milton', 'Where is it?');
break;
case 'no':
Ext.Msg.alert('Milton', 'Im going to burn the building down!');
break;
case 'cancel':
Ext.Msg.wait('Save table to disk ..', 'File Copy');
break;
}
}
});//一对括号没有配好,extjs的界面就没有办法显示,而且你也很难找到错误的地方,必须注意细节
});
</script>
</head>
本文详细介绍了在使用ExtJS进行开发时遇到的问题及解决方案,包括智能提示配置、对象引用错误、方法不可用和界面显示问题。通过提供具体的代码示例和修改策略,帮助开发者快速定位并解决开发过程中常见的技术难题。
517

被折叠的 条评论
为什么被折叠?



