An overview of the

Single pageTo deal with
Add, modify, and view detailsShare the same pop-up page. The online demo
Data Table 2

use

There are two processing methods (the HTML configuration of the main difference area pop-up window). Choose which method to use according to the actual situation.

  1. Add and modify functions share the same button, use the same servlet interface to submit data, and determine add or modify by route;
  2. Define their own add or modify buttons, and submit their own servlet interfaces, just as in normal mode.

Add a topMode TAB to the button to describe the model that pops up (add: add window, edit: edit window, readonly: readonly window).

  • New window Demo
<button class="layui-btn" function="top" topUrl="one.html" topMode="add" topWidth="800px" topHeight="600px" TopTitle =" new demo"> < I class="layui-icon">&#xe654; < / I > add < / button >
  • Edit Window Demo
<a class="layui-btn layui-btn-xs" lay-event="top" topUrl="one.html" topMode="edit" topWidth="800px" topHeight="600px" TopTitle =" Edit demo" inputs=" ID :">
  • View details demo (read-only window)
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="top" topUrl="one.html" topMode="readonly" TopTitle =" Demo "inputs=" ID :"> Check </a>

Methods a

Add and modify functions share the same button, use the same servlet interface to submit data, and determine add or modify by route;

There is a system parameter _mode in the parameters submitted in this way, and the servlet interface determines whether to add or modify the parameter by obtaining this parameter. Add: adds new information. Edit: modifies the information

<button class="layui-btn" lay-submit="" lay-filter="save" URL ="/fsbus/1006">

Way 2

Define their own add or modify buttons, and submit their own servlet interfaces, just as in normal mode.

Special note: The add and edit buttons must have a specific class style. Hide and show by style. Add button needs to configure fsAdd edit button needs to configure fsEdit

<button class="layui-btn fsAdd" submit="" lay-filter="save" URL ="/fsbus/1001"> </button> <button class="layui-btn FsEdit "submit="" lay-filter="edit" url="/fsbus/1004">

This article appeared on my blog:
ITCTO technology blog