71 lines
2.5 KiB
Plaintext
71 lines
2.5 KiB
Plaintext
@model IEnumerable<StockManMVC.Models.Location>
|
|
|
|
@{
|
|
ViewBag.Title = "Configurazione Posizioni";
|
|
}
|
|
|
|
<div class="row" style="margin-top: 0.5em;">
|
|
<div class="col-xs-12">
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<div class="row">
|
|
<div class="col-xs-2">
|
|
<strong>Configurazione Posizioni</strong>
|
|
</div>
|
|
<div class="col-xs-6">
|
|
@Html.DropDownList("LocTypeID", null, "-- TUTTI --", htmlAttributes: new { @class = "form-control" })
|
|
</div>
|
|
<div class="col-xs-4 text-right">
|
|
<button class="btn btn-sm btn-success" title="Aggiunta nuova Posizione" onclick="LoadCreateNew();"><i class="glyphicon glyphicon-plus" aria-hidden="true"></i> Aggiunta Posizione</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="panel-body small">
|
|
<div id="mainDiv" class="col-xs-12">
|
|
@Html.Action("ListByType", new { LocTypeID = @ViewBag.LocTypeSel })
|
|
</div>
|
|
<div class="col-xs-6">
|
|
<div class="" id="divChild">
|
|
@*qui inserisco la partial view...*@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
function refreshSelectedData() {
|
|
var LocTypeID = $("#LocTypeID").val();
|
|
$("#mainDiv").load('@(Url.Action("ListByType", "Locations", null, Request.Url.Scheme))?LocTypeID=' + LocTypeID);
|
|
|
|
// modifico URL!
|
|
history.replaceState('LocTypeID=' + LocTypeID, 'Locations', '?LocTypeID=' + LocTypeID)
|
|
}
|
|
$(document).ready(function () {
|
|
$("#LocTypeID").change(function () {
|
|
refreshSelectedData();
|
|
});
|
|
});
|
|
|
|
function LoadCreateNew() {
|
|
reduceMainDiv();
|
|
$("#divChild").load('@(Url.Action("Create", "Locations", null, Request.Url.Scheme))?mode=std');
|
|
}
|
|
|
|
function LoadCurrEdit(ID) {
|
|
reduceMainDiv();
|
|
$("#divChild").load('@(Url.Action("Edit", "Locations", null, Request.Url.Scheme))/' + ID + '?mode=std');
|
|
}
|
|
function LoadCurrDelete(ID) {
|
|
reduceMainDiv();
|
|
$("#divChild").load('@(Url.Action("Delete", "Locations", null, Request.Url.Scheme))/' + ID + '?mode=std');
|
|
}
|
|
|
|
function reduceMainDiv() {
|
|
$("#mainDiv").removeClass("col-xs-12");
|
|
$("#mainDiv").addClass("col-xs-6");
|
|
}
|
|
|
|
</script>
|