dragon8002 2012-04-18 15:17
浏览 55

网格交换行并将新命令保存到mysql - 使用php和jquery

I am currently using a javascript table script called tableFilter, which works for the purpose I originally needed which was simply displaying data with the ability to filter and sort. Now I need one more function which is the ability to swap rows and save the new order to the mysql table. For example if the table is books, and the list of books is shown with a column rank and the grid is sorted on rank, if the user swaps 2 rows I want the new rank of the swapped rows to get saved to the mysql table. I looked a jqGrid and I like the look and functionality of the grid, but I do not see how they would change the rank in the grid and then save it to the database. Can someone direct me in the right direction towards a script or idea for this?

  • 写回答

1条回答 默认 最新

  • doubo82706 2012-04-18 15:29
    关注

    You will need to look for the JS plugin which allows using callback function after some user actions. Usually, it's called something like "onSuccess" or "afterSort" and is specified in the grid-plugin documentation you're going to use.

    For example, after you sort data in table, plugin will execute your function. In this function you will need to set up an AJAX request your script which will insert some data into your database.

    Unfortunately i can't recommend some plugin to you as i don't really use anything like this.

    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向