PDA

View Full Version : [CLOSED] Ext.net Build Scripts with 3rd Party Controls



pgodwin
Oct 01, 2015, 12:06 AM
I'm looking at porting the Sencha wrappper for HighCharts (https://github.com/JoeKuan/Highcharts_Sencha) for use as Ext.Net controls.

Before I start writing one by hand, I am curious if the Ext.Net build scripts could be leveraged to do some of this for me? From a quick look it would seem it can parse out the ExtJS code into C# code (among other things), but am curious how flexible that is or if it's been utilised in a such a manner before?

Regards

Peter

Daniil
Oct 01, 2015, 12:51 PM
Hi Peter,

That is an interesting project you are going to deal with!


From a quick look it would seem it can parse out the ExtJS code into C# code

At some point we considered such a possibility, but it has never been implemented. Ext.NET controls are written by hand. Though, there is the Builder, Config and ConfigOptions classes within the Factory folder which are mostly generated automatically parsing Ext.NET controls.

pgodwin
Oct 06, 2015, 1:43 AM
Thanks for the reply Deniil.

I have the following collection:


private HighChartSeriesCollection series;

[ConfigOption("series", JsonMode.AlwaysArray)]
[Category("HighChart")]
[PersistenceMode(PersistenceMode.InnerProperty)]
[Meta]
public HighChartSeriesCollection Series
{
get
{
if (this.series == null)
{
this.series = new HighChartSeriesCollection();
this.series.AfterItemAdd += this.AfterItemAdd;
this.series.AfterItemRemove += this.AfterItemRemove;

}
return this.series;
}
}


I configure it as follows:

<a:HighChart runat="server" ID="Test" StoreID="storeTest">
<Series>
<a:ColumnSerie runat="server" ID="testItem" DataIndex="Value" />
</Series>
</a:HighChart>


However I get the following exception when the page loads:


[Exception: ItemTag validation (_tkn_5): Reference token (testItem_ClientInit) was not found.]
Transformer.NET.ItemTag.Validate() +215
Transformer.NET.TextTransformer.Handle() +283
Transformer.NET.TextTransformer.Transform(List`1 tokensType, Dictionary`2 variables) +65
Transformer.NET.TextTransformer.Transform(List`1 tokensType) +45
Transformer.NET.TextTransformer.Transform() +67
Ext.Net.ExtNetTransformer.Transform(String text) +225
Ext.Net.InitScriptFilter.Transform() +116
Ext.Net.InitScriptFilter.Flush() +108
System.Web.HttpWriter.FilterIntegrated(Boolean finalFiltering, IIS7WorkerRequest wr) +9653397
System.Web.HttpResponse.FilterOutput() +104
System.Web.CallFilterExecutionStep.System.Web.Http Application.IExecutionStep.Execute() +49
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +69

I've gone through the Ext.Net code but can't find a reason for this not to work. Any pointers would be appreciated.

pgodwin
Oct 06, 2015, 3:35 AM
Worked it out. Had to change [ConfigOption("series", JsonMode.AlwaysArray)] to [ConfigOption("series", typeof(ItemCollectionJsonConverter))] and a corresponding change in the ConfigOptions.

Seems obvious in hindsight.