Lock the parent (Modal=true)

  1. #1

    Lock the parent (Modal=true)

    Hi,

    In a page, I have a grid with some action. When I click in one of these, I need to lock the background. Example, In my grid I have the actions Edit and Exclude. When I click in Edit, open a new window and the background of the page have to lock (but isn't locking), the user can't realize any other action (but without the lock, the user can realize). I tried to put Modal true in the new window.....like examples of coolite, but it isn't working.

    How can I solve it?

    thank you
  2. #2
    example code? modal works for me
  3. #3
    Hi, here is an example. I'm using the version 0.8.2 and I'm using masterpages.

    <asp:Content ID="Content2" ContentPlaceHolderID="cnpConteudo" runat="Server">
        <form id="aspnetForm" runat="server">
        <%--<ext:Hidden ID="hdfIdCorrespondencia" runat="server">
        </ext:Hidden>--%>
        <ext:Store ID="strCorrespondencias" OnRefreshData="refreshGrd" runat="server">
            <Reader>
                <ext:JsonReader ReaderID="jsComentarios">
                    <Fields>
                        <ext:RecordField Name="id" />
                        <ext:RecordField Name="idUsuario" />
                        <ext:RecordField Name="descricao" />
                        <ext:RecordField Name="data" Type="Date" />
                        <ext:RecordField Name="hora" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
        <ext:Panel ID="Panel2" runat="server" ButtonAlign="Right" Height="450">
            <Body>
                <ext:BorderLayout ID="BorderLayout2" runat="server">
                    <North CMargins-Bottom="0">
                        <ext:FormPanel ID="pnlBusca" runat="server" Title="Buscas" Height="150" BodyStyle="padding: 5px;"
                            Frame="true" Collapsible="true" Icon="Magnifier">
                            <Body>
                                <ext:FormLayout ID="FormLayout6" runat="server">
                                    <ext:Anchor>
                                        <ext:TextField ID="txtBusca" runat="server" Disabled="true" FieldLabel="Nome" LabelCls="lbl100"
                                            Cls="txt250" />
                                    </ext:Anchor>
                                    <ext:Anchor>
                                        <ext:Button ID="btnBuscar" runat="server" Text="Buscar" StyleSpec="margin-left:308px;">
                                            <AjaxEvents>
                                                <Click OnEvent="buscar_click" Timeout="3600000">
                                                </Click>
                                            </AjaxEvents>
                                        </ext:Button>
                                    </ext:Anchor>
                                </ext:FormLayout>
                            </Body>
                        </ext:FormPanel>
                    </North>
                    <Center MarginsSummary="5 0 0 0">
                        <ext:Panel ID="Panel" runat="server" Icon="Email" Frame="true" Title="Lista de Correspondências">
                            <Body>
                                <ext:FitLayout ID="FitLayout1" runat="server">
                                    <ext:GridPanel ID="grdCorrespondencia" runat="server" StoreID="strCorrespondencias"
                                        StripeRows="true" TrackMouseOver="true" Height="400" AutoExpandColumn="clDescricao">
                                        <ColumnModel ID="ColumnModel2" runat="server">
                                            <Columns>
                                                <ext:Column ColumnID="clId" Header="Identificação" Hidden="true" DataIndex="id" />
                                                <ext:Column ColumnID="clDescricao" Header="Descrição" DataIndex="descricao" />
                                                <ext:Column ColumnID="clData" Header="Data" Width="70" DataIndex="data">
                                                    <Renderer Fn="Ext.util.Format.dateRenderer('d/m/Y')" />
                                                </ext:Column>
                                                <ext:Column ColumnID="clHora" Header="Hora" Width="50" DataIndex="hora" />
                                                <ext:CommandColumn ColumnID="clAcoesCorrespondencia" Width="50" Align="Center" Header="Ações">
                                                    <Commands>
                                                        <ext:GridCommand Icon="Eye" CommandName="edit" ToolTip-Text="Edit" />
                                                        <ext:GridCommand Icon="Delete" CommandName="delete"  ToolTip-Text="Delete" />
                                                    </Commands>
                                                </ext:CommandColumn>
                                            </Columns>
                                        </ColumnModel>
                                        <Listeners>
                                            <RowDblClick Handler="acao('visualizar', this.selModel.selection.record)" />
                                            <Command Handler="acao(command, record)" />
                                        </Listeners>
                                        <BottomBar>
                                            <ext:PagingToolbar ID="PagingToolBar2" runat="server" PageSize="10" StoreID="strCorrespondencias" />
                                        </BottomBar>
                                        <LoadMask ShowMask="true" />
                                    </ext:GridPanel>
                                </ext:FitLayout>
                            </Body>
                        </ext:Panel>
                    </Center>
                </ext:BorderLayout>
            </Body>
        </ext:Panel>
        <ext:Window ID="winVisualizarCorrespondencia" runat="server" Icon="Email" Title="Correspondência"
            ShowOnLoad="false" Width="425" Frame="true" AutoHeight="true" CenterOnLoad="true" Modal="true">
            <Body>
                <ext:FormPanel ID="frmVisualizarCorrespondencia" runat="server" Width="415" BodyStyle="padding:5px;">
                    <Body>
                        <ext:FormLayout ID="FormLayout4" runat="server">
                            <ext:Anchor>
                                <ext:Label ID="lblDescricao" runat="server" FieldLabel="Descrição" LabelCls="lbl120" />
                            </ext:Anchor>
                        </ext:FormLayout>
                    </Body>
                </ext:FormPanel>
            </Body>
        </ext:Window>
        </form>
    </asp:Content>
    thank you
  4. #4
    your example doesn't demonstrate how you are showing the window. I modified your example so the btnBuscar's click listener does "winVisualizarCorrespondencia.show();" and it shows a modal dialog for me.
  5. #5
    Hi,

    Sorry, didn't put how the window opens..........but basicly when the user click in the command on grid, it calls a javascript function that do the "winVisualizarCorrespondencia.show();"

    Just in this project it doesn't work. Other projects that I'm doing, the Modal true is working! I saw the other project and aren't any difference.........I don't know what is happening.

    thank you

Similar Threads

  1. Replies: 5
    Last Post: Apr 20, 2012, 6:20 AM
  2. Replies: 0
    Last Post: May 04, 2010, 7:08 AM
  3. Anchor modal window to parent frame
    By stone216 in forum 1.x Help
    Replies: 3
    Last Post: Jan 27, 2010, 2:40 PM
  4. Passing values from modal Window to parent
    By Rodriquez in forum 1.x Help
    Replies: 0
    Last Post: Oct 07, 2009, 10:21 AM
  5. Replies: 0
    Last Post: Sep 04, 2009, 3:23 PM

Posting Permissions