[CLOSED] Gridpanel row refresh

  1. #1

    [CLOSED] Gridpanel row refresh

    hi,

    i have refresh button in every gridpanel row, if i click that refresh button ,only that row only should refresh(that means get the values from db),not whole gridpanel shoulnot refresh.....

    please provide sample
    Last edited by Daniil; Aug 10, 2010 at 6:55 AM.
  2. #2
    Hello, majestic!

    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)
            {
                this.GridPanel1.Store.Primary.DataSource = new object[]
                {
                    new object[] { "3m Co" },
                    new object[] { "Alcoa Inc" },
                    new object[] { "Altria Group Inc" }
                };
    
                this.GridPanel1.Store.Primary.DataBind();
            }
        }
    
        [DirectMethod]
        public object GetNewRowValues(string rowIndex)
        {
            X.Msg.Alert("Hello from server!", "You can pass new values of row #" + rowIndex + " to client-side").Show();
            return new object[] { rowIndex, "New company " + rowIndex };
        }
    
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    
        <script type="text/javascript">
            var commandHandler = function(command, record, index) {
                Ext.net.DirectMethods.GetNewRowValues(index, {
                    success: function(result) {
                        GridPanel1.getStore().getAt(result[0]).set('company', result[1]);                    
                    },
                    failure: function(result) {
                        Ext.Msg.alert('Failure', 'Error occurred during refreshing row...' + result);
                    }
                });
            }
        </script>
    
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
            <Store>
                <ext:Store runat="server">
                    <Reader>
                        <ext:ArrayReader>
                            <Fields>
                                <ext:RecordField Name="company" />
                            </Fields>
                        </ext:ArrayReader>
                    </Reader>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column DataIndex="company" Header="Company" />
                    <ext:CommandColumn>
                        <Commands>
                            <ext:GridCommand Icon="Accept" CommandName="refresh" />
                        </Commands>
                    </ext:CommandColumn>
                </Columns>
            </ColumnModel>
            <Listeners>
                <Command Fn="commandHandler" />
            </Listeners>
        </ext:GridPanel>
        </form>
    </body>
    </html>
    Last edited by Daniil; Aug 09, 2010 at 8:10 AM.
  3. #3

    Ext 0.8

    hi,
    i can not update coolite source at this moment, can u provide one sample using 0.8 verson... i trying to convert your sample at 0.8 verson but i get js error...
  4. #4

    converted

    hi,

    sorry i able to convert your sample code into 0.8 version of the code...
  5. #5

    marking symbol

    hi,

    while refresing the row how to avoid marking symbol in every cell in a gridpanel ...
  6. #6
    Hi!

    Please use this:
    GridPanel1.getStore().commitChanges()
  7. #7

    mask

    hi,

    i need a loading mask while clicking the gridcommand refresh button client side(Listeners).. how i can achieve this in your below sample code...
  8. #8
    Hello, majestic!

    As I can understand your post should be here http://forums.ext.net/showthread.php?9522-mask.
    Please follow the link to get a solution.

Similar Threads

  1. [CLOSED] Refresh Rowexpander's GridPanel
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 21, 2011, 9:28 PM
  2. [CLOSED] gridpanel refresh - directmethod
    By vali1993 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 13, 2010, 7:50 AM
  3. [CLOSED] GridPanel refresh, how to?
    By RomualdAwessou in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 16, 2010, 11:53 PM
  4. [CLOSED] gridpanel cell refresh
    By majestic in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 21, 2009, 7:28 AM
  5. [CLOSED] Gridpanel, scrollbar and refresh
    By frytas in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: May 09, 2009, 6:32 PM

Posting Permissions