.Net Core Syntax

  1. #1

    .Net Core Syntax

    I am trying to find example to convert my below code/Syntax to new .net core that I couldn't find. I can see now Editor as 'modelEditor' property but not sure how do I set properties and Listensers with the 'modelEditor'.

    <ext:Column ID="Column16" renderer="testRenderer"  >
                                <Editor>
                                    <ext:NumberField ID="nfStandardBatchesMixed" runat="server" HideTrigger="true" KeyNavEnabled="false"
                                        SelectOnFocus="true">
                                        <Listeners>
                                            <Focus Handler="if(this.getValue() == 0)this.setValue('');" />
                                            <SpecialKey Fn="editorKeyDown" />
                                        </Listeners>
                                    </ext:NumberField>
                                </Editor>
                               
                            </ext:Column>
    Last edited by Fahd; Jun 05, 2023 at 3:18 PM. Reason: Moving code to the code block
  2. #2
    Hello, @Fahd!

    Would you mind editing your message to wrap the code block between [code][/code] tags?

    As for the actual question, I get you see the editor with editorModel in the Grid Panel > Editable > Editor with DirectMethod example, right?

    The editorModel variable is okay for simple components without many options, but as you get fancy, it may become a bit convoluted to determine all in a single quote/dblquote enclosed space.

    In the example pointed above, for instance, it is possible to add this to the code block @{ } in the top of the page:

    var editorNumberField = new NumberField();
    editorNumberField.Listeners.Focus.Handler = "if (this.getValue() == 0) this.setValue('');";
    editorNumberField.Listeners.SpecialKey.Fn = "editorKeyDown";
    Then add this to the JavaScript block in the page:

    var editorKeyDown = function(a, b, c, d) {
        Ext.toast("Key pressed in editor: " + b.keyCode);
    }
    Finally, pick one of the NumberField() editors and bind this variable, say, pctChange and make it use the custom component:

    <ext-column text="Change" dataIndex="pctChange" renderer="pctChange" editorModel="editorNumberField">
    And you should get the listeners attached to the editor.

    The editorNumberField component could also be set as a property/field in the model code (equivalent to "code behind" in Ext.NET 5), and bound to the component likewise.

    Unfortunately, at this time markup is not supported.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 3
    Last Post: Dec 07, 2020, 10:53 PM
  2. Ext.NET 7.0 Classic for ASP.NET Core Now Available
    By geoffrey.mcgill in forum 7.x Classic Premium Help
    Replies: 0
    Last Post: Oct 08, 2020, 4:37 PM
  3. Ext.NET 7.0 Classic for ASP.NET Core Now Available
    By geoffrey.mcgill in forum Open Discussions
    Replies: 0
    Last Post: Oct 08, 2020, 4:36 PM
  4. EXT.NET Core and EXT.NET 4/5
    By AnFil in forum Licensing
    Replies: 2
    Last Post: Apr 09, 2020, 6:21 AM
  5. [CLOSED] Ext Core
    By x1000 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 25, 2010, 1:04 AM

Posting Permissions