[CLOSED] Migrating from Ext.net 2.5 to Ext.net 4.1: ImageCommandColumn

  1. #1

    [CLOSED] Migrating from Ext.net 2.5 to Ext.net 4.1: ImageCommandColumn

    Hello,

    I finally decided to migrate a big application from Ext.net 2.5 to Ext.net 4.1.

    After several hours The application works but many things still are not going.

    <ext:ImageCommandColumn ID="ImageCommandColumn4" Text="" runat="server" Width="30" Resizable="false" Sortable="false" MenuDisabled="true">
        <Commands>
            <ext:ImageCommand Icon="Comment" CommandName="Comment" ToolTip-Title="Field description" ToolTip-Text="No comments about EBS row" Style="margin-left:5px !important; margin-top:2px !important; margin-bottom:2px !important;" />
        </Commands>
    
        <Listeners>
            <Command Handler="#{GridPanelEBS_Pull}.getSelectionModel().select(record.index);" />
        </Listeners>
    </ext:ImageCommandColumn>
    record.index not exist.

    Where can I find the list of parameters, for example for the Listener Command of the ImageCommandColumn object?

    thank you.
    Last edited by geoffrey.mcgill; Aug 26, 2016 at 10:58 PM.
  2. #2
    Hello @ADV!

    The best way to determine what's available for you during an event handler is adding a breakpoint to the handler. You can set the handler as just something like console.log('test'), load the page, open the resource (ext-init-js is shown in Chrome), then place the breakpoint.

    When you place the breakpoint you can already see in the generated script, the function parameters. When the script stops on the breakpoint, you can expand the local variables and explore the available information at that time.

    You can also open sources, under src/Events/Listeners/<class>.cs and find the event there. The ListenerArgument attribute shows you the arguments the listener is supposed to support.

    If still stuck, try wrapping a simple example exploring the listener and its parameters. With that simplified code, if you still can't find by yourself, share the sample and we'll run it & provide you with more accurate advice.
    Fabrício Murta
    Developer & Support Expert
  3. #3
    ok,
    please can you tell me how this code

    <Listeners>
        <Command Handler="#{GridPanelEBS_Pull}.getSelectionModel().select(record.index);" />
    </Listeners>
    works in Ext.net 4.0?

    Tks
  4. #4
    Sorry but i can not find this?

    "... open the resource (ext-init-js is shown in Chrome)..."
  5. #5
    Solved,

    new Command handler signature is (item, command, record, recordIndex, cellIndex)

    where record object is changed and have not the index property.


    New working code is :

    <Listeners>
        <Command Handler="#{GridPanelEBS_Pull}.getSelectionModel().select(recordIndex);" />
    </Listeners>
  6. #6
    Do you Need an example to answer the question:

    How do I get the record index during the command event handler of ImageCommandColumn object with ext.net 4?


    ok, I'll remember the next time!
  7. #7
    Answer:

    Use recordIndex parameter.
    Last edited by geoffrey.mcgill; Aug 26, 2016 at 10:59 PM.
  8. #8
    Hello ADV,

    The recommended way in ExtJS to find the record index is using store.indexOf(record).

    The recordIndex param works, although searching the Store by .indexOf is more "official".

    I believe record.index stopped working because Sencha considered the .index property as private or internal. They removed that property.

    The following example is a utility for searching Ext.NET components for their DirectEvent & Listener Arguments:

    https://examples4.ext.net/#/Events/Listeners/Arguments/

    Hope this helps.
    Geoffrey McGill
    Founder
  9. #9
    As always your explanations are precise and they solve the problems.

    >The recommended way in ExtJS to find the record index is using store.indexOf(record).

    Certainly I will follow your advice!


    I had not seen the very useful utility for searching Ext.NET components for their DirectEvent & Listener Arguments.

    It is exactly what I needed


    As always, thank you so much

    Alessandro

Similar Threads

  1. [CLOSED] Migrating to version 4.0
    By opendat2000 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 11, 2016, 12:07 PM
  2. Breaking changes migrating from Ext.NET v1 to v2
    By Daniil in forum Open Discussions
    Replies: 19
    Last Post: Dec 09, 2013, 6:21 AM
  3. [CLOSED] Migrating from 2.1 to 2.2 issue
    By RCM in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: May 23, 2013, 6:17 PM
  4. [CLOSED] Migrating from v1.5 to 2.0.1 differences.
    By ViDom in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 27, 2012, 1:47 PM
  5. [CLOSED] Migrating a MVC App from v1 to v2
    By RCN in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 10, 2012, 7:05 PM

Posting Permissions