Hey Telerik,
This isn't a huge thing, but I'm looking for a solution that is better than storing data inside of the AttributeCollection field.
Basically, I do this:
and then, for instance, when the user clicks a custom command on the RadDock which opens a RadWindow, I would like to populate the RadWindow with data about the RadDock.
As such, I store the fields in Attributes so that they are accessible client-side.
I find this slightly harder to maintain than I would like, though. There is no guarantee that the data being stored in the dock is current and up-to-date. I would like to be pulling the data from the RadDock's properties directly from client-side, or possibly posting an AJAX call to go fetch the data from the server on-demand.
I looked into this a bit and I read about Page Methods some. I'm not sure if this would be a better solution, though. So, I'm keeping my ears open for any other suggestions.
Just a thought :) Thanks.
Sean
This isn't a huge thing, but I'm looking for a solution that is better than storing data inside of the AttributeCollection field.
Basically, I do this:
//TODO: Make this obsolete. Somehow. Probably through thinking!public void SetAttributes(){ Logger.InfoFormat("Setting Attributes for {0}: ", ID); Attributes["RefreshEnabled"] = RefreshEnabled.ToString(); Logger.InfoFormat("RefreshEnabled: {0}: ", RefreshEnabled); Attributes["RefreshInterval"] = RefreshInterval.ToString(); Logger.InfoFormat("RefreshInterval: {0}: ", RefreshInterval); Attributes["ChartType"] = ChartType.ToString(); Logger.InfoFormat("ChartType: {0}: ", ChartType); Attributes["ReportType"] = ReportType.ToString(); Logger.InfoFormat("ReportType: {0}: ", ReportType); Attributes["TimeRestrictionEnabled"] = TimeRestrictionEnabled.ToString(); Logger.InfoFormat("TimeRestrictionEnabled: {0}: ", TimeRestrictionEnabled); Attributes["TimeStart"] = TimeStart.ToString(); Logger.InfoFormat("TimeStart: {0}: ", TimeStart); Attributes["TimeEnd"] = TimeEnd.ToString(); Logger.InfoFormat("TimeEnd: {0}: ", TimeEnd); Attributes["DataPointsEnabled"] = DataPointsEnabled.ToString(); Logger.InfoFormat("DataPointsEnabled: {0}: ", DataPointsEnabled); Attributes["ReportID"] = Chart.ReportID.ToString(); Logger.InfoFormat("ReportID: {0}: ", Chart.ReportID.ToString());}and then, for instance, when the user clicks a custom command on the RadDock which opens a RadWindow, I would like to populate the RadWindow with data about the RadDock.
As such, I store the fields in Attributes so that they are accessible client-side.
//Opens a historical report settings window -- passing the known settings to it//so that the window will show the proper data to the user.function OnHistoricalLocalSettingsShow(sender, eventArgs) { var historicalAttributes = {}; var radDockElement = radDock.get_element(); historicalAttributes["RefreshEnabled"] = radDockElement.getAttribute("RefreshEnabled"); historicalAttributes["RefreshInterval"] = radDockElement.getAttribute("RefreshInterval"); historicalAttributes["ChartType"] = radDockElement.getAttribute("ChartType"); historicalAttributes["TimeRestrictionEnabled"] = radDockElement.getAttribute("TimeRestrictionEnabled"); historicalAttributes["TimeStart"] = radDockElement.getAttribute("TimeStart"); historicalAttributes["TimeEnd"] = radDockElement.getAttribute("TimeEnd"); historicalAttributes["DataPointsEnabled"] = radDockElement.getAttribute("DataPointsEnabled"); sender.argument = historicalAttributes;}I find this slightly harder to maintain than I would like, though. There is no guarantee that the data being stored in the dock is current and up-to-date. I would like to be pulling the data from the RadDock's properties directly from client-side, or possibly posting an AJAX call to go fetch the data from the server on-demand.
I looked into this a bit and I read about Page Methods some. I'm not sure if this would be a better solution, though. So, I'm keeping my ears open for any other suggestions.
Just a thought :) Thanks.
Sean