首页 > web前端 > js教程 > bootStrap按钮格式化操作

bootStrap按钮格式化操作

PHPz
发布: 2018-10-15 15:40:28
原创
2037 人浏览过

1      Html

<th class="col-xs-4" data-field="operation" data-formatter="actionFormatter"
    data-events="actionEvents" data-align="center" vertical-align:middle!important; >
    操作
</th>
登录后复制

2 Js

2.1 格式化

//格式化操作按钮
function actionFormatter(value, row, index) {
    return getOperation(row[&#39;id&#39;],row[&#39;pic&#39;],row[&#39;name&#39;]);
}
登录后复制

2.2 具体格式化

function getOperation(id,pic,value){
    return operation=&#39;<p class="visible-md visible-lg hidden-sm hidden-xs action-buttons">&#39;+
        &#39;<a class="blue" data-toggle="modal" onclick="seePic(\&#39;&#39;+pic+&#39;\&#39;)">&#39;+
        &#39;<i class="icon-zoom-in bigger-130"></i>&#39;+
        &#39;</a>&#39;+
        &#39;<a class="green" href="#" onclick="openModal(\&#39;update\&#39;,&#39;+id+&#39;,\&#39;&#39;+value+&#39;\&#39;&#39;+&#39;)">&#39;+
        &#39;<i class="icon-pencil bigger-130"></i>&#39;+
        &#39;</a>&#39;+
        &#39;<a class="red" href="#" onclick="deleteHotelService(&#39;+id+&#39;)">&#39;+
        &#39;<i class="icon-trash bigger-130"></i>&#39;+
        &#39;</a>&#39;+
        &#39;</p>&#39;+
        &#39;<p class="visible-xs visible-sm hidden-md hidden-lg">&#39;+
        &#39;<p class="inline position-relative">&#39;+
        &#39;<button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown">&#39;+
        &#39;<i class="icon-caret-down icon-only bigger-120"></i>&#39;+
        &#39;</button>&#39;+
        &#39;<ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">&#39;+
        &#39;<li>&#39;+
        &#39;<a href="#" class="tooltip-info" data-rel="tooltip" title="View">&#39;+
        &#39;<span class="blue">&#39;+
        &#39;<i class="icon-zoom-in bigger-120"></i>&#39;+
        &#39;</span>&#39;+
        &#39;</a>&#39;+
        &#39;</li>&#39;+
        &#39; <li>&#39;+
        &#39;<a href="#" class="tooltip-success" data-rel="tooltip" title="Edit">&#39;+
        &#39; <span class="green">&#39;+
        &#39; <i class="icon-edit bigger-120"></i>&#39;+
        &#39;</span>&#39;+
        &#39; </a>&#39;+
        &#39;</li>&#39;+
        &#39;<li>&#39;+
        &#39;<a href="#" class="tooltip-error" data-rel="tooltip" title="Delete">&#39;+
        &#39;<span class="red">&#39;+
        &#39;<i class="icon-trash bigger-120"></i>&#39;+
        &#39; </span>&#39;+
        &#39; </a>&#39;+
        &#39; </li>&#39;+
        &#39;</ul>&#39;+
        &#39; </p>&#39;+
        &#39; </p>&#39;;
}
登录后复制

3      效果图

【相关视频推荐:Bootstrap教程

以上是bootStrap按钮格式化操作的详细内容。更多信息请关注PHP中文网其他相关文章!

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板