[CLOSED] After ViewReady event, gird panel will delay to update the content about 2 second

Page 1 of 3 123 LastLast
  1. #1

    [CLOSED] After ViewReady event, gird panel will delay to update the content about 2 second

    Hi:

    I meet a weird issue which is after I change the store in ViewReady event, I found the grid panel will wait about 2 second, at least, and then update itself.
    Is there any idea for that or anything can improve it? Thank you.

    The ViewReady event handler method is:
    gridViewReadyStyleRow: function (el) {
                changeTheStore(el);
            }
    Last edited by Daniil; Jan 27, 2012 at 5:08 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I don't know the reason of that delay, need a sample to see how all is configured on your side.

    I think there should be a better solution than changing a store within a ViewReady listener.

    Please clarify the requirement. Probably, we will able to suggest a better solution.
  3. #3
    I have a page which has two modes, the based mode and the enhance mode. The enhance mode needs to execute a javascript method to based mode which is calculate some value based on store and modified the value in store. The requirement is the user can directly switch to enhance mode without going to the based mode firstly and then manually switch to enhance mode. My solution is load the page with based mode and execute the javascript method in ViewReady event for switching the enhance mode automatically. Therefore I can re-use the javascript method rather than re-write the calculation logic again.
  4. #4
    Thanks for the details.

    Do you use two stores or just change records in a single store?

    Please demonstrate the changeTheStore function.

    Generally, providing a simplified sample to reproduce the problem would be best.
  5. #5
    Quote Originally Posted by Daniil View Post
    Thanks for the details.

    Do you use two stores or just change records in a single store?

    Please demonstrate the changeTheStore function.

    Generally, providing a simplified sample to reproduce the problem would be best.
    To simple the issue, is there any mask I can us? if I can, during the store change and refresh the grid panel, showing the mask will meet my requirement as well. Thank you
  6. #6
    Here you are.

    Show a mask
    Ext.net.Mask.show({
        el : GridPanel1,
        msg : "Please wait..."
    });
    Hide a mask
    Ext.net.Mask.hide();
  7. #7
    By the way, if a GridPanel is configured with LoadMask and you would like to use its settings, it can look this way:

    Show a mask
    GridPanel1.loadMask.show();
    Hide a mask
    GridPanel1.loadMask.hide();
  8. #8
    Quote Originally Posted by Daniil View Post
    By the way, if a GridPanel is configured with LoadMask and you would like to use its settings, it can look this way:

    Show a mask
    GridPanel1.loadMask.show();
    Hide a mask
    GridPanel1.loadMask.hide();
    It will show the mask but I don't know where should I put. What's the event after ViewReady event in gridpanle?

    Thank you
  9. #9
    There is no grid's event after ViewReady.

    You could show a mask within a ViewReady listener.
  10. #10
    Quote Originally Posted by Daniil View Post
    There is no grid's event after ViewReady.

    You could show a mask within a ViewReady listener.
    Em....Then that doesn't work for me.
    I have a simple here
    <%@ 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.Store1.DataSource = new object[] 
                { 
                    new object[] { "test1", "test2", "test3", "true" },
                    new object[] { "test4", "test5", "test6", "true" },
                    new object[] { "test7", "test8", "test9", "true" },
                    new object[] { "test10", "test11", "test12", "true" },
                };
                this.Store1.DataBind();
     
                this.GridPanel1.Listeners.ViewReady.Handler = "if(condition){
                                                                                          var record1=Store1.getAt(0);
                                                                                          record1.beginEdit();
                                                                                          record1.set("isDisplay", false);
                                                                                          record1.endEdit();
                                                                                          var record2=Store1.getAt(2);
                                                                                          record2.beginEdit();
                                                                                          record2.set("isDisplay", false);
                                                                                          record2.endEdit();  }
                                                                                      Store1.filter({ fn: function (record) {
                                                                                          return record.data.IsDisplay !== false;}
                });";
            }
        }
    </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>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
                <Store>
                    <ext:Store ID="Store1" runat="server">
                        <Reader>
                            <ext:ArrayReader>
                                <Fields>
                                    <ext:RecordField Name="test1" />
                                    <ext:RecordField Name="test2" />
                                    <ext:RecordField Name="test3" />
                                    <ext:RecordField Name="isDisplay" />
                                </Fields>
                            </ext:ArrayReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column Header="Test1" DataIndex="test1" />
                        <ext:Column Header="Test2" DataIndex="test2" />
                        <ext:Column Header="Test3" DataIndex="test3" />
                    </Columns>
                </ColumnModel>
            </ext:GridPanel>
        </form>
    </body>
    </html>
    I just want to show a mask or grey out the screen before the page reflect the store changes to the page.
    Thank you
Page 1 of 3 123 LastLast

Similar Threads

  1. Update Panel Content from Click
    By Rick Atkinson in forum 1.x Help
    Replies: 4
    Last Post: Oct 22, 2011, 6:48 AM
  2. Replies: 0
    Last Post: Oct 19, 2010, 7:39 AM
  3. [CLOSED] GridPanel viewready event listener?
    By smmille1 in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Oct 12, 2010, 7:35 PM
  4. [CLOSED] How to update panel content during directevent
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Oct 06, 2010, 1:32 PM
  5. [CLOSED] Update ASP Update Panel with Direct Event
    By sharif in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 24, 2010, 12:48 AM

Posting Permissions