使用jquery插件的Im選擇屏蔽Html.Listbox作爲muli選擇工具。除了我需要更改默認文本外,它效果很好。我試着在html和jquery中設置佔位符文本。下面是相關代碼...選擇的佔位符值不會從默認值更改?
@Html.ListBox("Filter-Chooser",aList,new { @class = "chzn-select filter-chooser")
function EnableMultiChoose() {
$(".chzn-select").data("placeholder", "Filter By...");
$(".chzn-select").chosen();
}
我也累了指定參數@placeholder =「過濾方式......」沒有avail.I've檢查HTML輸出並顯示設定佔位符屬性...
HTML格式呈現
<select class="chzn-select filter-chooser" id="Filter-Chooser" multiple="multiple" name="Filter-Chooser" placeholder="Filter By...">
<option value="Content">Content</option>
<option value="Author">Author</option>
<option value="DeckName">Deck Name</option>
...
如何正確指定佔位任何想法?
您應該嘗試閱讀文檔。 http://harvesthq.github.com/chosen/ – Colleen
(因爲你在HTML中設置錯誤,你會看到如果你已經閱讀了文檔) – Colleen
@roasted,你在哪裏看到文檔中的? – Colleen