easyui datagrid 每条数据后添加“编辑、查看、删除”按钮

1、给datagrid添加操作字段:字段值

<table class="easyui-datagrid" data-options="singleSelect:true,collapsible:true,url:'publish.json',method:'get',fit:true"
style="width: 700px; height: 250px">
<thead>
<tr>
<th data-options="field:'itemid',width:'10%',align:'center'">序号</th>
<th data-options="field:'productid',width:'15%',align:'center'">标题</th>
<th data-options="field:'listprice',width:'15%',align:'center'">信息类型</th>
<th data-options="field:'unitcost',width:'15%',align:'center'">附件情况</th>
<th data-options="field:'attr1',width:'15%',align:'center'">发布时间</th>
<th data-options="field:'status',width:'15%',align:'center'">发布状态</th>
<th data-options="field:'operate',width:'15%',align:'center',formatter:operate_formatter">操作</th>
</tr>
</thead>
</table>

2、javascript实现:

     <script type="text/javascript">
function operate_formatter(value, row, index) {
return "<a href='#' class='easyui-linkbutton'>编辑</a>/\
<a href='#' class='easyui-linkbutton'>查看</a>/\
<a href='#' class='easyui-linkbutton'>删除</a>";
}
</script>

easyui datagrid 每条数据后添加操作按钮的更多相关文章

  1. 在easyui datagrid中formatter数据后使用linkbutton

    http://ntzrj513.blog.163.com/blog/static/2794561220139245411997/ formatter:function(value,rowData,ro ...

  2. sql server中新增一条数据后返回该数据的ID

    开发中遇到的问题:在新增一条数据后往往不需要返回该数据的ID,但是有的时候可能需要返回该数据的ID以便后面的编程使用. 在这里介绍两种方法: 其一:使用存储过程: create procedure a ...

  3. 关于如何在mysql中插入一条数据后,返回这条数据的id

    简单的总结一下如何在mysql中出入一条数据后,返回该条数据的id ,假如之后代码需要这个id,这样做起来就变得非常方便,内容如下: <insert id="insertAndGetI ...

  4. 实现easyui datagrid在没有数据时显示相关提示内容

    本示例实现easyui datagrid加载/查询数据时,如果没有相关记录,则在datagrid中显示没有相关记录的提示信息,效果如下图所示 本实例要实现如下图所示的效果: 本示例easyui版本为1 ...

  5. JQuery easyUi datagrid 中 自定义editor作为列表操作按钮列

    转自   http://blog.csdn.net/tianlincao/article/details/7494467 前言 JQuery easyUi datagrid 中 使用datagrid生 ...

  6. 解决easyui datagrid加载数据时,checkbox列没有根据checkbox的值来确定是否选中

    背景:   昨天帮朋友做一个easyui datagrid的小实例时,才发现easyui datagrid的checkbox列,没有根据值为true或false来选中checkbox,当时感觉太让人失 ...

  7. nodejs操作 mongoose(mongodb)和Sequelize(mysql)查询数据后添加新属性未生效

    最近在着手koa时候,发现mongoose(mongodb)查询数据库后添加新属性,前端拿不到新属性问题, 然后测试了一下Sequelize(mysql),发现也有同样的问题存在.此时着手干! 1.1 ...

  8. Easyui datagrid加载数据时默认全选的问题

    问题描述: 最近使用 Easyui datagrid 展示数据,之前一直使用很正常,今天出现了一个怪异问题 加载数据后,只要点击选中列 ck 的任意行或多行,再刷新时整个datagrid的所有数据都 ...

  9. easyui datagrid 相关取数据总结

    easyui 中datagrid$('#dg').datagrid('getSelected');返回第一个被选中的行或如果没有选中的行则返回null.$('#dg').datagrid('getSe ...

随机推荐

  1. MySQLdb模块操作

    Linux 安装mysql: apt-get install mysql-server 安装python-mysql模块:apt-get install python-mysqldb Windows ...

  2. Function call process

    摘自自博客网址 http://www.cnblogs.com/bangerlee/archive/2012/05/22/2508772.html ax(accumulator): 可用于存放函数返回值 ...

  3. Troubleshooting JDK

    收集整理下JDK自带的关于 Troubleshooting 的文档 Java 2 Platform, Standard Edition 5.0 Troubleshooting and Diagnost ...

  4. SQL百分比

    百分比=cast(cast(count(ProvinceName)*100./ (select count(Id) from  dbo.TopicCurrent   where boardId=316 ...

  5. 分布式领域CAP理论

    分布式领域CAP理论,Consistency(一致性), 数据一致更新,所有数据变动都是同步的Availability(可用性), 好的响应性能Partition tolerance(分区容错性) 可 ...

  6. G面经prepare: set difference

    给你A{1,2,3,4,4,5}, B{2,4},求A-B={1,3,4,5},很简单. visit 1 只用一个HashMap package TwoSets; import java.util.* ...

  7. FB面经prepare: task schedule II

    followup是tasks是无序的. 一开始是有序的,比如说1, 1, 2, 1,一定要先执行第一个task1,然后等task1恢复,再执行第2个task1,再执行task2..... follow ...

  8. SQL 自动增长 identity

    create table Users( id ,),--id 从10000开始,增加长度为1 name ), ); --执行三次这个语句 insert into Users values('小昆虫') ...

  9. 求树的重心(POJ1655)

    题意:给出一颗n(n<=2000)个结点的树,删除其中的一个结点,会形成一棵树,或者多棵树,定义删除任意一个结点的平衡度为最大的那棵树的结点个数,问删除哪个结点后,可以让平衡度最小,即求树的重心 ...

  10. TP隐藏入口

    我们知道,在thinkphp的案例中有一个.htaccess文件,里面配置了URL的一些重写规则,如: <IfModule mod_rewrite.c>  RewriteEngine on ...