0
我有categories
其中有許多products
和一個窗體顯示下拉菜單。一旦Category
被選中,Product
下拉列表中的值將被過濾,以便只顯示屬於category
的products
。這工作正常,直到用戶將selectedProduct
下拉列表設置爲特定值。從控制器設置表格的值
我怎麼能重置selectedProduct
下拉到All Products
如果用戶點擊一個不同的Category
他在Product
點擊後?
應用/模板/ index.hbs
{{view "select" prompt="All Categories"
content=filteredCategories
optionLabelPath="content.name"
optionValuePath="content.name"
value=selectedCategory}}
{{view "select" prompt="All Products"
content=filteredProducts
optionLabelPath="content.name"
optionValuePath="content.name"
value=selectedProduct}}