Apr 12, 2017, 3:41 PM
[CLOSED] relay events usage example
Hello All
I have a situation whereI want to use the relay events functionality extjs docs from store to its Chart. what am I missing here:
I have a situation whereI want to use the relay events functionality extjs docs from store to its Chart. what am I missing here:
@(X.Panel()
.Width(800)
.Height(600)
.Layout("fit")
.TopBar(X.Toolbar()
.Items(
X.ToolbarFill(),
X.Button()
.Text("Reload Data")
.Icon(Icon.ArrowRefresh)
.Handler("App.Store1.reload();"),
X.Button()
.Text("Save Chart")
.Icon(Icon.Disk)
.Handler("saveChart")
)
)
.Items(X.CartesianChart().ID("smo")
.Store(X.Store()
.ID("Store1")
.Data(Model)
.Model(X.Model().Fields("Name", "Data1"))
.ServerProxy(X.AjaxProxy().Url(Url.Action("GetData")))
.Listeners(l=>l.Load.Handler="console.log('store loadedwith number of items:'+store.data.items.length);")
)
.RelayEvents("this.getStore()", new []{"load"}).On("load",new JFunction("console.log('relayed store load with number of items:'+store.data.items.length);"))
.Axes(
X.NumericAxis()
.Position(Position.Left)
.Fields("Data1")
.Grid(true)
.Title("Number of Hits")
.Minimum(0),
X.CategoryAxis()
.Position(Position.Bottom)
.Fields("Name")
.Title("Month of the Year")
.Label(X.ChartLabel().RotationDegrees(-45))
)
.Series(X.BarSeries()
.Highlight(true)
.XField("Name")
.YField("Data1")
)
)
)
This is the same example as http://mvc.ext.net/#/Chart_Column/Basic/ just copy and paste this portion.
Last edited by fabricio.murta; Apr 13, 2017 at 5:16 PM.