如何在ext.net中右键单击动态网格时添加菜单?

时间:2015-09-11 14:08:48

标签: c#-4.0 ext.net

如何在ext.net中右键单击动态网格时添加菜单?

我曾在下面尝试过在RowExpander中,显示ItemContextMenu在RowExpander中不支持,请帮帮我?

<ext:RowExpander runat="server">
                    <Loader runat="server" DirectMethod="#{DirectMethods}.GetGrid" Mode="Component">
                        <LoadMask ShowMask="true" />
                        <Params>
                            <ext:Parameter Name="RecordId" Value="this.record.getId()" Mode="Raw" />
                        </Params>   
                    </Loader>

                <DirectEvents>
                        <BeforeExpand OnEvent="BeforeExpand" Success="setRaw(response, result, el, type, action, extraParams);" Before="return !record.cached;">
                            <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="={gridRecords.body}" />

                            <ExtraParams>
                                <%--<ext:Parameter Name="company" Value="record.data['company']" Mode="Raw" />
                                <ext:Parameter Name="id" Value="record.id" Mode="Raw" />
                                <ext:Parameter Name="index" Value="rowIndex" Mode="Raw" /> --%> 
                                 <ext:Parameter Name="RecordId" Value="record.get('RecordId')" Mode="Raw" />
                            </ExtraParams>
                        </BeforeExpand>
                    </DirectEvents>
                   <Listeners>
                          <ItemContextMenu Handler="e.preventDefault(); #{mnuView}.showAt(e.getXY());" />
                    </Listeners>

                 </ext:RowExpander>

1 个答案:

答案 0 :(得分:0)

RowExpander没有ItemContextMenu事件。您应该为子GridPanel本身定义它。

这些论坛主题正在对此进行更详细的讨论: