[CLOSED] GridPanel get rowID in extraParameters

  1. #1

    [CLOSED] GridPanel get rowID in extraParameters

    Hi,

    code below stop worked there is no such a thing like rowIndex anymore in v2.0

    <%-- outside gridpanel --%>
    <ext:Hidden runat="server" ID="ScrollStore" />
    
    <%-- inside gridpanel--%>
    <DirectEvents>
                            <ItemDblClick Before="#{ScrollStore}.setValue(this.view.scroller.dom.scrollTop);"
                                OnEvent="OnRowDblClick_GridPanelMain">
                                <ExtraParams>
                                    <ext:Parameter Name="grow" Value="this.store.getAt(rowIndex).data['Id']" Mode="Raw" />
                                </ExtraParams>
                                <EventMask ShowMask="true" Msg="Proszę poczekać ..." />
                            </ItemDblClick>
                        </DirectEvents>
    here is related answer from Vlad : http://forums.ext.net/showthread.php...ion-in-Ext-NET

    What's the new variable equivalent to old rowIndex?
    And this.view.scroller is undefined - javascript error
    What sencha v is now used with ext.net v2.0?

    Thanks,
    ViDom
    Last edited by Daniil; Oct 09, 2012 at 11:36 AM. Reason: [CLOSED]
  2. #2
    Hi ViDom,

    Please use:
    <ext:Parameter Name="grow" Value="record.get('Id')" Mode="Raw" />
    Or this
    record.getId()
    if you set IDProperty to "Id" for the Reader.

    What sencha v is now used with ext.net v2.0?
    v2.1 uses ExtJS 4.1.2.
    http://docs.sencha.com/ext-js/4-1/
  3. #3
    Please use:
    <ext:Parameter Name="grow" Value="record.get('Id')" Mode="Raw" />
    Or this
    record.getId()
    if you set IDProperty to "Id" for the Reader.
    Your code generate javascript error

    I've figured out it for my own here's what working:
          <ext:Parameter Name="grow" Value="this.store.getAt(index).data['Id']" Mode="Raw" />
  4. #4
    I am unable to reproduce. The following example works well on my side.

    Do you use v2.0 or the last sources from SVN in the 2.1 branch? If first, we would highly recommend to upgrade from the 2.1 branch.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Store store = this.GridPanel1.GetStore();
                store.DataSource = new object[] 
                { 
                    new object[] { "Id1" },
                    new object[] { "Id2" },
                    new object[] { "Id3" },
                };
                store.DataBind();
            }
        }
    
        protected void ItemDblClick(object sender, DirectEventArgs e)
        {
            X.Msg.Alert("ItemDblClick", e.ExtraParams["grow"]).Show();
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
    
        <ext:GridPanel ID="GridPanel1" runat="server">
            <Store>
                <ext:Store runat="server">
                    <Model>
                        <ext:Model runat="server">
                            <Fields>
                                <ext:ModelField Name="Id" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column runat="server" Text="Id" DataIndex="Id" />
                </Columns>
            </ColumnModel>
            <DirectEvents>
                <ItemDblClick OnEvent="ItemDblClick">
                    <ExtraParams>
                        <ext:Parameter Name="grow" Value="record.get('Id')" Mode="Raw" />
                    </ExtraParams>
                </ItemDblClick>
            </DirectEvents>
        </ext:GridPanel>
    </body>
    </html>
  5. #5
    I've use version 2.0.4531.25767 is it newest dll version?
    Last edited by geoffrey.mcgill; Jan 27, 2015 at 6:03 PM.
  6. #6
    I think, no, it is not.

    Please get the sources from:
    http://svn.ext.net/premium/branches/2.1/
  7. #7
    Quote Originally Posted by Daniil View Post
    I think, no, it is not.

    Please get the sources from:
    http://svn.ext.net/premium/branches/2.1/
    Daniil you were right. newest version is 2.1.

    Let me try it I'll give you feedback if it help ;)


    Your example work for me but are there some requirements needed for this working? because on my old code( rewrited for v2.0) it's still not working.
  8. #8
    It would be best to always post a new reply. There is no email notification when a post is edited.

    Quote Originally Posted by ViDom View Post
    Your example work for me but are there some requirements needed for this working? because on my old code( rewrited for v2.0) it's still not working.
    I am afraid I don't understand the question. Please elaborate.

Similar Threads

  1. Problem with mode in extraparameters data
    By feanor91 in forum 1.x Help
    Replies: 1
    Last Post: Dec 22, 2011, 8:32 AM
  2. ExtraParameters use from listeners
    By ISkomorokh in forum 1.x Help
    Replies: 0
    Last Post: Dec 10, 2009, 12:49 PM

Tags for this Thread

Posting Permissions