简体   繁体   English

jQuery nestedSortable:未捕获的TypeError:无法读取未定义的属性“匹配”

[英]Jquery nestedSortable: Uncaught TypeError: Cannot read property 'match' of undefined

This is the fiddle: https://jsfiddle.net/107bx70o/3/ 这是小提琴: https : //jsfiddle.net/107bx70o/3/

var ns = $('ol.sortable').nestedSortable({
    forcePlaceholderSize: true,
    handle: 'div',
    helper: 'clone',
    items: 'li',
    opacity: .6,
    placeholder: 'placeholder',
    revert: 250,
    tabSize: 25,
    tolerance: 'pointer',
    toleranceElement: '> div',
    maxLevels: 3,
    isTree: true,
    expandOnHover: 700,
    startCollapsed: false,
    change: function() {
        console.log('change');
    },
    sort: function() {
        console.log('sort');
    },
    relocate: function() {
        console.log('relocate');
    }
});

$('#toArray').click(function(e) {
    arraied = $('ol.sortable').nestedSortable('toArray', {startDepthCount: 0});
})

When the button is clicked, you get the error. 单击该按钮时,您会收到错误消息。

I did try also last version on github: https://github.com/ilikenwf/nestedSortable 我确实在github上尝试了最后一个版本: https : //github.com/ilikenwf/nestedSortable

But error is the same. 但是错误是一样的。 My code is exactly as the Fiddle. 我的代码与小提琴完全相同。

You just missed to set ids to the li menu , 您只是错过了将li menu设置为ids的操作,

<li id="menuItem_1"> ....</li>

Here is a workin Fiddle 这是小提琴的作品

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未捕获的TypeError:无法读取未定义的属性“匹配” - Uncaught TypeError: Cannot read property 'match' of undefined 无法读取属性“匹配”(nestedSortable) - Cannot read property “match” (nestedSortable) 传单图像-未捕获的TypeError:无法读取未定义的属性“ match” - leaflet image - Uncaught TypeError: Cannot read property 'match' of undefined Morris.js未捕获TypeError:无法读取未定义的属性“匹配” - Morris.js Uncaught TypeError: Cannot read property 'match' of undefined 未捕获的类型错误:无法读取 React 中未定义的属性“匹配” - Uncaught TypeError: Cannot read property 'match' of undefined in React 未捕获的TypeError:无法读取未定义的属性“ top”(jQuery) - Uncaught TypeError: Cannot read property 'top' of undefined (jquery) jQuery Uncaught TypeError:无法读取未定义的属性“nodeType” - jQuery Uncaught TypeError: Cannot read property 'nodeType' of undefined jQuery + Coldfusion:未捕获的TypeError:无法读取未定义的属性“ 3” - jQuery + Coldfusion: Uncaught TypeError: Cannot read property '3' of undefined Jquery-timeago未捕获的TypeError:无法读取未定义的属性“替换” - Jquery-timeago Uncaught TypeError: Cannot read property 'replace' of undefined jQuery数据表错误:未被捕获的TypeError:无法读取未定义的属性“ 0” - Jquery Datatable Error : Uncaught TypeError: Cannot read property '0' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM