Home > Web Front-end > Layui Tutorial > layui table dynamic display transformation

layui table dynamic display transformation

Release: 2020-01-02 17:18:57
forward
3174 people have browsed it

layui table dynamic display transformation

When using Layui's table component, sometimes convertible operations such as showing or hiding functions are used, then dynamic transformation of buttons is required

layui table dynamic display transformationimplementation Method: Add the following code to the barDome of layui

<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="preview">预览</a>
    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    {{#  if(d.img_status == "yes"){ }}
    <a class="layui-btn layui-btn-warm layui-btn-xs no" lay-event="no">轮播隐藏</a>
    {{# }if(d.img_status == "no") { }}
    <a class="layui-btn layui-btn-xs yes" lay-event="yes">轮播显示</a>
    {{#  } }}
</script>
Copy after login

if is used to determine the conditions for displaying and hiding, and lay-event is the triggered event

You can use

reload after the event is triggered () method to refresh the table

For more layui knowledge, please pay attention to the PHP Chinese websitelayui usage tutorial column.

The above is the detailed content of layui table dynamic display transformation. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template