[CLOSED] Load grid when one row is select in another grid

  1. #1

    [CLOSED] Load grid when one row is select in another grid

    I have two Grid Panel in my MVC application. When the page is loaded, the two Grid Panels are loaded.
    But I need that when I selecting one row of the first grid, the second one must be reloaded.
    I tried a lot of solutions:
    1) on the client calling load/reload method of store
    2) on the client calling Ext.Ajax.request() and loadData(data) of store;
    3) on the server calling Reload method of grid
    4) others that I find on the net.

    But they doesn't works. The Controller is called, the AjaxResult is returned, but the GridPanel don't show the data.

    First Grid with a selectionModel:

    <ext:GridPanel ID="GridPanel1" runat="server" StoreID="store1" Border="false" TrackMouseOver="true" StripeRows="true" Height="150">
    <SelectionModel>
        <ext:RowSelectionModel ID="rsmFiliais" runat="server" SingleSelect="true">
            <DirectEvents>
                <RowSelect OnEvent="RowSelect">
                    <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="#{Panel16}" />
                    <ExtraParams>
                        <ext:Parameter Name="IDMaster" Value="Ext.get('Idmaster').getValue()" Mode="Raw" />          
                        <ext:Parameter Name="Lancamento" Value="this.getSelected().get('Lancamento')" Mode="Raw" />                                                                                                                                                                                                    
                    </ExtraParams>
                </RowSelect>
            </DirectEvents>
        </ext:RowSelectionModel>                                                                                           
    </SelectionModel>
    second Grid:

    <ext:GridPanel ID="GridPanel2" runat="server" StoreID="store2" Border="false" TrackMouseOver="true" StripeRows="true" Height="110">
    Last edited by Daniil; Sep 11, 2012 at 1:39 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please demonstrate the configuration of the "store2".

    A solution will mainly depend on it.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    Please demonstrate the configuration of the "store2".

    A solution will mainly depend on it.
    <ext:Store ID="store2" runat="server" AutoLoad="false">
                    <Proxy>
                        <ext:HttpProxy Url="/athenasx/LncContabilDetalhe/ObterListaPorLncContabil/" />
                    </Proxy>
                    <Reader>
                        <ext:JsonReader>
                            <Fields>
                                <ext:RecordField Name="Idmaster" />
                                <ext:RecordField Name="Codigolancamento" />
                                <ext:RecordField Name="Id" />
                                <ext:RecordField Name="Codigocontacontabil" />
                                <ext:RecordField Name="Codigocentrocusto" />
                                <ext:RecordField Name="Natureza" />
                                <ext:RecordField Name="Valor" />
                                <ext:RecordField Name="Codigocontacontrapartida" />
                                <ext:RecordField Name="Dtreg" />
                                <ext:RecordField Name="Horareg" />
                                <ext:RecordField Name="Usoreg" />
                                <ext:RecordField Name="Conciliado" />
                                <ext:RecordField Name="Historico" />
                                <ext:RecordField Name="Codigoatividade" />
                            </Fields>
                        </ext:JsonReader>
                    </Reader>
                    <BaseParams>
                        <ext:Parameter Name="limit" Value="1" Mode="Raw" />
                        <ext:Parameter Name="start" Value="0" Mode="Raw" />
                        <ext:Parameter Name="dir" Value="ASC" />
                        <ext:Parameter Name="sort" Value="Idmaster" />
                        <ext:Parameter Name="chaveprocura" Value="0" Mode="Raw" />
                        <ext:Parameter Name="Lancamento" Value="retornarLancamentoSelecionado()" Mode="Raw" />   
                        <ext:Parameter Name="Idmaster" Value="retornarIdMasterSelecionado()" Mode="Raw" />                 
                    </BaseParams>
                </ext:Store>
  4. #4
    Thank you.

    I think calling
    store2.reload();
    client side or
    store2.Reload();
    server side should work.

    Maybe, is it a layout issue? I mean is the GridPanel visible?
  5. #5
    Quote Originally Posted by Daniil View Post
    Thank you.

    I think calling
    store2.reload();
    client side or
    store2.Reload();
    server side should work.

    Maybe, is it a layout issue? I mean is the GridPanel visible?
    The Controller is called, the AjaxResult is returned, but the GridPanel don't show the rows, only columns.

    Click image for larger version. 

Name:	grid.png 
Views:	64 
Size:	78.7 KB 
ID:	4755
  6. #6
    Posting a response was really helpful to determine the problem, thank you.

    Please set
    Root="data"
    for the JsonReader.
  7. #7
    Quote Originally Posted by Daniil View Post
    Posting a response was really helpful to determine the problem, thank you.

    Please set
    Root="data"
    for the JsonReader.
    It's working. Thank you.

Similar Threads

  1. [CLOSED] Select row Grid
    By majunior in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Jun 30, 2011, 6:03 PM
  2. how to load data to grid panel in page load
    By andylaiyongsing in forum 1.x Help
    Replies: 1
    Last Post: Apr 16, 2010, 10:27 AM
  3. grid row select after rebind
    By [WP]joju in forum 1.x Help
    Replies: 3
    Last Post: Nov 24, 2009, 4:46 AM
  4. Drag from Grid to Multi Select Box
    By rthiney in forum 1.x Help
    Replies: 0
    Last Post: Jul 07, 2009, 10:45 AM
  5. Grid panel one group select all
    By anilkumar in forum 1.x Help
    Replies: 0
    Last Post: Jun 13, 2009, 4:18 AM

Posting Permissions