コード例 #1
0
 public GridToolBarOptions(bool show, int width = 24, int height = 24, string searchName = "search", string searchText = "", bool displayCustomAddNew = true, string addNewToolbarButtonName = "AddNew", string addNewToolbarButtonText = "Add New", bool displaySearchPanel = true, bool displayRefresh = true, bool displayFilter = true, bool displayClearFilter = true, bool displayPdfExport = false, bool displayXlsExport = false, GridToolBarItemStyle addToolBarItemStyle = null)
 {
     Show                    = show;
     Width                   = width;
     Height                  = height;
     SearchName              = searchName.Translate();
     DisplayCustomAddNew     = displayCustomAddNew;
     AddNewToolbarButtonName = addNewToolbarButtonName.Translate();
     AddNewToolbarButtonText = addNewToolbarButtonText.Translate();
     AddToolBarItemStyle     = addToolBarItemStyle;
     SearchText              = (string.IsNullOrEmpty(searchText)? "search": searchText).Translate();
     DisplaySearchPanel      = displaySearchPanel && show;
     DisplayRefresh          = displayRefresh && show;
     DisplayFilter           = displayFilter && show;
     DisplayClearFilter      = displayClearFilter && show;
     DisplayPdfExport        = displayPdfExport && show;
     DisplayXlsExport        = displayXlsExport && show;
 }
コード例 #2
0
ファイル: GridData.cs プロジェクト: frankwus/Ensco.App
        public GridData(string gridName, string controller, string action, string title, string addNewButtonName, string addNewButtonText, string searchName, string searchText, GridToolBarItemStyle addToolBarItemStyle, bool initializeCallBack = false, string key = "Id", string displayColumnName = "Name", IDictionary <GridRouteTypes, string> routes = null, bool historicalRow = true, bool showPager = true, string editController = "Generic") : this(gridName, new GridToolBarOptions(true, addNewToolbarButtonName : addNewButtonName, addNewToolbarButtonText : addNewButtonText, searchName : searchName, searchText : searchText, addToolBarItemStyle : addToolBarItemStyle), new GridCommandButtonOptions(true, displayAddButtonInGridHeader : false), historicalRow : historicalRow, showPager : showPager, editController : editController)
        {
            Key = key;
            DisplayColumnName = displayColumnName.Translate();
            Name       = gridName;
            Action     = action;
            Controller = controller;
            Title      = title;

            if (routes != null && routes.Count > 0)
            {
                foreach (var kv in routes)
                {
                    Routes.Add(new GridRoute(kv.Key, new { Controller = Controller, Action = kv.Value }));
                }
            }

            if (initializeCallBack)
            {
                CallBackRoute = new { Controller = controller, Action };
            }
        }