GridPanel - DirectEvents <RowBodyClick>

  1. #1

    GridPanel - DirectEvents <RowBodyClick>

    I'm testing the <directEvents> in a <ext-window> and it worked fine, but when it doesn't work in the <ext-gridPanel>, I could submit some examples and include the Grouping properties for the columns. I have spent many hours running different tests but cannot get it to work.


    Is there documentation available for this new version?


    Thanks for your help.


    Sample:


    <ext-gridpanel id="MyGrid" title="Test" height="400" allowDeselect="true" simpleSelect="true" region="Center">
        <store>
            <ext-store id="MyStore">
                <fields>
                    <ext-stringDataField name="Field1" />
                    <ext-stringDataField name="Field2" />
                    <ext-numberDataField name="Field3" />
                </fields>
            </ext-store>
        </store>
        <columns>
            <ext-column text="Field1" dataIndex="Field1" align="Center" width="40" />
            <ext-column text="Field2" dataIndex="Field2" width="200" flex="1" />
            <ext-column text="Field3" dataIndex="Field3" align="Center" width="50" />
        </columns>
        <directEvents>
            <rowBodyClick url="GetDetails"  before="alert('Row Click');" success="loadDetails" />
        </directEvents>
    </ext-gridpanel>
    Last edited by geoffrey.mcgill; Jun 10, 2020 at 1:10 PM.
  2. #2
    Hello @lu7jm!

    Would you mind wrapping code blocks within [code][/code] tags? You can edit your post above and add the tags.

    Ext.NET 7 is very high fidelity with Ext JS API, so at any time you'd have full documentation from Ext JS framework. Ext.NET 7 preview4 employs Ext JS 7.2.0 (like Ext.NET 5.2.0) and Sencha, the makers of the JavaScript / client-side framework host their documentation online (with an option to download for offline access).

    For a start, here is the documentation on GridPanel's RowBodyClick event.

    In the documentation entry linked above there will be the explanation for why the event is not triggered (requires additional features enabled to the grid).

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    For the <rowBodyClick> event to work, the <features> property must be initialized but I have tried as follows and it doesn't work either, could you help me with one example?


    Thanks.


    Sample:
    <ext-gridpanel id="MyGrid" title="Test" height="400" allowDeselect="true" simpleSelect="true" region="Center">
        <store>
            <ext-store id="MyStore">
                <fields>
                    <ext-stringDataField name="Field1" />
                    <ext-stringDataField name="Field2" />
                    <ext-numberDataField name="Field3" />
                </fields>
            </ext-store>
        </store>
        <columns>
            <ext-column text="Field1" dataIndex="Field1" align="Center" width="40" />
            <ext-column text="Field2" dataIndex="Field2" width="200" flex="1" />
            <ext-column text="Field3" dataIndex="Field3" align="Center" width="50" />
        </columns>
    
    
       <features>
            <RowBody />
        </features>
    
    
        <directEvents>
            <rowBodyClick url="GetDetails"  before="alert('Row Click');" success="loadDetails" />
        </directEvents>
    </ext-gridpanel>
    Last edited by geoffrey.mcgill; Jun 10, 2020 at 1:09 PM.
  4. #4
    Hello @lu7jm!

    Yes, the <feature> block is still not supported in the grid panel, so that won't work for now.

    I have realized it is currently exported in Ext.NET 7 as a property and the intellisense suggestions are really misleading, so I have logged an issue in github for us to better expand on that feature that might need some work until it is fully usable.

    We logged it under #1781 on GitHub and will post a follow-up here as soon as we get some feedback about the feature (proper documentation on how to use, a fix, etc).

    You can attain the same behavior though, if you set the grid's view rowClick event to that grid.

    For that, just add a viewConfig block in your grid as follows:

    <viewConfig>
        <ext-tableView>
            <listeners>
                <rowClick handler="Ext.toast('Row body click.')" />
            </listeners>
        </ext-tableView>
    </viewConfig>
    Anyway, the Features block should work for this and other functionality it enables in Grid Panels, and we will definitely review it.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Thank you very much, now it works.

Similar Threads

  1. [CLOSED] DirectEvents : DirectEvents.Click.Before Wait message always show
    By matrixwebtech in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 27, 2015, 5:08 PM
  2. DirectEvents not firering - gridPanel
    By brunweb in forum 2.x Help
    Replies: 6
    Last Post: Mar 21, 2014, 4:03 PM
  3. Replies: 10
    Last Post: Jan 30, 2014, 11:42 PM
  4. [CLOSED] GridPanel DirectEvents
    By thchuong in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 21, 2013, 2:12 PM
  5. Help with GridPanel DirectEvents
    By sleong in forum 1.x Help
    Replies: 0
    Last Post: Sep 29, 2011, 6:39 PM

Posting Permissions