[CLOSED] gridpanel / hightlight row trouble/

  1. #1

    [CLOSED] gridpanel / hightlight row trouble/

    Hello,

    I am trying to highlight some rows when pressing a command in a gridpanel. When I select it in the corresponding gridpanel the view updates automaticly and in this case has a highlighted row. If I update a row in another gridpanel. The value is correctly set but the view isn't updated. Thank you for a hint where my thoughts go wrong... ;)

    best regards.

    <%@ Page Language="C#" %>
    
    <script runat="server">
        
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.Store1.DataSource = this.Data;
                this.Store1.DataBind();
                this.Store2.DataSource = this.Data;
                this.Store2.DataBind();
            }
        }
    
        private object[] Data
        {
            get
            {
                return new object[]
                {
                    new object[] { "3m Co", 0 },
                    new object[] { "Alcoa Inc", 0 },
                    new object[] { "Altria Group Inc", 0 },
                    new object[] { "American Express Company", 0 },
                    new object[] { "American International Group, Inc.", 0 }
                };
            }
        }
    
        </script>
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Test</title>   
    
        <style>
            .sel-row .x-grid-cell, .sel-row .x-grid-rowwrap-div {
        background: #c8ffc8 !important;
    }
        </style>
    
        <script>
            var getSelectedRowClass = function (record) {
                if (record.data.SELECTED > 0) {
                    return "sel-row";
                }
            };
        </script>
    </head>
    <body>
        <ext:ResourceManager runat="server" Locale="de-ch" />
    
        <ext:GridPanel 
                    runat="server" 
                    Title="GridPanel 1" 
                    ID ="gp1"
                    Frame="true"
                    Width="400"
                    Height="295">
                    <Store>
                        <ext:Store ID="Store1" runat="server">
                            <Model>
                                <ext:Model runat="server">
                                    <Fields>
                                        <ext:ModelField Name="company" />
                                        <ext:ModelField Name="SELECTED" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel>
                        <Columns>
                            <ext:Column runat="server" Text="Company" DataIndex="company" Flex="1" />
                        </Columns>            
                    </ColumnModel>
                    <View>
                        <ext:GridView>
                            <GetRowClass Fn="getSelectedRowClass"></GetRowClass>
                        </ext:GridView>
                    </View>
                </ext:GridPanel>
        <ext:GridPanel 
                    runat="server" 
                    Title="GridPanel 2" 
                    ID="gp2"
                    Frame="true"
                    Width="400"
                    Height="295">
                    <Store>
                        <ext:Store 
                            id ="Store2"
                            runat="server">
                            <Model>
                                <ext:Model runat="server">
                                    <Fields>
                                        <ext:ModelField Name="company" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel runat="server">
                        <Columns>
                            <ext:Column runat="server" Text="Company" Flex="1" DataIndex="company" />
                            <ext:CommandColumn runat="server" Width="25">
                                <Commands>
                                    <ext:GridCommand CommandName="highlight"></ext:GridCommand>
                                </Commands>
                                <Listeners>
                                    <Command Handler="#{Store1}.findRecord('company', 'Alcoa Inc', 0, false, false, true).set('SELECTED', 1);"></Command>
                                </Listeners>
                            </ext:CommandColumn> 
                        </Columns>
                    </ColumnModel>
                </ext:GridPanel>
    </body>
    </html>
    Last edited by Daniil; Jul 21, 2015 at 7:12 PM. Reason: [CLOSED]
  2. #2
    Hi @tMp,

    Sorry, I didn't get the issue. I click the row command in the second GridPanel and the row in the first GridPanel gets highlighted. Does it not get highlighted on your side?
  3. #3
    Hello Daniil,

    That is strange. I had assumed the same as you see when I was coding but it doesn't work on my side (I never get the highlighting in the first panel - but thanks for confirming that it should work ;) ). I just saw now that you have 3.2 out. I will try that one first before I report back asap (in about 1-2 days).

    best regards!

    Update
    the Version 3.2 solved this one for me. Sorry, I haven't seen the new version because it showed me still 3.1 on the example website (when you don't reload) ;)
    Last edited by tMp; Jul 21, 2015 at 5:36 PM.

Similar Threads

  1. 2.2 trouble with topbar in ie9
    By his363 in forum 2.x Help
    Replies: 1
    Last Post: May 21, 2013, 2:23 AM
  2. Trouble in deployment
    By fosteliss in forum 2.x Help
    Replies: 6
    Last Post: Dec 13, 2012, 8:35 PM
  3. Replies: 2
    Last Post: May 01, 2012, 4:57 PM
  4. trouble loading formpanel from gridpanel
    By cPrinciple in forum 1.x Help
    Replies: 0
    Last Post: Aug 02, 2011, 6:15 AM
  5. [CLOSED] Trouble to add new data to a GridPanel
    By csssi_coolite in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 21, 2010, 10:04 AM

Posting Permissions