Ext.NET icon indicating copy to clipboard operation
Ext.NET copied to clipboard

broken: CustomDirectEvents.CustomDirectEvent.Target support for Ext.select()

Open fabriciomurta opened this issue 5 years ago • 0 comments

When an Ext.NET custom Direct Event has Ext.select() code, it should interpret the command, not handle it like an ID. If the "smart evaluation" implemented in Ext.NET 5 is not desired, then a means to specify a "raw target" should be provided.

In Legacy Ext.NET 5, this:

<ext:DirectEvent Target="Span1" OnEvent="UpdateTimeStamp" />
<ext:DirectEvent Target="Ext.select('div.box', true)" OnEvent="UpdateTimeStamp" />

results in:

Ext.net.on(Ext.get("Span1"), "click", function () {
    var params = arguments;
    Ext.net.DirectEvent.request({
        control: Ext.get("Span1"),
        eventType: "custom",
        action: "421899641_click"
    });
}, undefined, "ajax", {});
Ext.net.on(Ext.get(Ext.select('div.box', true)), "click", function () {
    var params = arguments;
    Ext.net.DirectEvent.request({
        control: Ext.get(Ext.select('div.box', true)),
        eventType: "custom",
        action: "104771713_click"
    });
}, undefined, "ajax", {});

In Ext.NET 7-preview3, the correspondig:

<customDirectEvent Target="Span1" pageHandler="UpdateTimeStamp" method="POST" />
<customDirectEvent Target="Ext.select('div.box', true)" pageHandler="UpdateTimeStamp" method="POST" />

results in:

Ext.net.on(Ext.get("Span1"), "click", function () {
    Ext.net.directRequest({
        action: "click",
        confirmation: {},
        control: Ext.get("Span1"),
        eventMask: {},
        eventType: "custom",
        method: "POST",
        url: "/examples/events/directevents/overview?handler=UpdateTimeStamp"
    });
}, undefined, "ajax", {});
Ext.net.on(Ext.get("Ext.select('div.box', true)"), "click", function () {
    Ext.net.directRequest({
        action: "click",
        confirmation: {},
        control: Ext.get("Ext.select('div.box', true)"),
        eventMask: {},
        eventType: "custom",
        method: "POST",
        url: "/examples/events/directevents/overview?handler=UpdateTimeStamp"
    });
}, undefined, "ajax", {});

Code exploring this issue:

Reference Ext.NET 5 code:

fabriciomurta avatar May 13 '20 07:05 fabriciomurta