예제 #1
0
        void Page_LoadComplete(object sender, EventArgs e)
        {
            GridPanel grid = this.ParentComponent as GridPanel;

            foreach (GridFilter filter in this.Filters)
            {
                filter.ParentGrid = grid;
            }

            if (!Ext.IsAjaxRequest && grid != null)
            {
                PagingToolbar pBar = null;
                if (grid.BottomBar.Count > 0 && grid.BottomBar[0] is PagingToolbar)
                {
                    pBar = grid.BottomBar[0] as PagingToolbar;
                }
                else if (grid.TopBar.Count > 0 && grid.TopBar[0] is PagingToolbar)
                {
                    pBar = grid.TopBar[0] as PagingToolbar;
                }

                if (!string.IsNullOrEmpty(grid.StoreID) && pBar != null)
                {
                    Store store = ControlUtils.FindControl(this, grid.StoreID) as Store;
                    if (store != null && store.Proxy.Count == 0)
                    {
                        this.Local = false;
                    }
                }
            }
        }
예제 #2
0
        void Store_BeforeClientInit(Observable sender)
        {
            Store store = ControlUtils.FindControl(this, this.StoreID) as Store;

            if (store != null)
            {
                //It doesn't need show mask for store ajax postback
                //store.AjaxEventConfig.EventMask.ShowMask = false;

                if (store.Proxy.Count == 0)
                {
                    if (store.IsAutoLoadUndefined)
                    {
                        store.AutoLoad = true;
                    }

                    PagingToolbar pBar = null;
                    if (this.BottomBar.Count > 0 && this.BottomBar[0] is PagingToolbar)
                    {
                        pBar = this.BottomBar[0] as PagingToolbar;
                    }
                    else if (this.TopBar.Count > 0 && this.TopBar[0] is PagingToolbar)
                    {
                        pBar = this.TopBar[0] as PagingToolbar;
                    }

                    if (pBar != null)
                    {
                        if (store.Proxy.Count == 0 || !store.RemotePaging)
                        {
                            store.RemoteSort = true;
                        }

                        if (store.BaseParams["start"] == null)
                        {
                            store.BaseParams.Add(new Parameter("start", "0", ParameterMode.Raw));
                        }
                        if (store.BaseParams["limit"] == null)
                        {
                            store.BaseParams.Add(new Parameter("limit", pBar.PageSize.ToString(), ParameterMode.Raw));
                        }

                        string script = string.Format("Coolite.Ext.initRefreshPagingToolbar({0});", this.ClientID);
                        if (!this.ScriptManager.ScriptOnReadyBag.Values.Contains(script))
                        {
                            this.AddScript(script);
                        }
                    }
                }
            }
        }