これは、構文に困惑している可能性が高い些細な質問のようです。
基本的に、リンクがクリックされたときに持っているBBビューをFancyBoxにロードしたいと思います。
以前は、BBルートをロードし、目的のビューとその他すべてのページにリダイレクトしていました。
$('.edit_list').show().attr('href', '#lists/' + list.id + '/edit')
私の現在の見解
app.views.GlobalListEdit = Backbone.View.extend({
tagName: "div",
className: "global_list_edit list_view",
title: 'Edit - ',
template: _.template('<div class="error"></div>' +
'<label for="global_list_edit_name">Group Name</label>' +
... truncated ...
私の現在のjquery
$('.edit_list')
.on('click', function(){
// $.fancybox({ href: '#' + '#lists/' + list.id + '/edit' });
// ^ bad idea #1 . This loads the whole other page sans the actual edit form..
// $.fancybox({ new app.views.GlobalListEdit({el: $('body')}).render() });
// ^ This psuedo code is more or less what I want. To load a new instant of the BB View.
return false;
});
だから私は探しています。
list.id
その編集呼び出しにダイナミックを渡す方法に答えます。- そのビューをレンダリングする方法。
ありがとう!