这一篇中我们将看看如何给手风琴动态的增加,删除格子,怎样选择某一个格子的。

1.先看看引用的资源

        <link rel="stylesheet" href="jquery-easyui-1.3.5/themes/default/easyui.css" />
<link rel="stylesheet" href="jquery-easyui-1.3.5/themes/icon.css" />
<link rel="stylesheet" href="jquery-easyui-1.3.5/demo/demo.css" />
<script type="text/javascript" src="jquery-easyui-1.3.5/jquery.min.js"></script>
<script type="text/javascript" src="jquery-easyui-1.3.5/jquery.easyui.min.js"></script>

2.下面是html

    <div class="demo-info">
<div class="demo-tip icon-tip"></div>
<div>Click the buttons below to add or remove accordion items.</div>
</div>
<div style="margin:10px 0">
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="selectPanel()">Select</a>
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="addPanel()">Add</a>
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="removePanel()">Remove</a>
</div>
<div id="aa" class="easyui-accordion" style="width:500px;height:300px">
<div title="About" data-options="iconCls:'icon-ok'" style="overflow:auto;padding:10px">
<h3 style="color:#0099FF;">Accordion for jQuery</h3>
<p>Accordion is a part of easyui framework for jQuery. It lets you define your accordion component on web page more easily.</p>
</div>
</div>

这个就一个定义class="easyui-accordion"

3.注意这里有三个按钮实现选择,新增,删除手风琴的格子的功能,下面看看这些js方法是什么样子的

    <script type="text/javascript">
function selectPanel(){
$.messager.prompt("Prompt",'Please enter the panel title:',function(s){
if(s){
$("#aa").accordion('select',s);
}
});
}
var idx=1;
function addPanel(){
$("#aa").accordion("add",{
title:"Title"+idx,
content:'<div style="padding:10px">Content'+idx+'</div>'
});
idx++;
}
function removePanel(){
var pp = $("#aa").accordion('getSelected');
if(pp){
var index = $("#aa").accordion('getPanelIndex',pp);
$("#aa").accordion('remove',index);
}
}
</script>

选中某一格的方法是

function selectPanel(){
        $.messager.prompt("Prompt",'Please enter the panel title:',function(s){
            if(s){
                $("#aa").accordion('select',s);
            }
        });
    }

这里先弹出对话框填入关键字,然后根据关键字搜索,搜索的内容是Title,注意这里是全字匹配,成功后就选中这一格,效果如下:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAioAAADmCAIAAAB05zkCAAAgAElEQVR4nO2deWwb+4HfnXYLtAlqoH8siu0CaRdddDe7NbrButg2DykWgdrtogkaOG+TVEnWG9vxy/H08JQnU8+nbMuS7UfLlmxL8iFL8m3Lkm1J1mGZOilREklRByne933poKiL10z/IEXxFCmLFDn094MPFuRwZjgzG87n/WZG7+2xAQAAALvOnkxvAAAAgA8R5AcAAEAGQH4AAABkAOQHAABABtjMz4sBOYQQQpgOE+RHrLJBCCGEqRX5gRBCmAGRHwghhBkQ+YEQQpgBkR8IIYQZEPmBEEKYAdOYn2m5tmNmqHas4dpoTcb3E0IIYVaZrvyMikTPJ9qujVecGP7i129/nfH9hBBCmFWmPj8ChZHBn2gYf3SdU06f+LJ8rITOrMr4fkIIIcwqt52fGbmerzAIleaYq+NJNa8nBm6O1FznltwVnL7JPX939H6fgBc+m6yhlJ5fQM+v5YRM5NAL6PmlDFamjwikplaxMqAIQrhbciSWl5PmN9Pm6I+GhOaXk+b+2Rgf+W0ZlFnDSZCfJnb3K27fiFAYUSChyjImkj4d77g4UH5nuuSF7EItt/TWSP0gfzryTMFjFBXQi0rr8gua2zenpy4/PEZRWNhgbutPjkWktIgUZpHCLFKYIIS746TU2DFlqGfpuqcMswpjcPrQrOHpuP45x8ASGeMt+2pQajKZzGaz2Wy2WCwWi8VqtW6Vn9+0fFb05vi9kWejQrFIZRGrbCKVdUZuGOIL7g4+Pf3uxFNxOUNLv8U9f3PwzrspbvT5gtVUl1/Q3M5ozi+oa+AFp6coPzxGUeS4CuasfJn59Yjmfq+u9q2xutsEIaSQNd2mxl5d64hGodYZjUZ/irbKz/G2kvLh02X95+uHmrhipUhl4Uk0bWxmacfVsqGT3eqqYcONWs75a3233k1NxDplyBpK/Xng0AvoRU2yjemB/DTU0vML6PkFdDojfJECv8EBU2iu/DM0t8eeE+amHJGlsd/C4DsUFrfdSSyskBBCCj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jBwAAshr8S3cAAABkAOQHAABABkB+AAAAZADkBwAAQAZAfgAAAGQA5AcAAEAGQH4AAABkAOQHAABABkB+AAAAZADkBwAAQAZAfgAAAGQA5AcAAEAGQH4AAABkAOQHAABABkB+AAAAZADkBwAAQAZAfgAAAGQA5AcAAEAGQH4AAABkAOQHAABABkB+AAAAZADkBwAAQAZAfgAAAGQA5AcAAEAGiNmX/w+yP/ucdwcLUAAAAABJRU5ErkJggg==" alt="" />

