The 'Master' Quality DropDownList now controls all quality controls on the page + on the AddNew Series Page.

Master DropDown is now a Telerik Dropdown to fit better with the styling.
pull/2/head
Mark McDowall 14 years ago
parent 463881843e
commit 0fd9fa1e2b

@ -27,13 +27,10 @@
@Html.DisplayText("No Series to Add"); @Html.DisplayText("No Series to Add");
} }
@Html.DropDownList("masterDropbox", (SelectList) ViewData["qualities"], @Html.Telerik().DropDownList().Name("masterDropbox").BindTo((SelectList) ViewData["qualities"]).HtmlAttributes(
new {style = "width: 100px;", id = "masterDropboxId"}) new {style = "width: 100px; margin-left:5px;"}).ClientEvents(events => events.OnChange("masterChanged"))
@Html.Telerik().DropDownList().Name("tester").BindTo((SelectList) ViewData["qualities"]).HtmlAttributes( <button onclick="openAddNewSeries(); return false;" class="listButton" style="margin-left:210px">Add New</button>
new {style = "width: 100px", @class = "qualityDropbox"})
<button onclick="openAddNewSeries(); return false;" class="listButton">Add New</button>
@foreach (var path in Model) @foreach (var path in Model)
{ {
@ -47,19 +44,27 @@
var windowElement = $('#Window'); var windowElement = $('#Window');
windowElement.data('tWindow').center().open(); windowElement.data('tWindow').center().open();
}; }
function closeAddNewSeries() { function closeAddNewSeries() {
var window = $('#Window').data("tWindow"); var window = $('#Window').data("tWindow");
window.close(); window.close();
} }
function masterChanged() {
var masterQuality = $('#masterDropbox').data("tDropDownList").value();
var qualityDropbox = $(".qualityDropbox");
$("#masterDropboxId").change(function () { qualityDropbox.each(function () {
var selectedQuality = $('#masterDropboxId').get(0).selectedIndex; var child = $(this).children("[id^='qualityList']");
//$(".qualityDropbox").data("tComboBox").value(selectedQuality); var comboBox = child.data("tDropDownList");
//$(".qualityDropbox").data("tDropDownList").val(selectedQuality); comboBox.value(masterQuality);
});
var comboBox = $(".qualityDropbox").data("tDropDownList"); }
comboBox.select(selectedQuality);
}); function testValue() {
var comboBox = $('#qualityList_tester').data("tDropDownList");
comboBox.value('2');
}
</script> </script>
Loading…
Cancel
Save