Layui table click event

Layui is a more commonly used plug-in, now I have come into contact with layui module and spreadsheet module pop-layer module
here that the click event of a single row of data
Layui there is a method to get method selected row following code
this method is to select the radio method check box also has a check box method, which can be written based on the method of radio to blame
here is to choose to check the box and then process the data for the selected row.

layuiTable.on ( 'Row (tabDicName)', function (obj) {
var = Data obj.data.DicNameID; // get click data line
// labeling the selected style
obj.tr.addClass ( 'layui-table-click ') .siblings () removeClass ( 'the click-Table-layui');.
// *** click to select the radio button
obj.tr.find ( 'div.layui-unselect.layui-form -radio') [1] .click ();
});

Data acquisition methods are generally selected line is this. Then get to go to deal with children of this data.
So it is very troublesome.

var data = layuiTable.checkStatus ( 'tabDicName'); // get click data line

Here we can directly engage with things inside the method of re-layui.
Layui which can be directly re-write things need to be implemented.
I need to achieve here is to submit this data to the database query what I needed.
Because it is a method layui above is to get take a look in the selected row he captured data
I have here just need him this ID is obvious to get here to this ID
Here Insert Picture Description
here to get to the id and then directly write this submission method on it this method is only for a single box.
It can not be used inside the box.

layuiTable.on ( 'Row (tabDicName)', function (obj) {
var = Data obj.data.DicNameID; // get click data line
// labeling the selected style
obj.tr.addClass ( 'layui-table-click ') . .siblings () removeClass ( 'layui -table-click');

   //***单击选中单选框
   obj.tr.find('div.layui-unselect.layui-form-radio')[1].click();

  tabDicNape = layuiTable.reload("tabDicNape", {
          url: "SelectDicNape",
          where: {
                DicNameID:data
            },
   });

Here he submitted to something needs to query the database on it.
I use him to achieve this function, as follows, click on the name of the side of the data dictionary to check out the database query if you can show this data. Here is my lender I cut no data to other data to go
Here Insert Picture Description
where I can see this to cut other types of payment applications can see there is a dictionary entry of data
Here Insert Picture Description

Guess you like

Origin blog.csdn.net/weixin_44486126/article/details/91359855