Completed
Last Updated: 26 Mar 2014 15:09 by ADMIN
ADMIN
Joana
Created on: 26 Mar 2014 07:36
Category: TileList
Type: Feature Request
0
FIX: Navigating to a page and selection should not be possible when a tile is disabled
A possible workaround is to cancel the OnClientClicking and OnClientSelecting events of the tile. Additionally, add a custom CSS class that will also enable you to apply some custom styling to disabled tiles, because most browsers do not have a disabled state for div elements. The CSS class is what is used to distinguish disabled tiles instead of the disabled attribute. NOTE: this will be fixed in the Q1 2014 SP1 release.

Here is a workaround example for RadTileList:

<script type="text/javascript">
	function preventDisabledTileClicks(tileList, args)
	{
		var tile = args.get_tile();
		if ($telerik.$(tile.get_element()).hasClass("disabledTile"))
		{
			args.set_cancel(true);
		}
	}
</script>
			
<telerik:RadTileList ID="RadTileList1" runat="server" SelectionMode="Multiple"
			OnClientTileSelecting="preventDisabledTileClicks" OnClientTileClicking="preventDisabledTileClicks">
	<Groups>
		<telerik:TileGroup>
			<telerik:RadTextTile runat="server" ID="S5_1" Text="5S">
			</telerik:RadTextTile>
			<telerik:RadTextTile runat="server" ID="OEE_2" Text="OEE" CssClass="disabledTile" Enabled="false">
			</telerik:RadTextTile>
			<telerik:RadTextTile runat="server" ID="SMED_3" Text="SMED" CssClass="disabledTile" Enabled="false">
			</telerik:RadTextTile>
			<telerik:RadTextTile runat="server" ID="VSM_4" Text="VSM" CssClass="disabledTile" Enabled="false">
			</telerik:RadTextTile>
			<telerik:RadTextTile runat="server" ID="RCM_5" Text="RCM" CssClass="disabledTile" Enabled="false">
			</telerik:RadTextTile>
			<telerik:RadTextTile runat="server" ID="TPM_6" Text="TPM" CssClass="disabledTile" Enabled="false">
			</telerik:RadTextTile>
		</telerik:TileGroup>
	</Groups>
</telerik:RadTileList>

If you are using Standalone tiles you can attach to their OnClientSelecting and OnClientClicking events. Instead of getting the tile from the event arguments, you will get it as the first argument the handler receives.
To make this more reusable, you can use ASP Themes to apply this on an application level and include the script in a common script on a master page.
0 comments