0
這似乎是一個微不足道的問題,我很可能會在語法上陷入困境。如何在FancyBox中加載BB視圖?
基本上,我想要一個FancyBox加載一個BB視圖,當我點擊一個鏈接時。
此前,它會加載一個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
傳遞給編輯打電話。 - 如何渲染該視圖。
謝謝!
我很確定他們應該讓一個Mu是太短的雕像。 – Trip
@Trip:謝謝,但「基座和任何狹小的密閉空間一樣是一座監獄。」歡迎您捐款給當地的動物收容所:) –
會做!好想法。 – Trip