1(function() { 2var GridViewToolbarCommandType = { 3 Custom: "Custom", 4 FullExpand: "FullExpand", 5 FullCollapse: "FullCollapse", 6 ClearSorting: "ClearSorting", 7 ShowFilterBuilder: "ShowFilterEditor", 8 ShowFilterRow: "ShowFilterRow", 9 ClearFilter: "ClearFilter", 10 ShowFilterRowMenu: "ShowFilterRowMenu", 11 ClearGrouping: "ClearGrouping", 12 ShowGroupPanel: "ShowGroupPanel", 13 ShowSearchPanel: "ShowSearchPanel", 14 ShowCustomizationWindow: "ShowCustomizationWindow", 15 ShowFooter: "ShowFooter", 16 ShowCustomizationDialog: "ShowCustomizationDialog", 17 ExpandRow: "ExpandRow", 18 CollapseRow: "CollapseRow", 19 ExpandDetailRow: "ExpandDetailRow", 20 CollapseDetailRow: "CollapseDetailRow", 21 New: "New", 22 Edit: "Edit", 23 Delete: "Delete", 24 DeleteSelectedRowsOnPage: "DeleteSelectedRowsOnPage", 25 Refresh: "Refresh", 26 Update: "Update", 27 Cancel: "Cancel", 28 PreviewChanges: "PreviewChanges", 29 HidePreview: "HidePreview", 30 UpdateSummaries: "UpdateSummaries" 31}; 32var GridViewToolbarHelper = ASPx.CreateClass(ASPx.GridToolbarHelper, { 33 constructor: function(grid) { 34 this.constructor.prototype.constructor.call(this, grid); 35 }, 36 ProcessToolbarItemClick: function(e) { 37 var item = e.item, 38 command = this.GetItemCommand(item); 39 switch(command) { 40 case GridViewToolbarCommandType.FullExpand: 41 this.grid.ExpandAll(); 42 break; 43 case GridViewToolbarCommandType.FullCollapse: 44 this.grid.CollapseAll(); 45 break; 46 case GridViewToolbarCommandType.ClearSorting: 47 this.ToolbarClearSorting(); 48 break; 49 case GridViewToolbarCommandType.ShowFilterBuilder: 50 this.grid.ShowFilterControl(); 51 break; 52 case GridViewToolbarCommandType.ShowFilterRow: 53 this.ToolbarShowFilterRow(item.GetChecked()); 54 break; 55 case GridViewToolbarCommandType.ClearFilter: 56 this.grid.ClearFilter(); 57 break; 58 case GridViewToolbarCommandType.ShowFilterRowMenu: 59 this.ToolbarShowFilterRowMenu(item.GetChecked()); 60 break; 61 case GridViewToolbarCommandType.ShowGroupPanel: 62 this.ToolbarShowGroupPanel(item.GetChecked()); 63 break; 64 case GridViewToolbarCommandType.ShowSearchPanel: 65 this.ToolbarShowSearchPanel(item.GetChecked()); 66 break; 67 case GridViewToolbarCommandType.ShowCustomizationWindow: 68 if(!this.grid.IsCustomizationWindowVisible()) 69 this.grid.ShowCustomizationWindow(); 70 else 71 this.grid.HideCustomizationWindow(); 72 break; 73 case GridViewToolbarCommandType.ShowFooter: 74 this.ToolbarShowFooter(item.GetChecked()); 75 break; 76 case GridViewToolbarCommandType.ShowCustomizationDialog: 77 this.grid.ShowCustomizationDialog(); 78 break; 79 case GridViewToolbarCommandType.ExpandRow: 80 this.grid.ExpandRow(this.grid.GetFocusedRowIndex()); 81 break; 82 case GridViewToolbarCommandType.CollapseRow: 83 this.grid.CollapseRow(this.grid.GetFocusedRowIndex()); 84 break; 85 case GridViewToolbarCommandType.ExpandDetailRow: 86 this.grid.ExpandDetailRow(this.grid.GetFocusedRowIndex()); 87 break; 88 case GridViewToolbarCommandType.CollapseDetailRow: 89 this.grid.CollapseDetailRow(this.grid.GetFocusedRowIndex()); 90 break; 91 case GridViewToolbarCommandType.New: 92 this.grid.AddNewItem(); 93 break; 94 case GridViewToolbarCommandType.Edit: 95 this.ToolbarStartEdit(); 96 break; 97 case GridViewToolbarCommandType.Delete: 98 this.ToolbarDeleteItem(); 99 break; 100 case GridViewToolbarCommandType.DeleteSelectedRowsOnPage: 101 this.ToolbarDeleteSelectedVisibleItems(); 102 break; 103 case GridViewToolbarCommandType.Refresh: 104 this.grid.Refresh(); 105 break; 106 case GridViewToolbarCommandType.ClearGrouping: 107 this.ToolbarClearGrouping(); 108 break; 109 case GridViewToolbarCommandType.Update: 110 this.grid.UpdateEdit(); 111 break; 112 case GridViewToolbarCommandType.Cancel: 113 this.grid.CancelEdit(); 114 break; 115 case GridViewToolbarCommandType.PreviewChanges: 116 this.ToolbarPreviewChanges(); 117 break; 118 case GridViewToolbarCommandType.HidePreview: 119 this.ToolbarHidePreview(); 120 break; 121 case GridViewToolbarCommandType.UpdateSummaries: 122 this.grid.UpdateSummaries(); 123 break; 124 default: 125 ASPx.GridToolbarHelper.prototype.ProcessToolbarItemClick.call(this, e); 126 break; 127 } 128 }, 129 ToolbarShowGroupPanel: function(show) { 130 this.SendToolbarCallback([ "ShowGroupPanel", show ? 1 : 0 ]); 131 }, 132 ToolbarShowSearchPanel: function(show) { 133 this.SendToolbarCallback([ "ShowSearchPanel", show ? 1 : 0 ]); 134 }, 135 ToolbarShowFilterRow: function(show) { 136 this.SendToolbarCallback([ "ShowFilterRow", show ? 1 : 0 ]); 137 }, 138 ToolbarShowFilterRowMenu: function(show) { 139 this.SendToolbarCallback([ "ShowFilterRowMenu", show ? 1 : 0 ]); 140 }, 141 ToolbarShowFooter: function(show) { 142 this.SendToolbarCallback([ "ShowFooter", show ? 1 : 0 ]); 143 }, 144 ToolbarClearGrouping: function() { 145 this.SendToolbarCallback([ "ClearGrouping" ]); 146 }, 147 ToolbarClearSorting: function() { 148 this.SendToolbarCallback([ "ClearSorting" ]); 149 }, 150 ToolbarPreviewChanges: function() { 151 var helper = this.GetBatchEditHelper(); 152 if(helper) 153 helper.ShowPreviewChanges(); 154 }, 155 ToolbarHidePreview: function() { 156 var helper = this.GetBatchEditHelper(); 157 if(helper) 158 helper.HideChanges(); 159 }, 160 IsUpdateEditItem: function(item) { 161 var command = this.GetItemCommand(item); 162 switch(command) { 163 case GridViewToolbarCommandType.Update: 164 case GridViewToolbarCommandType.Cancel: 165 case GridViewToolbarCommandType.PreviewChanges: 166 case GridViewToolbarCommandType.HidePreview: 167 return true; 168 } 169 return false; 170 }, 171 IsShowCustomizationWindowItem: function(item) { 172 return this.GetItemCommand(item) === GridViewToolbarCommandType.ShowCustomizationWindow; 173 }, 174 RefreshItemBadge: function(item) { 175 if(this.GetItemCommand(item) === GridViewToolbarCommandType.DeleteSelectedRowsOnPage) 176 this.RefreshSelectionBasedItemBadge(item, this.GetSelectedVisibleGridItemCount()); 177 }, 178 GetToolbarItemEnabled: function(item){ 179 var command = this.GetItemCommand(item); 180 switch(command) { 181 case GridViewToolbarCommandType.Edit: 182 return this.GetEditItemEnabled(); 183 case GridViewToolbarCommandType.Delete: 184 return this.GetDeleteItemEnabled(); 185 case GridViewToolbarCommandType.DeleteSelectedRowsOnPage: 186 return this.GetDeleteSelectedRowsOnPageItemEnabled(); 187 case GridViewToolbarCommandType.ExpandRow: 188 return this.GetExpandRowItemEnabled(); 189 case GridViewToolbarCommandType.CollapseRow: 190 return this.GetCollapseRowItemEnabled(); 191 case GridViewToolbarCommandType.ExpandDetailRow: 192 return this.GetExpandDetailRowEnabled(); 193 case GridViewToolbarCommandType.CollapseDetailRow: 194 return this.GetCollapseDetailRowEnabled(); 195 } 196 return null; 197 }, 198 GetEditItemEnabled: function(){ 199 var focusedIndex = this.GetFocusedItemIndex(); 200 return this.grid.allowEdit && this.IsDataRow(focusedIndex) && (this.HasBatchEditFocusedCell() || !this.IsEditingItem(focusedIndex)); 201 }, 202 GetDeleteItemEnabled: function(){ 203 var focusedIndex = this.GetFocusedItemIndex(); 204 return this.grid.allowDelete && this.IsDataRow(focusedIndex) && (this.HasBatchEditFocusedCell() || !this.IsEditingItem(focusedIndex)); 205 }, 206 GetDeleteSelectedRowsItemEnabled: function() { 207 return this.grid.allowDelete && this.GetSelectedGridItemCount() > 0; 208 }, 209 GetDeleteSelectedRowsOnPageItemEnabled: function() { 210 return this.grid.allowDelete && this.GetSelectedVisibleGridItemCount() > 0; 211 }, 212 GetExpandRowItemEnabled: function(){ 213 var focusedIndex = this.GetFocusedItemIndex(); 214 return this.IsGroupRow(focusedIndex) && !this.IsGroupRowExpanded(focusedIndex); 215 }, 216 GetCollapseRowItemEnabled: function(){ 217 var focusedIndex = this.GetFocusedItemIndex(); 218 return this.IsGroupRow(focusedIndex) && this.IsGroupRowExpanded(focusedIndex); 219 }, 220 GetExpandDetailRowEnabled: function(){ 221 var focusedIndex = this.GetFocusedItemIndex(); 222 return !this.IsGroupRow(focusedIndex) && !this.GetDetailRow(focusedIndex); 223 }, 224 GetCollapseDetailRowEnabled: function(){ 225 var focusedIndex = this.GetFocusedItemIndex(); 226 return !!this.GetDetailRow(focusedIndex); 227 }, 228 IsDataRow: function(visibleIndex) { 229 return this.control.IsDataRow(visibleIndex); 230 }, 231 IsGroupRow: function(visibleIndex) { 232 return this.control.IsGroupRow(visibleIndex); 233 }, 234 IsGroupRowExpanded: function(visibleIndex){ 235 return this.control.IsGroupRowExpanded(visibleIndex); 236 }, 237 GetDetailRow: function(visibleIndex){ 238 return this.control.GetDetailRow(visibleIndex); 239 }, 240 IsCustomItemVisibleOnChangesPreview: function(item) { 241 return ASPx.Data.ArrayContains(item.menu.cpItemsProps.ibpv, item.indexPath); 242 }, 243 UpdateBatchPreviewItemsState: function(item, state) { 244 var command = this.GetItemCommand(item); 245 switch(command) { 246 case GridViewToolbarCommandType.PreviewChanges: 247 this.UpdateItemBadge(item, state.previewChangesButtonChangesCount); 248 item.SetVisible(state.previewChangesButtonVisible); 249 break; 250 case GridViewToolbarCommandType.HidePreview: 251 item.SetVisible(state.hidePreviewButtonVisible); 252 break; 253 case GridViewToolbarCommandType.UpdateSummaries: 254 item.SetVisible(state.updateSummariesButtonVisible); 255 break; 256 } 257 }, 258 UpdateItemsOnBatchPreviewVisibilityChange: function(previewVisible) { 259 var setVisibleFunc = function(item) { 260 var visible = this.GetItemVisibilityOnChangesPreview(item, previewVisible); 261 item.SetVisible(visible); 262 }.bind(this); 263 this.ForEachItem(null, setVisibleFunc); 264 }, 265 GetItemVisibilityOnChangesPreview: function(item, previewVisible) { 266 var command = this.GetItemCommand(item); 267 switch(command) { 268 case GridViewToolbarCommandType.HidePreview: 269 return previewVisible; 270 case GridViewToolbarCommandType.UpdateSummaries: 271 var helper = this.GetBatchEditHelper(); 272 return !previewVisible && helper && helper.IsUpdateSummariesButtonVisible(); 273 } 274 return !previewVisible || this.IsItemVisibleOnChangesPreview(item); 275 }, 276 IsItemVisibleOnChangesPreview: function(item) { 277 var command = this.GetItemCommand(item); 278 switch(command) { 279 case GridViewToolbarCommandType.New: 280 case GridViewToolbarCommandType.Edit: 281 case GridViewToolbarCommandType.Delete: 282 case GridViewToolbarCommandType.DeleteSelectedRowsOnPage: 283 case GridViewToolbarCommandType.Refresh: 284 case GridViewToolbarCommandType.Update: 285 case GridViewToolbarCommandType.Cancel: 286 return true; 287 case GridViewToolbarCommandType.Custom: 288 return this.IsCustomItemVisibleOnChangesPreview(item); 289 } 290 return false; 291 } 292}); 293ASPx.GridViewToolbarHelper = GridViewToolbarHelper; 294})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.