368d6fafea
Code backup
95 lines
2.9 KiB
Plaintext
95 lines
2.9 KiB
Plaintext
@page
|
|
@model webapp_local.Pages.IT.UserListModel
|
|
@{
|
|
ViewData["Title"] = "Elenco Utenti";
|
|
}
|
|
|
|
@section ToolBar {
|
|
@(Html.DevExtreme().Toolbar()
|
|
.Items(items =>
|
|
{
|
|
items.Add()
|
|
.Widget(w => w
|
|
.Button()
|
|
.Icon("menu")
|
|
.OnClick("webapp_shared.onMenuButtonClick")
|
|
)
|
|
.Location(ToolbarItemLocation.Before);
|
|
|
|
items.Add()
|
|
.Template(
|
|
@<text>
|
|
<div class="toolbar-label">
|
|
<h4 id="helpText" style="display: block; margin: 0px;"><i class='@Model.NavigationItem.Icon'></i>   @Model.NavigationItem.Text</h4>
|
|
</div>
|
|
</text>
|
|
)
|
|
.LocateInMenu(ToolbarItemLocateInMenuMode.Never)
|
|
.Location(ToolbarItemLocation.Center);
|
|
|
|
items.Add()
|
|
.Widget(w => w
|
|
.Button()
|
|
.ID("btnAutoRefresh")
|
|
.Icon("fas fa-recycle")
|
|
.Hint("Refresh dei dati")
|
|
.OnClick("reloadData")
|
|
)
|
|
.Location(ToolbarItemLocation.After);
|
|
})
|
|
)
|
|
}
|
|
|
|
<div id="mainDiv" class="justify-content-center">
|
|
@(Html.DevExtreme().DataGrid()
|
|
.ID("gridADUser")
|
|
.DataSource(d => d.RemoteController().LoadUrl(Url.Page("UserList", "ADUserData")).Key("id"))
|
|
.LoadPanel(loadPanel => loadPanel.Enabled(false))
|
|
.Scrolling(scrolling => scrolling.Mode(GridScrollingMode.Infinite))
|
|
.Sorting(sorting => sorting.Mode(GridSortingMode.None))
|
|
.Columns(c =>
|
|
{
|
|
c.Add().DataField("initials").Caption("Sigla").SortOrder(SortOrder.Asc);
|
|
c.Add().DataField("samAccountName").Caption("UserName");
|
|
c.Add().DataField("name").Caption("Nome");
|
|
})
|
|
.WordWrapEnabled(true)
|
|
.ShowBorders(true)
|
|
.FilterRow(f => f.Visible(true))
|
|
.FilterPanel(fp => fp.Visible(true))
|
|
.HeaderFilter(f => f.Visible(true))
|
|
.RemoteOperations(true)
|
|
.ColumnAutoWidth(true)
|
|
.AllowColumnResizing(true)
|
|
.CacheEnabled(true)
|
|
.RowAlternationEnabled(true)
|
|
.CustomizeColumns("customizeColumns")
|
|
)
|
|
</div>
|
|
|
|
@section scripts {
|
|
<script>
|
|
var gridADUser;
|
|
|
|
$(document).ready(function () {
|
|
gridADUser = $("#gridADUser").dxDataGrid("instance");
|
|
|
|
$(window).resize(function () {
|
|
if (gridADUser != null) {
|
|
|
|
var res = layoutdrawer.option('height') - 15;
|
|
if (res < 200)
|
|
res = 200;
|
|
|
|
gridADUser.option("height", res);
|
|
}
|
|
});
|
|
|
|
$(window).resize();
|
|
});
|
|
|
|
function reloadData() {
|
|
gridADUser.getDataSource().reload();
|
|
}
|
|
</Script>
|
|
} |