PDA

View Full Version : GridPanel - DirectEvents <RowBodyClick>



lu7jm
Jun 10, 2020, 12:02 AM
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>

fabricio.murta
Jun 10, 2020, 2:43 AM
Hello @lu7jm!

Would you mind wrapping code blocks within
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 (https://docs.sencha.com/extjs/7.2.0/classic/Ext.grid.Panel.html#event-rowbodyclick).

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!

lu7jm
Jun 10, 2020, 6:04 AM
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>

fabricio.murta
Jun 10, 2020, 8:47 PM
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 (https://github.com/extnet/Ext.NET/issues/1781) 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!

lu7jm
Jun 11, 2020, 7:02 AM
Thank you very much, now it works.