我在不同的面板中顯示陣列中的數據,用戶可以選擇從視圖中刪除面板,並將已移除的面板填充到下拉菜單中。用戶將可以靈活地選擇多個面板標題以使用所選面板重新填充頁面。從下拉列表中選擇多個項目以填充頁面
目前我能夠刪除面板 - 將它們推送到一個新的數組,並從數組中刪除面板標題填充下拉列表。
我使用的引導和角度 - 在這一刻我有正確顯示的下拉菜單,因爲它應該和不知道什麼是錯的....這裏是我的下拉HTML麻煩:
<select multiple>
<option *ngFor="let item of dropdownlist">{{item.title}}</option>
</select>
這只是顯示爲空白矩形,當我刪除面板標題中的下拉顯示出來,但現在看來似乎缺少造型
這是我怎麼想它看起來:
而且這是怎麼了我我刪除和添加面板到一個數組:
<a title="Remove Panel" (click)="removePanel(i);">
<i class="glyphicon glyphicon-remove"></i>
</a>
removePanel(index: number): void {
this.dropdownlist.push(new Object(this.items.splice(index, 1)[0]));
}
dropdownlist: Array<any> = [];
items: Array<Panel> = [
new Panel(1, 'panel 1', 'show text', 'test data in modal'),
new Panel(2, 'panel 2','show image', 'more test data'),
new Panel(3, 'panel 3', 'show graph', 'more and more data')
];
我也不能肯定我的附加功能將如何看待從下拉菜單項目,將是相反的我的removePanel函數?
謝謝,我會研究它。 – bluePearl