添加一格的方法是

var idx=1;
function addPanel(){
$("#aa").accordion("add",{
title:"Title"+idx,
content:'<div style="padding:10px">Content'+idx+'</div>'
});
idx++;
}

这里添加方法关键字“add”,然后一个json对象{ title:"Title"+idx,content:'<div style="padding:10px">Content'+idx+'</div>' },对象里面就两个属性,一个title,一个content。

删除一个格子的方法是

var pp = $("#aa").accordion('getSelected');
if(pp){
var index = $("#aa").accordion('getPanelIndex',pp);
$("#aa").accordion('remove',index);
}

这个方法首先获取选择当前手风琴被选中的格子的index,然后调用remove方法删除这个格子。

 

easyui学习笔记9—手风琴格子的增,删和选择的更多相关文章

  1. easyui学习笔记10—手风琴格子始终展开和多个格子展开

    始终打开有时候可能会很管用,其实就是一个设置问题.这里就不再介绍引用的资源了,这里只看看html是怎么写的. 1.html代码 <body> <h2>Basic Accordi ...

  2. easyui学习笔记6—基本的Accordion(手风琴)

    手风琴也是web页面中常见的一个控件,常常用在网站后台管理中,这里我们看看easyui中基本的手风琴设置. 1.先看看引用的资源 <meta charset="UTF-8" ...

  3. easyUI学习笔记二

    1.  拖拉大小 <!DOCTYPE html> <html> <head> <title>easyui学习</title> <scr ...

  4. easyUI学习笔记一

    1.引用js文件 <script type="text/javascript" src = jquery-easyui/jquery.min.js> </scri ...

  5. easyui学习笔记2—在行内进行表格的增删改操作

    第一篇笔记中记录了如何实现表格的增删改,那个是点击之后跳出来一个对话框然后进行的,这里是在表格本身上进行的操作,也很简单,但是这里发现一个版本问题,也可以说是兼容性问题. 1.首先我们看引用的js和c ...

  6. easyui学习笔记1—增删改操作

    最近公司要用easyui,这里自己看了官网几篇文章,遇到些问题,大多数的问题都是敲代码的时候笔误,其他有些地方确实需要注意一下,这里做些笔记. 1.在mysql中建好表之后修改id字段为递增字段,发现 ...

  7. easyui学习笔记3—在展开行内的增删改操作

    这一篇介绍在一个展开行内进行的增删操作,如果一行很长有很多的数据,在一个展开行内进行编辑将更加方便. 1.先看引用的资源 <link rel="stylesheet" hre ...

  8. easyui学习笔记12—tab标签页的添加和删除

    这一篇我们来看看标签页的添加和删除动作.我在想看这些例子还不如看文档,文档的内容更加全面,但是文档全部是理论没有实际的操作,看起来很枯燥,文档只能是遇到问题的时候查.easyui的文档写的还是很详细的 ...

  9. ASP.NET学习笔记(3)——用户增删改查(三层)

    说明(2017-10-6 11:21:58): 1. 十一放假在家也没写几行代码,本来还想着利用假期把asp.net看完,结果天天喝酒睡觉,回去的票也没买到,惨.. 2. 断断续续的把用户信息的页面写 ...

随机推荐

  1. JavaSE_XMind总结

    1 JDBC知识点总结

  2. C#中加粗label的字体

    1. 在C#的代码中想直接加粗label控件的字体, label1.Font.Bold = true;//发现系统会提示Font.Bold是只读属性 如果必须要加粗字体呢,方法如下: 2. 使用Fon ...

  3. idea maven install 卡住,无报错排查。

    今天使用idea打包,执行install,看控制台日志,卡主了(意思是日志不继续在控制台输打印了,卡主了,也看不到错误),也没有报错,然后进行排查. 进入dos命令,进入到项目的根目录,使用 运行 m ...

  4. Oracle 12c心得

    1.重新启动Listener后,远程客户端登录不了,只能全新启动Oralce服务才能正常,经分析,用Net Manager增加一个服务器的IP地址的监听. 执行 net start 监听服务名 再远程 ...

  5. 关于vue的常识问题及解决方法

    一.VSCode开发必备插件 1.Beautify:语法高亮: 2.Bracket Pair Colorizer :对括号对进行着色: 3.ESLint:ESLint插件,高亮提示: 4.HTML C ...

  6. step4: Xpath的使用

    XPath 是一门在 XML 文档中查找信息的语言.XPath 可用来在 XML 文档中对元素和属性进行遍历. XPath 包含一个标准函数库. XPath 是一个 W3C 标准. 语法简介: htt ...

  7. Golang教程:类型

    下面是 Go 支持的基本类型: bool Numeric Types  int8, int16, int32, int64, int uint8,uint16,uin32,uint64, uint f ...

  8. linux下查看memcache版本

    用telnet 127.0.0.1 11211命令连接上memcache, 然后直接输入stats就可以得到memcache服务器的版本

  9. Swift函数_inout参数

    //无inout参数的函数 func changeName(var name:String){ name = "Hello" println(name) } let payerNa ...

  10. JMS - 基于JMS的RPC

    现在试试通过JMS,在应用程序之间发送消息.先看看spring提供的RPC方案(其实还有其他方案,只是没见过谁用).需要使用到这两个类:·org.springframework.jms.remotin ...