jquery可排序ui异常
jquery sortable ui exceptions
当我快速排序/重新排列div时,出现以下错误。
TypeError: this.placeholder[0].parentNode is null
JQueryUI是API,我正在使用它:http://jqueryui.com/sortable/
$("#contents").sortable({
beforeStop: function (event, ui) {
console.log("BeforeStop Fn Invoked:Parent Node Val: " + $(ui.placeholder).parent()[0]);
if (typeof ($(ui.placeholder).parent()[0]) === 'undefined') {
console.log("If condition passed: " + ($(ui.placeholder).parent()[0]));
$("#contents").sortable('cancel');
}
console.log("BeforeStop Fn Terminates");
},
stop: function (event, ui) {
console.log("Inside Stop Function");
var op = $(this).sortable('toArray');
for (i = 0; i < result.length; i++) {
result[i] = result[i].replace('-sn', '');
}
var contents_identifier = JSON.stringify(op);
$.post(baseurl + 'index.php', {
para1: contents_identifier
},
function (data) {
fill_content_table();
});
console.log("Stop Fun Terminated'n");
}
}).disableSelection();
每当我出现上述错误时,这就是Firebug控制台打印的内容:
##################################################################
BeforeStop Fn Invoked: Parent Node Val: undefined
If condition passed: undefined
BeforeStop Fn Terminates
TypeError: this.placeholder[0].parentNode is null
我想一旦执行停止函数,就会出现异常或以上错误(因为我看不到调试语句Inside stop function)。
尝试了一些事情,比如推迟处决。但没有用。感谢您的帮助。
UPD:请注意,以下是SUCCESS情况下的控制台输出:
##################################################################
BeforeStop Fn Invoked: Parent Node Val: [object HTMLDivElement]
BeforeStop Fn Terminates
Inside Stop Function
POST https://www. 200 OK 730ms
Stop Fun Terminated
####################################################
POST https:www.........200 OK 734ms
您需要在ui.placeholder
周围加引号作为$('ui.placeholder')
相关文章:
- 有没有任何方法可以将控制器从文件加载到ui路由器$stateProvider中
- jQuery UI自动完成突然停止工作
- 如何使用skip参数使用angular ui引导进行服务器端分页
- AngularJS UI路由器不能像ng路由器那样工作
- 我可以更改剑道UI网格吗's的外键值
- 剑道UI内联编辑:如何在点击其他按钮时隐藏按钮
- Rails/JSON:如何将JSON用于jquery UI自动完成表单
- 停止jQuery UI滑块移动超过给定值
- 混合 ui-sref 和 $state.go 在 Angular ui-router 中进行状态转换
- Jquery UI自动完成无法工作
- 语义ui如何使用javascript启用或禁用下拉列表
- jquery ui滑块上的滑块值
- jQuery UI可排序-多连接列表拖动
- 如何在Angular UI网格中选择下一行
- 对具有ui typeahead的对象中的值执行orderBy
- tomcat服务器停止时UI上的异常处理
- jquery可排序ui异常
- 处理剑道UI上Java Servlet异常
- jQuery UI复选框在克隆时行为异常
- 防止jQuery UI选项卡出现异常