This method can be extended as below:
<script>
(function($){
$.extend($.fn.menu.methods, {
getItems: function(jq){
return _items(jq);
function _items(m){
var items = [];
$(m).children('.menu-item').each(function(){
var item = jq.menu('getItem', this);
if (this.submenu){
item.children = _items(this.submenu);
}
items.push(item);
});
return items;
}
}
});
})(jQuery);
</script>