0

I am developing a site where admins can log in and then view the database tables for various clients registered on the site. These admins should then be able to edit these values on the page that they're viewing it.

Is there a way that I can implement it so that they can simply click on the value that they want to edit, and then it will automatically update in the database? They shouldn't be redirected to a different page. It should be similar to phpmyadmin's inline editing.

I've tried to work with Editable Grid, but with very little documentation it is very difficult for me to understand how I can implement it correctly.

4

2 回答 2

3

您需要实现一个 AJAX 解决方案来完成此操作。Mozilla 的文档很好地概述了如何使用它:

参考https ://developer.mozilla.org/en-US/docs/AJAX

$.ajax使用 jQuery,您可以通过调用轻松发送数据:

$.ajax({
  type: "POST",
  url: "insert_into_database.php",
  data: { name: "Foo", location: "bar" }
}).done(function( msg ) {
  alert( "Data Saved: " + msg );
});
于 2012-09-25T22:33:12.800 回答
0

如果您正在寻找一个好的库来完成此任务,那么我建议您将类似http://www.sprymedia.co.uk/article/KeyTable的东西与 jQuery 和 Ajax 一起使用。KeyTable 库提供了非常好的行编辑。

于 2012-09-25T22:37:16.287 回答