Disable the action button
This commit is contained in:
		@ -20,7 +20,7 @@ else
 | 
			
		||||
        </Header>
 | 
			
		||||
        <Row>
 | 
			
		||||
            <td><ActionLink Action="Edit" Parameters="@($"id=" + context.AliasId.ToString())" /></td>
 | 
			
		||||
            <td><ActionDialog Header="Delete Site" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Site?")" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteSite(context))" /></td>
 | 
			
		||||
            <td><ActionDialog Header="Delete Site" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Site?")" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteSite(context))" Disabled="sites.Count == 1" /></td>
 | 
			
		||||
            <td><a href="@(scheme + context.Name)">@context.Name</a></td>
 | 
			
		||||
        </Row>
 | 
			
		||||
    </Pager>
 | 
			
		||||
 | 
			
		||||
@ -28,7 +28,14 @@
 | 
			
		||||
}
 | 
			
		||||
@if (authorized)
 | 
			
		||||
{
 | 
			
		||||
    <button class="@Class" @onclick="DisplayModal">@Text</button>
 | 
			
		||||
    if (Disabled)
 | 
			
		||||
    {
 | 
			
		||||
        <button class="@Class" disabled @onclick="DisplayModal">@Text</button>
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
        <button class="@Class" @onclick="DisplayModal">@Text</button>
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@code {
 | 
			
		||||
@ -36,13 +43,13 @@
 | 
			
		||||
    public string Header { get; set; } // required
 | 
			
		||||
 | 
			
		||||
    [Parameter]
 | 
			
		||||
    public string Message { get; set; } // required 
 | 
			
		||||
    public string Message { get; set; } // required
 | 
			
		||||
 | 
			
		||||
    [Parameter]
 | 
			
		||||
    public string Text { get; set; } // optional - defaults to Action if not specified
 | 
			
		||||
 | 
			
		||||
    [Parameter]
 | 
			
		||||
    public string Action { get; set; } // optional 
 | 
			
		||||
    public string Action { get; set; } // optional
 | 
			
		||||
 | 
			
		||||
    [Parameter]
 | 
			
		||||
    public SecurityAccessLevel? Security { get; set; } // optional - can be used to explicitly specify SecurityAccessLevel
 | 
			
		||||
@ -50,6 +57,9 @@
 | 
			
		||||
    [Parameter]
 | 
			
		||||
    public string Class { get; set; } // optional
 | 
			
		||||
 | 
			
		||||
	[Parameter]
 | 
			
		||||
	public bool Disabled { get; set; } // optional
 | 
			
		||||
	
 | 
			
		||||
    [Parameter]
 | 
			
		||||
    public string EditMode { get; set; } // optional - specifies if a user must be in edit mode to see the action - default is true
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user