第04章节-Python3.5-组件BootStrap、EasyUI、JQueryUI1用法 3
EasyUI用法:
- 把EasyUI下载到本地,然后看文档找到自己想要的样式,然后写到自己的代码里(推荐看源码里的demo文件里的源码)[但存在大量的Ajax操作]{不推荐用}
- 打开
- (http://www.jeasyui.net/)或(http://www.jeasyui.com/download/v155.php)下载jquery-easyui-1.5.5.4文件(点击download下载)
然后目录如下:
image.png
新建s2.html 代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Basic CRUD Application - jQuery EasyUI CRUD Demo</title>
<link rel="stylesheet" type="text/css" href="jquery-easyui-1.5.5.4/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="jquery-easyui-1.5.5.4/themes/icon.css">
<link rel="stylesheet" type="text/css" href="jquery-easyui-1.5.5.4/themes/color.css">
<link rel="stylesheet" type="text/css" href="jquery-easyui-1.5.5.4/demo/demo.css">
<script type="text/javascript" src="jquery-easyui-1.5.5.4/jquery.min.js"></script>
<script type="text/javascript" src="jquery-easyui-1.5.5.4/jquery.easyui.min.js"></script>
</head>
<body>
<h2>Basic CRUD Application</h2>
<p>Click the buttons on datagrid toolbar to do crud actions.</p>
<table id="dg" title="My Users" class="easyui-datagrid" style="width:700px;height:250px"
url="get_users.php"
toolbar="#toolbar" pagination="true"
rownumbers="true" fitColumns="true" singleSelect="true">
<thead>
<tr>
<th field="firstname" width="50">First Name</th>
<th field="lastname" width="50">Last Name</th>
<th field="phone" width="50">Phone</th>
<th field="email" width="50">Email</th>
</tr>
</thead>
</table>
<div id="toolbar">
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newUser()">New User</a>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editUser()">Edit User</a>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="destroyUser()">Remove User</a>
</div>
<div id="dlg" class="easyui-dialog" style="width:400px" data-options="closed:true,modal:true,border:'thin',buttons:'#dlg-buttons'">
<form id="fm" method="post" novalidate style="margin:0;padding:20px 50px">
<h3>User Information</h3>
<div style="margin-bottom:10px">
<input name="firstname" class="easyui-textbox" required="true" label="First Name:" style="width:100%">
</div>
<div style="margin-bottom:10px">
<input name="lastname" class="easyui-textbox" required="true" label="Last Name:" style="width:100%">
</div>
<div style="margin-bottom:10px">
<input name="phone" class="easyui-textbox" required="true" label="Phone:" style="width:100%">
</div>
<div style="margin-bottom:10px">
<input name="email" class="easyui-textbox" required="true" validType="email" label="Email:" style="width:100%">
</div>
</form>
</div>
<div id="dlg-buttons">
<a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="saveUser()" style="width:90px">Save</a>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')" style="width:90px">Cancel</a>
</div>
<script type="text/javascript">
var url;
function newUser(){
$('#dlg').dialog('open').dialog('center').dialog('setTitle','New User');
$('#fm').form('clear');
url = 'save_user.php';
}
function editUser(){
var row = $('#dg').datagrid('getSelected');
if (row){
$('#dlg').dialog('open').dialog('center').dialog('setTitle','Edit User');
$('#fm').form('load',row);
url = 'update_user.php?id='+row.id;
}
}
function saveUser(){
$('#fm').form('submit',{
url: url,
onSubmit: function(){
return $(this).form('validate');
},
success: function(result){
var result = eval('('+result+')');
if (result.errorMsg){
$.messager.show({
title: 'Error',
msg: result.errorMsg
});
} else {
$('#dlg').dialog('close'); // close the dialog
$('#dg').datagrid('reload'); // reload the user data
}
}
});
}
function destroyUser(){
var row = $('#dg').datagrid('getSelected');
if (row){
$.messager.confirm('Confirm','Are you sure you want to destroy this user?',function(r){
if (r){
$.post('destroy_user.php',{id:row.id},function(result){
if (result.success){
$('#dg').datagrid('reload'); // reload the user data
} else {
$.messager.show({ // show error message
title: 'Error',
msg: result.errorMsg
});
}
},'json');
}
});
}
}
</script>
</body>
</html>
- s1.html的代码是从(http://www.jeasyui.com/demo/main/index.php)的网页中的Source Code复制的如图
image.png
把这块的代码如图
image.png
:
然后把上述那块的代码修改为如下图:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Basic CRUD Application - jQuery EasyUI CRUD Demo</title>
<link rel="stylesheet" type="text/css" href="jquery-easyui-1.5.5.4/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="jquery-easyui-1.5.5.4/themes/icon.css">
<link rel="stylesheet" type="text/css" href="jquery-easyui-1.5.5.4/themes/color.css">
<link rel="stylesheet" type="text/css" href="jquery-easyui-1.5.5.4/demo/demo.css">
<script type="text/javascript" src="jquery-easyui-1.5.5.4/jquery.min.js"></script>
<script type="text/javascript" src="jquery-easyui-1.5.5.4/jquery.easyui.min.js"></script>
</head>
打开s2.html效果图如下:
JQueryUI
JQueryUI用法(用法同上):
- JQueryUI主要用于后台管理
打开(https://jqueryui.com/)然后点击Stable下载:
image.png - 然后解压源码打开index.html就能看到JQueryUI的所有例子,想用那个例子就右键查看源码直接复制那块源码[推荐指数*]
BootStrap(用于全栈也是最好看)
BootStrap用法():
打开(http://www.bootcss.com/)然后点击BootStrap3中文文档
或打开(https://v3.bootcss.com/)然后能看到各种各样案例也可以在百度搜索BootStrap模板
-
下载BootStrap
image.png

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
-
上一篇
全栈开发者要掌握10大编程语言
1. Java 这是一个简单易懂的语言,通常用于开发原生的Android应用。Java语言通常用于后端技术,特别是处理复杂应用的时候。同时,它几乎能够在所有的平台上运行,如Mac OS,Windows,Unix,Solaris,Linux等。 此外,Java还可以配置在多个应用服务器上。作为web开发人员,你需要学习如何使用Java进行编程,另外,由于Java的稳定性和兼容性,使其能够适用于很多大型的项目上。 作为Web开发人员,你需要学习如何为你的旅行计划使用java Web技术的景观。 此外,由于java的稳定性和兼容性,大型项目是合适的,使它适合你可能承担工程。 2. JavaScript 如果你想给用户一个很好的体验,从而让页面之间尽可能多的进行交互,那么JavaScript是最合适的编程语言。这是一个基于浏览器的编程语言。如果你需要在你创建的网页上添加几个效果,或者需要在网站上创建弹窗,那么你肯定会需要JavaScript。对网站来说,这种语言还能吸引访客增加网站流量。它让网站看起来很美观,从而创造了一个强大的视觉效果。这是一个全栈web开发者不应该忽视的前端技术。所有web...
-
下一篇
你真的懂volatile关键字吗
volatile这个关键字可能很多朋友都听说过,或许也都用过。在Java 5之前,它是一个备受争议的关键字,因为在程序中使用它往往会导致出人意料的结果。在Java 5之后,volatile关键字才得以重获生机。 volatile关键字虽然从字面上理解起来比较简单,但是要用好不是一件容易的事情。由于volatile关键字是与Java的内存模型有关的,因此在讲述volatile关键之前,我们先来了解一下与内存模型相关的概念和知识,然后分析了volatile关键字的实现原理,最后给出了几个使用volatile关键字的场景。 一.内存模型的相关概念 大家都知道,计算机在执行程序时,每条指令都是在CPU中执行的,而执行指令过程中,势必涉及到数据的读取和写入。由于程序运行过程中的临时数据是存放在主存(物理内存)当中的,这时就存在一个问题,由于CPU执行速度很快,而从内存读取数据和向内存写入数据的过程跟CPU执行指令的速度比起来要慢的多,因此如果任何时候对数据的操作都要通过和内存的交互来进行,会大大降低指令执行的速度,因此在CPU里面就有了高速缓存。 也就是说,程序在运行过程中,会将运算需要的数据从...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- SpringBoot2配置默认Tomcat设置,开启更多高级功能
- Docker安装Oracle12C,快速搭建Oracle学习环境
- CentOS7,CentOS8安装Elasticsearch6.8.6
- SpringBoot2初体验,简单认识spring boot2并且搭建基础工程
- CentOS8编译安装MySQL8.0.19
- MySQL数据库在高并发下的优化方案
- CentOS6,7,8上安装Nginx,支持https2.0的开启
- MySQL8.0.19开启GTID主从同步CentOS8
- Springboot2将连接池hikari替换为druid,体验最强大的数据库连接池
- CentOS7,8上快速安装Gitea,搭建Git服务器