经过一早上的努力,终于成功显示了ext.msg.alert("somestring")!一个漂亮的对话框,呵呵

真的是感想挺多,收获也很多的。主要是:

一、用Wamp在win7下搭建好了运行网页的环境;

二、按照别人提供好的方法,做好了EclipseForPHP+spekt+Extjs4.0的工具及环境;(具体链接在我的blog下可以找到)

三、打开了extjs的api文档,再参照着extjs提供的示例中msgbox相关部分,可以改变对话框的样式;

四、注意在html引入文件所需要的路径以及.js文件中当函数体结束时不要忘了打“;”号;

以下是两个文件的代码:主要是引入文件时的路径把我的时间浪费了不少

helloworld.js:

Ext.onReady(function(){
Ext.get('btn1').on('click',function(e){
//Ext.Msg.alert("hello world!"); //显示的是标准的对话框
/*Ext.Msg.prompt('Name', 'Please enter your name:', function(btn, text){
if (btn == 'ok'){
// process text value and close...
}
});*/
Ext.Msg.show({
title:'Save Changes?',
msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
buttons: Ext.Msg.YESNOCANCEL,
icon: Ext.Msg.QUESTION
});
}); });

index.html:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>程序界面</title>
<link rel="stylesheet" type="text/css" href="/ext4/resources/css/ext-all.css">
<script type="text/javascript" src="/ext4/bootstrap.js"></script>
<script type="text/javascript" src="/ext4/locale/ext-lang-zh_CN.js"></script>
<script type="text/javascript" src="helloworld.js"></script>
</head>
<body>
<button id="btn1">show a message</button>
</body>
</html>

*************************************************************

在使用eclipse编辑好.js文件后,若要想显示中文,一定是要在preferences->General->workspaced页面把"Text file encoding"项改成"utf-8"格式。

extjs4_msg的更多相关文章

随机推荐

  1. php foreach 语法的遍历来源数组如果不是一个有效数组php会出现错误警告 Invalid argument supplied for foreach()

    在php中,foreach语法的遍历来源数组如果不是一个有效数组,php会出现错误警告 Invalid argument supplied for foreach() ,但是很多时候这个数组是取自某些 ...

  2. sublime简书安装配置

    sublime-text3编辑器 安装 sudo add-apt-repository ppa:webupd8team/sublime-text-3 sudo apt-get update sudo ...

  3. 面试复习(C++)之快速排序

    #include <iostream> using namespace std; void Quicksort(int *a,int low,int high) { if(low>h ...

  4. win7下安装Sass和compass

    由于项目需要我们使用到sass来编译css文件.本人在win7下开发 由于国内安装sass遇到了一些困难,后来不得不网查询,后来终于解决了,这里介绍一下 1.要安装sass环境必须要先安装rubyIn ...

  5. mySql 基本语法学习笔记

     create database if not exists yang;    drop database if exists yang;     show databases;   show dat ...

  6. 快速加载DXF、DWG格式文件控件ABViewer

    ABViewer是一种高品质,低成本,高效率的多功能设计及工程文档管理应用程序. ABViewer为您提供专业的cad文件浏览和编辑工具. 支持多种格式,如:DWG格式, DXF, DWF, Hewl ...

  7. android 加载中、无网络、无数据、出错 四种状态的代码封装

    package com.weavey.loading.lib;import android.content.Context;import android.content.res.TypedArray; ...

  8. Basic linux command-with detailed sample

    Here I will list some parameters which people use very ofen, I will attach the output of the command ...

  9. ubuntu的一些操作

    1.修改ubuntu的grub启动选择菜单 需要修改到文件为 /boot/grub/grub.cfg 命令: sudo gedit /boot/grub/grub.cfg 修改默认启动项:set de ...

  10. Windows Server 2003 IIS6.0+PHP5(FastCGI)+MySQL5环境搭建教程

    准备篇 一.环境说明: 操作系统:Windows Server 2003 SP2 32位 PHP版本:php 5.3.14(我用的php 5.3.10安装版) MySQL版本:MySQL5.5.25 ...