本文介绍在datagrid上同时添加搜索和操作区域。

仅仅是增加操作区域

□ 方法1

$('#dg').datagrid({ 
    toolbar: '#tb' 
}); 
<div id="tb"> 
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true"/a> 
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-help',plain:true"/a> 
</div>

□ 方法2

$('#dg').datagrid({ 
    toolbar: [{ 
        iconCls: 'icon-edit', 
        handler: function(){alert('edit')} 
    },'-',{ 
        iconCls: 'icon-help', 
        handler: function(){alert('help')} 
    }] 
});

仅仅增加搜索区域

$('#dg').datagrid({ 
    toolbar: '#tb' 
});
 
    <!--搜索开始--> 
    <div id="tb" style="padding:3px"> 
        <span>主键:</span> 
        <input id="itemid" style="line-height:22px;border:1px solid #ccc"> 
        <span>产品编号:</span> 
        <input id="productid" style="line-height:22px;border:1px solid #ccc"> 
        <a href="#" class="easyui-linkbutton" plain="false" id="btnQuery">搜索</a> 
    </div> 
    <!--搜索结束-->

同时增加搜索和操作区域

$('#dg').datagrid({ 
    toolbar: '#tb,#tb1', 
});   
 
    <!--搜索开始--> 
    <div id="tb" style="padding:3px"> 
        <span>主键:</span> 
        <input id="itemid" style="line-height:22px;border:1px solid #ccc"> 
        <span>产品编号:</span> 
        <input id="productid" style="line-height:22px;border:1px solid #ccc"> 
        <a href="#" class="easyui-linkbutton" plain="false" id="btnQuery">搜索</a> 
    </div> 
    <!--搜索结束-->
 
    <!--操作按钮开始--> 
    <div id="tb1"> 
        <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="javascript:alert('Add')">添加</a> 
        <a href="#" class="easyui-linkbutton" iconCls="icon-cut" plain="true" onclick="javascript:alert('Cut')">剪切</a> 
        <a href="#" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="javascript:alert('Save')">保存</a> 
    </div> 
    <!--操作按钮结束-->    
 

datagrid在MVC中的运用04-同时添加搜索和操作区域的更多相关文章

  1. datagrid在MVC中的运用05-加入时间搜索条件,枚举填充下拉框

    本文主要来体验在搜索区域增加更多的搜索条件,主要包括: ※ 使用jQuery ui的datepicker显示时间,设置显示格式.样式. ※ 设置jQuery ui的onClose事件,使开始和结束时间 ...

  2. datagrid在MVC中的运用01-基本属性并实现分页

    本文体验jQuery EasyUI的datagrid在MVC中的应用.主要涉及到: ※ datagrid的基本属性和方法 ※ datagrid分页在前后台的实现 最终效果: 与视图显示对应的view ...

  3. Android中通过ActionBar为标题栏添加搜索以及分享视窗

    在Android3.0之后,Google对UI导航设计上进行了一系列的改革,其中有一个非常好用的新功能就是引入的ActionBar,他用于取代3.0之前的标题栏,并提供更为丰富的导航效果.Action ...

  4. datagrid在MVC中的运用07-实现Master-Detail(使用PartialView)

    本文主要体验用jQuery Easyui的datagrid来实现Master-Detail主次表.谢谢Kevin的博文,助我打开了思路. 主表显示所有的Category,当点击主表的展开按钮,显示该C ...

  5. jQuery EasyUI DataGrid在MVC中的运用-基本属性并实现分页

    ※ datagrid的基本属性和方法  ※ datagrid分页在前后台的实现 最终效果:    与视图显示对应的view model   public class Book public strin ...

  6. datagrid在MVC中的运用10-勾选

    本文体验与勾选有关的特性. 需要加载的books.json 展开{ "total": 4, "rows": [ { "productid": ...

  7. datagrid在MVC中的运用09-实现排序

    本文体验datagrid的排序. □ 思路 当点击datagrid的标题,视图传递给Controller的Form Data类似这样:page=1&rows=10&sort=Custo ...

  8. datagrid在MVC中的运用06-固定连续列

    本文主要体验datagrid的frozenColumns属性. □ frozenColumns效果: 在frozenColumns的列将保持不动,而其他列横向滚动. □ frozenColumns效果 ...

  9. datagrid在MVC中的运用02-结合搜索

    本文接着上一篇,来体验给datagrid加上搜索功能.主要涉及到: ※ 把一个div与datagrid相关起来 ※ datagrid接收查询参数 ※ 查询参数的封装 效果图: 查询参数封装 分页相关的 ...

随机推荐

  1. 生成Insert语句的存储过程

    ) drop procedure [dbo].[spGenInsertSQL] GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO )) as b ...

  2. C#socket编程序(三)

    private void ReceiveData() { bool keepalive = true; Socket s = clientSocket; Byte[] buffer = new Byt ...

  3. 反向投影(BackProjection)

    如果一幅图像的区域中显示的是一种结构纹理或者一个独特的物体,那么这个区域的直方图可以看作一个概率函数,他给的是某个像素属于该纹理或物体的概率. 所谓反向投影就是首先计算某一特征的直方图模型,然后使用模 ...

  4. spring boot之org.springframework.boot.context.TypeExcludeFilter

    曾经碰到过这样一种情况,想让某个使用了spring 注解的类不被spring扫描注入到spring bean池中,比如下面的类使用了@Component和@ConfigurationPropertie ...

  5. 【LOJ】#2384. 「HNOI2013」切糕

    题解 神仙网络流啊-- naive的我一直想把每个纵轴拆点,每个纵轴建R个点(大概是要跑费用流吧--)--然后第二个限制就gg了,什么也想不出来,菜啊TAT 后来我发现大神们的建图都是,一个原点,一个 ...

  6. LoadRunner测试ajax框架,回放后系统中没有产生数据解决方法

    1.QTP11 下载地址:http://www.genilogix.com/downloads/unified-functional-testing/quicktest-professional-11 ...

  7. Elasticsearch环境准备(一)

    一.ELKStack简介 中文指南:https://www.gitbook.com/book/chenryn/elk-stack-guide-cn/details ELK Stack包含:Elasti ...

  8. Linux下的文件与目录权限

    一.用户(User).群组(Group)和其他人(Others) linux是多用户多任务的操作系统,同一时刻可能会有多个用户登录系统,考虑到文件的安全性等问题,所以Linux下的文件都属于一个特定的 ...

  9. Servlet中保存的cookie值读取不到

    在设计登录时记住密码功能时,很多时候回使用cookie,在Servlet中保存cookie时,再次访问登录页面,没有读取到保存的cookie值,代码如下: 1 Cookie idCookie = ne ...

  10. 在(Raspberry Pi)树莓派上安装NodeJS

    本文主讲如何在树莓派3B上安装node.js 环境描述1. 树莓派安装了`2016-11-25-raspbian-jessie-lite`(PS:在此版本的镜像中,默认禁用了ssh,在烧录好镜像之后, ...