Wordpress 可供选择的2行
我正在使用FOOTABLE创建工作板。我想添加的是一个复选框选项,用于选择作业行,以便用户可以一次向多个作业发送cv。关于如何在现有表中实现这一点,您有什么想法吗? 简单的例子:Wordpress 可供选择的2行,wordpress,jquery-datatables,footable,Wordpress,Jquery Datatables,Footable,我正在使用FOOTABLE创建工作板。我想添加的是一个复选框选项,用于选择作业行,以便用户可以一次向多个作业发送cv。关于如何在现有表中实现这一点,您有什么想法吗? 简单的例子: <table class="footable toggle-arrow" data-page-size="20" > <thead> <tr> <th><!--select option id col--></th>
<table class="footable toggle-arrow" data-page-size="20" >
<thead>
<tr>
<th><!--select option id col--></th>
<th><span>Job Description</span></th>
<th><span>Area</span></th>
<th><span>Number</span></th>
<th><!--TYPE--></th>
<th><!--SEND--></th>
</tr>
</thead>
<tbody>
<tr><!---JOB-->
<td><input type="checkbox" value="id"></td>
<td>job description value</td>
<td>area value</td>
<td>job number</td>
<td data-value="4566">4566</td>
<td data-value="3"><img title="hot" src="vip.png" /></td>
<td></td>
</tr><!---END JOB-->
</tbody>
谢谢 下面是一个简单的例子,说明了一种方法:
<!DOCTYPE html>
<html>
<head>
<script data-require="jquery@*" data-semver="2.0.3" src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body>
<a id="sendSelectedButton" href="#">Send Selected</a>
<table id="theTable">
<thead>
<tr>
<th></th>
<th>Description</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="checkbox">
</td>
<td>Job 1</td>
<td><a href="#">send</a>
</td>
</tr>
<tr>
<td>
<input type="checkbox">
</td>
<td>Job 2</td>
<td><a href="#">send</a>
</td>
</tr>
<tr>
<td>
<input type="checkbox">
</td>
<td>Job 3</td>
<td><a href="#">send</a>
</td>
</tr>
</tbody>
</table>
<script>
function sendRows(rows) {
if (rows === undefined ||
rows === null ||
rows.length === 0)
return;
//Do stuff to send rows here.
}
$(document).ready(function() {
$("#sendSelectedButton").on("click", function() {
var checkRows = $("#theTable").find("tbody tr").has("input:checked");
sendRows(checkRows);
});
$("table").on("click", "tr a", function() {
var row = $(this).parents("tr");
sendRows(row);
});
});
</script>
</body>
</html>
下面是一个具有相同代码的plunk:
我没有在这里添加任何脚踏板,因为看起来脚踏板不会以任何方式影响它
我认为,随着应用程序的成熟,您会发现事情很快变得更加复杂。我建议您查看某种类型的数据绑定。我个人使用Knockout.js。即使你不决定使用Knockout.js,我认为他们的教程也很酷 你能更详细地解释一下,这样用户可以一次将简历发送到多个职位吗?什么是简历,你是如何发送的,在哪里发送的?简历是一份简历。我想要的是简化用户的流程。假设他想寄4份工作的简历。因此,我希望他能够从表4作业中选择四行,然后单击send I will(发送我将发送到其余作业)