- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我目前正在使用jquery插件Tabledit当我使用内联编辑(如示例 3 所示)时,它会调用我的 php 页面。我不知道如何将编辑中所做的更改传递到新的 php 页面,以便我可以在数据库中更改它。当你按回车键时它会改变。 (我猜测输入后它会调用 edittask.php)
html 这里是表格的一部分。输入新文本后按 Enter 键它会发生变化。
<td class="tabledit-view-mode"> <span class=" tabledit-span ">header text</span>
<input class="tabledit-input form-control input-sm" type="text" name="description" value=" " style="display: none;" disabled="" />
</td>
javascript
$('#thetable').Tabledit({
url: 'editTask.php',
editButton: false,
deleteButton: false,
columns: {
identifier: [0, 'id'],
editable: [
[1, 'Header'],
[2, 'Description']
]
}
});
最佳答案
根据这个sample ,在您的 php 脚本中您可以使用 POST 数组中的变量。在您的情况下:$_POST['description']
和 $_POST['header']
。
我的意思是:
index.php:
<table class="table table-striped table-bordered" id="example3">
<thead>
<tr>
<th>#</th>
<th>Header</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Header 1</td>
<td>Description 1</td>
</tr>
</tbody>
</table>
<script>
$(function(){
$('#example3').Tabledit({
url: 'example.php',
editButton: false,
deleteButton: false,
hideIdentifier: true,
columns: {
identifier: [0, 'id'],
editable: [[1, 'header'], [2, 'description']]
}
});
});
</script>
示例.php:
print_r($_POST);
// Array ( [id] => 1 [header] => Header 123 [action] => edit )
// Implement your logic here...
关于javascript - 如何使用jquery-tabledit通过javascript将变量传递给ajax?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31811135/
我正在尝试使用:https://github.com/markcell/jquery-tabledit/blob/master/README.md ,并设置它以便将数据发送到表单,不幸的是它目前不包括
如何告诉 jQuery tabledit 行已更改?这些按钮仅为现有行生成,当我添加新行(例如使用 jQuery)时,表格按钮不会出现在新行中。我在 tabledit 代码中看到,可以在 View 和
我正在使用 Tabledit-jquery 来编辑表格。首先,我设置了一个标识符和多个可编辑列,按照以下方式完全可以正常工作。 https://www.webslesson.info/2017/05/
我正在使用 JQuery-Tabledit 来更新 MySQL 表。 我面临的问题是,当我更新第一列的单元格值时,第二列的相同行值消失了。 我无法弄清楚我在这里做错了什么。 这是我的 JQuery-T
在 Laravel 中,我需要将行 ID 指定为请求 URL 的一部分以便更新它,例如:http://localhost/contacts/16 问题出在使用 jQuery-Tabledit 时,因为
我正在使用 jquery tabledit更新数据库的插件。与官方示例完全一样。 我可以成功地包含一个带有固定数量选项的静态下拉列表(在 custom_table_edit.js 中定义)。 我希望能
我是一名优秀的程序员,十分优秀!