zoukankan      html  css  js  c++  java
  • easyui datagrid 每条数据后添加操作按钮

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

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

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

    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>
    View Code
  • 相关阅读:
    Java中断机制
    RPC原理
    synchronized和ReentrantLock的区别
    dubbo入门
    Zookeeper入门
    分布式事务
    Mysql索引会失效的几种情况
    java代码执行过慢的问题定位
    持续集成
    Mycat 数据库分库分表中间件
  • 原文地址:https://www.cnblogs.com/shenchao/p/4603128.html
Copyright © 2011-2022 走看看