- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用的是play 1.2.5。在我的一个 View 中,我有一个数据表,其中有一列是可编辑的。为此,我使用 jquery.dataTables.js 和 jquery.jeditable.js 插件。
现在,当我在字段中输入新值时,ajax 调用出现问题。我创建了一个应该在每次编辑行时调用的操作,但这不起作用。该操作不会被调用,有人可以看到我的错误吗?
谢谢
这是我的操作,首先我想看看它被调用了
public static void configurationChange(SendAllSysParameter para){
Logger.info( "incoming configuration change", null );
}
这是我的观点:
#{extends 'main.html' /}
#{set title:'Sendall Configuration Page' /}
#{script 'jquery.dataTables.js'/}
#{stylesheet 'demo_page.css' /}
#{stylesheet 'jquery.dataTables.css' /}
#{script 'jquery.jeditable.js' /}
<div class="pdx_std_north_panel">
<table id="table_id" class="display">
<thead>
<th>Property</th>
<th>Value</th>
</thead>
<tbody>
#{list items:paras, as:'elem' }
<tr id="${elem.sendAllKey}">
<td id="${elem_index}">${elem.sendAllKey}</td>
<td id="${elem_index}">${elem.sendAllValue}</td>
</tr>
#{/list}
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function(){
var oTable = $('#table_id').dataTable();
//alert("Test2");
var configurationChangeRoute = #{jsRoute @Application.configurationChange(':element') /};
console.log('configurationChangeRout mit jsRoute-Tag: ' + configurationChangeRoute.url);
var configurationChangeAction = #{jsAction @Application.configurationChange(':element')/};
console.log('configurationChangeAction mit jsActionTag: ' + configurationChangeAction);
//alert(configurationChangeRoute.url);
//alert(configurationChangeAction);
/* Apply the jEditable handlers to the table */
$('td:eq(1)', oTable.fnGetNodes()).editable( configurationChangeAction, {
"callback": function( sValue, y ) {
console.log('callback with svalue ' + sValue + ' and y ' + y);
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
},
"submitdata": function ( value, settings ) {
console.log('submitdata');
return {
"row_id": this.parentNode.getAttribute('id'),
"column": oTable.fnGetPosition( this )[2]
};
},
"height": "14px"
} );
还有我的模型:
package models;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import play.db.jpa.GenericModel;
import play.db.jpa.Model;
@Entity
@Table(name="SendAll_SysParameter")
public class SendAllSysParameter extends GenericModel
{
@Id
@Column(name = "sendAllKey", unique = true, nullable = false)
public String sendAllKey;
@Column(name = "sendAllValue")
public String sendAllValue;
@Column(name = "sendAllDate", nullable = false, length = 23)
public Timestamp sendAllDate;
}
最佳答案
我发现了问题,我将我的 ajax url 的路由声明为 GET,但它是 POST,所以玩时找不到它。错误日志是正确的;-)
关于jquery - Playframework 在带有 ajax 的 View 中使用 jeditable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12937680/
我使用 jEdit 作为文本编辑器,因为它是跨平台的,并且具有我需要的所有功能(Java 正则表达式、按键宏等)。但是,在新计算机上进行设置和同步设置(键盘绑定(bind)、文件保存选项等)很痛苦。
当 Isabelle 在 ProofGeneral 中显示目标时,假设被呈现为在它们周围有括号,如下所示: 然而,在 Isabelle/jEdit 中,这似乎已更改为元蕴涵箭头: 虽然我知道前者有点不
我使用 jedit 已有几年了。我以服务器模式安装了它(不是最近),以便每次操作系统启动时 jedit-server 都会启动。 我使用的是 windows 7 和 java 1.8.0_111,最近
假设我有一个目录 isabelle_afp存储了很多理论的地方。该目录是一个库,我不打算更改其中的文件。我想加快 Isabelle/jEdit 的启动时间(默认情况下,isabelle_afp 我当前
我正在使用 JEdit 和 JDiff 插件进行文件比较。现在我想使用命令行参数从另一个工具打开 JDiff 插件。这可能吗?到目前为止,我只能在 JEdit 中打开要比较的 2 个文件。 最佳答案
我正在使用 jeditable 插件来使某些值可编辑。我注意到当一个值为空时,会出现我不想要的默认文本“单击顶部编辑”。但我仍然想让该字段也可编辑。如何管理? 我在 http://www.datata
我有一张表格,上面有几行数据。我希望通过单击行本身或编辑按钮来编辑该行的大部分内容。 假设我有一张列出产品的表格: 产品名称 品牌 模型 价格 我可以通过使用 jQuery 和 jEditable 来
我有一个由jeditable更新的字段。如果要减小值(这会导致数据丢失),但如果要增加值,我想在提交更新之前输出警告消息。 这似乎是jeditable的onsubmit函数的不错选择,我可以很高兴地触
我正在使用Jeditable用于就地编辑。我正在使用的控件之一具有 select 类型。当用户单击该字段时,将生成以下选择控件: Active
这是我使用 jEditable 将选择下拉列表添加到表行的代码: $('tr',this).find('td:eq(8)').css('cursor','pointer') .editable
jeditble 上是否有任何选项,因此当我双击文本并弹出文本框时,它会突出显示所有文本 最佳答案 使用选择参数。 True 表示选择(突出显示全部)。假则相反。 $(".editable").edi
当我单击编辑某些文本时,Jeditable 会在文本区域中的实际文本周围插入额外的空格。我如何修剪这个或实际修复这个? 最佳答案 您实际上可以只传递一个函数来修剪您要编辑的字符串。在您的设置中使用它:
在决定要做什么之前,我如何检查页面返回的内容? 例如,如果页面返回404,超时或我自己的消息,我希望能够向用户显示一条错误消息,并将该值恢复为原始值,而不是在该值上打印页面返回的内容被编辑。 提前。
当我在编辑单元格值后在表格单元格中使用 jeditable 时,单元格的值会随着来自服务器的值而更改: 我的意思是细胞是 old Value 我编辑它,服务器返回“新值” jeditable 将此值插
我试图弄清楚如何使用 1 个编辑按钮编辑具有特定类的所有区域。 这是我的 JS:我将它放入一个函数中以便再次使用。我有一个周围的 div,里面有包含“详细信息”类的跨度 如何创建 1 个“编辑”按钮并
我成功地使用 jeditable 通过函数提交jQuery.ajax 和 async: false 选项,但遇到问题如果返回错误则中止。 如何让编辑框保持激活状态和/或恢复到原值是否有错误?我正在返回
好吧,对于 jeditable 来说是全新的, 假设我有一些的和使用 PHP 动态生成的项目如下: fetch_assoc($query)) : ?> " 这让我说......这个
我一直在使用 JQuery 的 JEditable 插件,我想向插件返回错误以指示它恢复到以前的值并向用户显示错误。我使用同步 ajax 调用来完成此工作,但我更喜欢使用异步回调。我到目前为止的代码如
我正在按照教程制作简单的网络应用程序,并且我正在使用 jeditable 进行就地编辑。 一切正常,除了新值没有保存到数据库中。 mysql 日志让我相信“listItemID”没有通过,因为它显示了
我正在使用 var retval = value.replace(//gi, '\n'); 剥离来自 textarea 和 nl2br('$_POST('newValueHere')') 的标签插入我
我是一名优秀的程序员,十分优秀!