我正在设立一个管理员,用户可以预订其喜欢的网页URLs,然后在文件夹中管理。
- During app load, I render a view which shows the list of folders user has created. this view is invisible on page load.
- then user navigates to his home page to see a list of urls
- from there, user can arrange the urls in folders
- user clicks the Move to folder icon in URL view
- I want to display the folderSelectorView absolute positioned below the Move to Folder icon. How can I do that?
- Also if the url has already been moved to a folder, I want a checked sign to appear in the folderSelectorView in the folder where the url has been moved to.
我应怎样做呢?
这里是我如何把文件夹在上面。
var folderColl = new FolderColl();
new FolderSelectorView({collection: folderColl});
The Code for URL view.
URLView = Backbone.View.extend({
tagName: li ,
template: _.template($( #URLTempalte ).html()),
events: {
click .FolderChange : showFolderSelector
},
initialize: function() {
_.bindAll(this, render );
},
render: function() {
return $(this.el).html(this.template(this.model.toJSON()));
},
showFolderSelector: function() {
// How should I display the view here
// view should display below the "Move to folder" icon
// Doing something like `new FolderSelectorView` is not what I m after
// since that will just re-render the view for every URL displayed
}
});