How to get the value of a certain row of table in layui

藏色散人
Release: 2023-01-13 00:40:15
original
10376 people have browsed it

The method for layui to obtain the value of a certain row of the table: first open the corresponding code file; then use the "table.checkStatus('ID')" method to obtain the value of a certain row of the table.

How to get the value of a certain row of table in layui

The operating environment of this tutorial: Windows 7 system, layui version 2.4, Dell G3 computer.

Recommended: "javascript basic tutorial""layUI tutorial"

You can use the table.checkStatus('ID') method to obtain the table in layui The value of a certain row, where ID is the basic parameter.

[Automated rendering]

 …… 
Copy after login

[Method rendering]

table.render({ //其它参数省略
  id: 'idTest'
});
Copy after login

Call:

var checkStatus = table.checkStatus('idTest'); //idTest 即为基础参数 id 对应的值
console.log(checkStatus.data) //获取选中行的数据
console.log(checkStatus.data.length) //获取选中行数量,可作为是否有选中行的条件
console.log(checkStatus.isAll ) //表格是否全选
Copy after login

The above is the detailed content of How to get the value of a certain row of table in layui. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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 [email protected]
Latest issues
Popular Tutorials
More>
Latest downloads
More>
web effects
Website source code
Website materials
Front end template
About us Disclaimer Sitemap
PHP Chinese website:Public welfare online PHP training,Help PHP learners grow quickly!