3
我想返回基於用戶從下拉選擇菜單中選擇的板卡列表。獲取基於板卡的列表 - Trello API
DEMOhttp://jsfiddle.net/nNesx/1378/
我已經創建板的名單如下
var $boards = $("<select>")
.text("Loading Boards...")
.appendTo("#output");
// Output a list of all of the boards that the member
// is assigned to
Trello.get("members/me/boards", function(boards) {
$boards.empty();
$.each(boards, function(ix, board) {
$("<option>")
.attr({href: board.url, target: "trello"})
.addClass("board")
.text(board.name)
.appendTo($boards);
});
});
這給了我選擇的所有可用板下拉。
一旦用戶選擇了電路板,我希望他們看到該電路板的卡。我正在使用此代碼卡,但所有卡都出現了。
var $cards = $("<div>")
.text("Loading Boards...")
.appendTo("#outputCards");
// Output a list of all of the boards that the member
// is assigned to based on what they choose in select dropdown
Trello.get("members/me/cards", function(cards) {
$cards.empty();
$.each(cards, function(ix, card) {
$("<a>")
.attr({href: card.url, target: "trello"})
.addClass("card")
.text(card.name)
.appendTo($cards);
});
});
我不知道如何根據選擇下拉菜單顯示卡?
DEMOhttp://jsfiddle.net/nNesx/1378/