Inheritance: ToolbarBase
        /// <summary>
        ///
        /// </summary>
        public PagingToolbar.Builder PagingToolbar(PagingToolbar component)
        {
#if MVC
            component.ViewContext = this.HtmlHelper != null ? this.HtmlHelper.ViewContext : null;
#endif
            return(new PagingToolbar.Builder(component));
        }
示例#2
0
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            GridPanel grid = this.ParentComponent as GridPanel;

            if (!RequestManager.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 ((grid.StoreID.IsNotEmpty() || grid.Store.Primary != null) && pBar != null)
                {
                    Store store = grid.Store.Primary ?? (ControlUtils.FindControl(this, grid.StoreID) as Store);
                    if (store != null && store.Proxy.Count != 0 && store.RemotePaging && this.ViewState["Local"] == null)
                    {
                        this.Local = false;
                    }
                }
            }
        }
示例#3
0
        void Store_BeforeClientInit(Observable sender)
        {
            Store store = this.Store.Primary ?? ControlUtils.FindControl(this, this.StoreID) as Store;

            if (store != null)
            {
                //It doesn't need show mask for store ajax postback
                //store.DirectEventConfig.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.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));
                        }
                    }
                }
            }
        }
示例#4
0
 public static PageQueryParams GetPageQueryParamFromStoreRefreshDataEventArgs(StoreRefreshDataEventArgs e, Ext.Net.PagingToolbar pagingToolbar)
 {
     return(GetPageQueryParamFromStoreRefreshDataEventArgs(e, pagingToolbar.PageSize));
 }
示例#5
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     GridView item = View.FirstOrDefault();
     if (item == null)
     {
         item = new GridView();
         item.EnableTextSelection = true;
         this.View.Add(item);
     }
     item.ID = this.ID + "View";
     item.LoadingText = "正在加载";
     item.LoadMask = true;
     PagingToolbar toolbar = new PagingToolbar();
     Ext.Net.Button btnAdd = null;
     Ext.Net.Button button2 = null;
     if (this.EnableAdd)
     {
         if (EditorConfig == null || EditorConfig.AddWindow == null)
         {
             throw new Exception("EditorConfig的属性有误");
         }
         btnAdd = new Ext.Net.Button
         {
             Text = "添加"
         };
         btnAdd.Handler = string.Format("App.editWindow.setWidth({0});App.editWindow.setHeight({1});App.editWindow.setTitle('{2}');App.editWindow.show();App.editWindow.loader.load({{url:'{3}'}})", EditorConfig.AddWindow.Width, EditorConfig.AddWindow.Height, EditorConfig.AddWindow.Title, EditorConfig.AddWindow.Url);
         toolbar.Items.Add(btnAdd);
     }
     if (this.EnableRemove)
     {
         button2 = new Ext.Net.Button
         {
             Text = "删除"
         };
         button2.DirectEvents.Click.EventMask.Msg = "正在删除";
         button2.DirectEvents.Click.EventMask.ShowMask = true;
         button2.DirectEvents.Click.Confirmation.ConfirmRequest = true;
         button2.DirectEvents.Click.Confirmation.Message = "确认删除?";
         button2.DirectEvents.Click.Confirmation.Title = "提示";
         Parameter parameters = new Parameter
         {
             Name = "ids",
             Value = "getSelectionIds()",
             Mode = ParameterMode.Raw
         };
         button2.DirectEvents.Click.ExtraParams.Add(parameters);
     }
     if (this.EditorConfig != null)
     {
         if (this.EnableAdd)
         {
             btnAdd.DirectEvents.Click.ExtraParams.AddRange(this.EditorConfig.ExtraParams);
             btnAdd.DirectEvents.Click.ExtraParams.AddRange(this.EditorConfig.AddWindow.ExtraParams);
         }
         if (this.EnableRemove)
         {
             button2.DirectEvents.Click.ExtraParams.AddRange(this.EditorConfig.ExtraParams);
             button2.DirectEvents.Click.ExtraParams.AddRange(this.EditorConfig.AddWindow.ExtraParams);
         }
     }
     if (this.EnableAdd)
     {
     }
     if (this.EnableRemove)
     {
         button2.DirectClick += new ComponentDirectEvent.DirectEventHandler(this.btnRemove_DirectClick);
         toolbar.Items.Add(button2);
     }
     if (BottomBar.Count > 0)
     {
         toolbar.Items.AddRange(BottomBar[0].Items);
         BottomBar.Clear();
     }
     this.BottomBar.Add(toolbar);
     this.SelectionModel.Add(new CheckboxSelectionModel());
     this.InitModel();
     this.InitGridCommand();
     if (!Ext.Net.X.IsAjaxRequest)
     {
         this.AddScript("function getSelectionIds(){var sm=Ext.getCmp(\"" + this.ID + "\").getSelectionModel();var ids=Array();var selections=sm.getSelection();for(var i=0;i<selections.length;i++)ids.push(selections[i].data.Id);return ids.join(',');}");
     }
 }
示例#6
0
 /// <summary>
 ///
 /// </summary>
 public PagingToolbar.Builder PagingToolbar(PagingToolbar component)
 {
     return(new PagingToolbar.Builder(component));
 }