[CLOSED] Possible values of listeners

  1. #1

    [CLOSED] Possible values of listeners

    Hello!

    For an example:

    <ext:Portal ID="Portal1" runat="server">
        <DirectEvents>
            <Drop OnEvent="Portal1_Drop">
                <ExtraParams>
                    <ext:Parameter Name="ID" Value="e.panel.id" Mode="Raw" />
                    <ext:Parameter Name="ColumnIndex" Value="e.columnIndex" Mode="Raw" />
                    <ext:Parameter Name="Position" Value="e.position" Mode="Raw" />
                </ExtraParams>
            </Drop>
    	</DirectEvents>
    </ext:Portal>
    "e.panel.id","e.columnIndex" and "e.position" are some of the possible values. Where can i find all possible values of all component's events? There is a documentation about it?

    Thanks!
    Last edited by fabricio.murta; Jun 19, 2017 at 8:29 PM.
  2. #2
    Hello @banrisulssw!

    Well, you caught exactly a component that does not have much documentation about itself. It is not a very long component though, defined in roughly 300 lines. Best way to know what's exported as parameters to the events is actually using a Listener instead of a direct event (during the probe stage) and calling a method with a breakpoint in it.

    Here's what I do when I'm in a hurry (don't want to browse thru Sencha docs when available, for example):

    1. Draw the component, the simplest the possible:

    <%@ Page Language="C#" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form runat="server" id="fm1">
        <div>
            <ext:ResourceManager runat="server" SourceFormatting="true" ScriptMode="Debug" />
    
            <ext:Portal ID="Portal1" runat="server">
                <Listeners>
                    <Drop Handler="console.log('add a breakpoint here');" />
                </Listeners>
            </ext:Portal>
        </div>
        </form>
    </body>
    </html>
    Notice I used some different settings on ResourceManager to improve reading the results.

    2. Run/open the page, then check the resulting JavaScript using your browser's debugging tools
    Click image for larger version. 

Name:	61930-portalListenerJSCode.png 
Views:	28 
Size:	42.1 KB 
ID:	24957

    3. Add a breakpoint in the console.log line. In IE development tools you can move the cursor over the function and hit F9, in Chrome sometimes you have to click the lower-left curly brackets ({}) button to split the lines before you can actually add a breakpoint to that line.

    4. Trigger the event, having the breakpoint stop there. You probably have to change the example above in order to add droppable content to the portal. If in doubt, base the further code from our portal example.

    5. Switch to debugging tools' console tab/window, and experiment with the parameters exposed.

    This may look like a cumbersome solution, but in many times it is the best way to know what's exposed to an event, even from the most well documented components in Sencha docs.

    Of course, another source of documentation for the component is the code itself. The portal client-side code is available, from source code, the directory src/Build/Ext.Net/ux/portal/portal-debug.js. If you look at the code, you'll notice that the 'drop' event is specially particular to the component, and probably the approach above to probe the actual event object properties would be best way to query what's there.

    By looking at the portal-debug.js code also, you'll notice that it is an extension of the Ext.panel.Panel component (Ext.NET.AbstractPanel), so many things inside are inherited from the Panel and will be on the Sencha panel's documentation.

    But again, the Drop event is specific to the Portal, so better off with the step-by above to infer what's available to the event object at run time.

    Something that may help (but the step-thru above already covers) is getting what parameter an event has. We have an example which just shows you the prototype of any event to any component: Event Listeners' Arguments.

    Well, this is far from the best option but I hope this helps you get thru the Portal events smoothly. That's a very specific case of a component that has been added to Ext.NET since version 1 (~2010).
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello again @banrisulssw!

    It's been some days since we replied your inquiry here and still no feedback from you, do you need more assistance with this? We may be marking this thread as closed if we receive no feedback from you within 7+ days. Anyway, this won't prevent you from posting a feedback when you are able to.
    Fabrício Murta
    Developer & Support Expert
  4. #4
    Hello, Murta,

    Well, this solution works, but we know that is not the best solution.
    We have several cases where we need to send objects from client side to server to process data. This solution causes a large amount of work what is not productive.
    I hope in the future we be able to have a better documentation to consult, improving the development time and simplify our work.
    You can close this thread because there's nothing more to discuss about it.

    Thanks,

    Bruno Crivelatti
  5. #5
    Hello Bruno!

    Thanks for your feedback! As we review components like this, we're also adding online documentation to them. And new components, we're making it a priority to not add them without proper documentation (at least as far as Visual Studio's Intellisense is concerned).
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 10
    Last Post: Sep 20, 2017, 2:31 AM
  2. [CLOSED] GridPanel Editor Listeners Not Fired and Values Not Passed
    By Alaswad in forum 3.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 20, 2016, 6:49 PM
  3. Form field values don't get new values
    By Rtrojack in forum 2.x Help
    Replies: 1
    Last Post: Nov 14, 2015, 8:35 AM
  4. Replies: 9
    Last Post: Mar 13, 2014, 3:30 PM
  5. Replies: 3
    Last Post: Dec 21, 2012, 10:53 AM

Posting Permissions