Click or drag to resize

ControllerStandardDataItemClassIndexItemClickToDetails Property

Option: view Index Click event on data item then calls view Details. Requirement: View Index. Default value true.

Namespace:  SOWIWeb.Helper
Assembly:  SOWIWeb.Helper (in SOWIWeb.Helper.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
protected bool IndexItemClickToDetails { get; private set; }

Property Value

Type: Boolean
Remarks
Option puts in method IndexSetViewBag

This option implemented in view partial ..\SOWIWeb\Views\Shared\_IndexContentDataTablesPartial.cshtml

Option value read from ViewBag

string lIndexItemClickToDetailsCommand = "";
if (ViewBag.IndexItemClickToDetails != null)
{
    if ((bool)ViewBag.IndexItemClickToDetails)
    {
        lIndexItemClickToDetailsCommand = " onclick=" + "DataItemDetails(this.id)";
    }
}
HTML code
<td id="@item.ID" @lIndexItemClickToDetailsCommand>@Html.Raw(lValue.ToHTMLDisplay(itemDataGrid, TempData))</td>
Javascript code: call view Details
function DataItemDetails(value) {
    var lDetailsID = document.getElementById('DetailsID');
    lDetailsID.value = value;
    window.location.href = '@Url.Action("Details")/' + value;
}
See Also