PDA

View Full Version : [CLOSED] Callout change in SVN causes code break



jpadgett
Sep 29, 2014, 4:34 PM
I have a callout on a grid that loads a widget on hover. I was able to use the following code to pass a record id in to the Show direct event, using the lib that installed with nuget for MVC5 version 2.5.2.



de.Show.ExtraParams.Add(new Parameter()
{
Name = "packageId",
Value = "this.triggerElement.dom.parentNode.dataset.recordi d",
Mode = ParameterMode.Raw
});


I recently updated the dll's with the version from SVN (revision 5999) to fix a different issue. Now, the param code does not work, as dataset is no longer a property on parentNode.

Was this change done on purpose? I just want to make sure that the new change is going to be permanent - otherwise, getting the recordid in the original way was more efficient.

Daniil
Sep 30, 2014, 12:31 PM
Hi @jpadgett,

Please clarify is that a ToolTip you deal with?

Could you, please, provide a test case? I would test in both the versions and investigate in details.

jpadgett
Oct 01, 2014, 3:00 PM
Sorry - here is more of the code. Line 80 is the code that was working previously.



Html.X().GridPanel()
.ID("GridPanel1")
.Title("Grid")
.ForceFit(true)
.Resizable(false)
.Store(
Html.X().Store()
.ID("Store1")
.PageSize(20)
.DataSource(Model.PackageList)
.Model(
Html.X().Model()
.IDProperty("PackageId")
.Fields("PackageId",
"FirstName",
"LastName",
"IsSent")
)
.ServerProxy(
Html.X().AjaxProxy()
.Url(Url.Action("LoadGrid", "Distribution", new { area = "Report", id = Model.DistributionId }))
)
)
.ColumnModel(
Html.X().Column().DataIndex("FirstName").Text("First Name"),
Html.X().Column().DataIndex("LastName").Text("LastName"),
Html.X().Column()
.DataIndex("IsSent")
.ItemID("ColumnIsSent")
.Text("Status")
.Width(30)
.Renderer(new Renderer() { Fn = "statusColumnRenderer" })
)
.SelectionModel(
Html.X().RowSelectionModel()
.ID("RowSelectionModel1")
.Mode(SelectionMode.Simple)
)
.View(
Html.X().GridView().TrackOver(false)
)
.Callouts(cos =>
{
cos.Add(
Html.X().Callout()
.Title("Sends")
.Icon(Icon.EmailGo)
.Trigger(CalloutTrigger.Hover)
.Alignment(AnchorPoint.Left)
.Delegate(".x-grid-cell-ColumnIsSent")
.BodyStyle("padding:1px;")
.BodyWidget(bw =>
{
bw.Add(
Html.X().GridPanel()
.ID("GridPanelSends")
.Header(false)
.ForceFit(true)
.Width(250)
.Store(
Html.X().StoreFor(m => m.DistributionPackageSends)
.ID("StoreSends")
)
.ColumnModel(
Html.X().Column().DataIndex("Sender").Text("Sender").Width(80),
Html.X().DateColumn().DataIndex("Timestamp").Text("Timestamp").Format("MM/dd/yyyy hh:mm:ss tt")
)
);
})
.DirectEvents(de =>
{
de.Show.Action = "LoadSends";
de.Show.EventMask.ShowMask = true;
de.Show.EventMask.Msg = "Loading...";
de.Show.EventMask.Target = MaskTarget.CustomTarget;
de.Show.EventMask.CustomTarget = "GridPanelSends";
de.Show.ExtraParams.Add(new Parameter()
{
Name = "packageId",
Value = "this.triggerElement.dom.parentNode.dataset.recordi d",
Mode = ParameterMode.Raw
});
})
.Listeners(l =>
{
l.BeforeShow.Handler = "return this.calloutOwner.view.getRecord(this.triggerEleme nt.dom.parentNode).data.IsSent;";
})
);
})


I have changed to the code to


Value = "this.calloutOwner.view.getRecord(this.triggerEleme nt.dom.parentNode).data.PackageId",

and it works fine. But I was a little concerned that the property, and resulting functionality, was removed. I was lucky to have been testing the particular page, otherwise, the breakage in my page's functionality would've gone into production.

Daniil
Oct 02, 2014, 12:06 PM
Unfortunately, I cannot run the code that you posted.

Do you mean that the "dataset" property has been removed? It is a DOM property. I guess it comes from ExtJS, but it is unlikely that it is in ExtJS API. So, I would not rely on that.