I am trying to use the RadLiveTiles to display data from an oDataDataSource. If I create a different data source for each tile and set the OnClientDataLoading to a different function that sets the filter with the correct parameters for each tile everything works fine.
Since I will have many tiles I found this in your documentation
"Another option is to change the filter in the OnClientDataLoading event, because the event arguments expose the data source arguments. Essentially, the logic is the same, but you can apply filters per LiveTile (e.g., by using different OnClientDataLoading event handlers, see Example 8) and use the same ODataDataSource control."
However when I try this it is not working. The first tile works fine, but when the 2nd fires, it first calls the first over again, then the second, and the data returned is from the first. When the 3rd tile fires it again calls the 1st, then the 2nd then the 3rd and the data is the first when first initialized. When the first update interval occurs all tiles refresh at the same time, again with the data all being from the first tile
This is the code I am using
<script type="text/javascript">
function OnClientDataLoading(sender, args) {
alert("1")
args.get_value().filter.filters.push({
field: "MasterID",
operator: "eq",
value: 32
});
}
function OnClientDataLoading1(sender, args) {
alert("2")
args.get_value().filter.filters.push({
field: "MasterID",
operator: "eq",
value: 64
});
}
function OnClientDataLoading2(sender, args) {
alert("3")
args.get_value().filter.filters.push({
field: "MasterID",
operator: "eq",
value: 44
});
}
</script>
<form id="form1" runat="server">
<div>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableTheming="True" />
</div>
<div>
<telerik:RadODataDataSource runat="server" ID="RadODataDataSource1">
<Transport Read-DataType="JSONP">
<Read Url="http://xxxxxx.com/tService1/TileService.svc/" />
</Transport>
<Schema>
<telerik:DataModel ModelID="opItemLiveTileData" Set="opItemLiveTileDatas">
<telerik:DataModelField FieldName="MasterID" />
<telerik:DataModelField FieldName="nOrders" />
</telerik:DataModel>
</Schema>
</telerik:RadODataDataSource>
<telerik:RadTileList runat="server" ID="RadTileList2" TileRows="4" Width="1300px" SelectionMode="Single" EnableDragAndDrop="false" BackColor="teal" AutoPostBack="false" >
<Groups>
<telerik:TileGroup>
<telerik:RadLiveTile ID="RadLiveTile3" runat="server" ODataDataSourceID="RadODataDataSource1" DataModelID="opItemLiveTileData" UpdateInterval="6000" OnClientDataLoading="OnClientDataLoading" AutoPostBack="false">
<ClientTemplate>
<strong>Loaded from ODataDataSource: </strong><br />
#= MasterID # <br></br> #= nOrders # <br></br>
</ClientTemplate>
</telerik:RadLiveTile>
<telerik:RadLiveTile ID="RadLiveTile1" runat="server" ODataDataSourceID="RadODataDataSource1" DataModelID="opItemLiveTileData" UpdateInterval="9000" OnClientDataLoading="OnClientDataLoading1" AutoPostBack="false">
<ClientTemplate>
<strong>Loaded from ODataDataSource: </strong><br />
#= MasterID # <br></br> #= nOrders # <br></br>
</ClientTemplate>
</telerik:RadLiveTile>
<telerik:RadLiveTile ID="RadLiveTile2" runat="server" ODataDataSourceID="RadODataDataSource1" DataModelID="opItemLiveTileData" UpdateInterval="11000" OnClientDataLoading="OnClientDataLoading2" AutoPostBack="false">
<ClientTemplate>
<strong>Loaded from ODataDataSource: </strong><br />
#= MasterID # <br></br> #= nOrders # <br></br>
</ClientTemplate>
</telerik:RadLiveTile>
</telerik:TileGroup>
</Groups>
</telerik:RadTileList>
<script type="text/javascript">
</script>
</div>
</form>
Any help would be greatly appreciated as my only alternative is to create a datasource for each tile.