Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Configuration Options

Marcelo Sauerbrunn Portugal edited this page Jun 11, 2018 · 1 revision
        //Define an aggregate template to customize the rows when grouped. See github wiki for more details.
         aggregateTemplate: undefined,
         
         //Callback for when you want to validate something after selection.
         afterSelectionChange: function() {
         }, 
 
         /* Callback if you want to inspect something before selection,
         return false if you want to cancel the selection. return true otherwise. 
         If you need to wait for an async call to proceed with selection you can 
         use rowItem.changeSelection(event) method after returning false initially. 
         Note: when shift+ Selecting multiple items in the grid this will only get called
         once and the rowItem will be an array of items that are queued to be selected. */
         beforeSelectionChange: function() {
             return true;
         },
 
         //checkbox templates.
         checkboxCellTemplate: undefined,
         checkboxHeaderTemplate: undefined,
         
         //definitions of columns as an array [], if not defined columns are auto-generated. See github wiki for more details.
         columnDefs: undefined,
 
         //*Data being displayed in the grid. Each item in the array is mapped to a row being displayed.
         data: [],
         
         //Data updated callback, fires every time the data is modified from outside the grid.
         dataUpdated: function() {
         },
 
         //Enables cell editing.
         enableCellEdit: false,
 
         /* Controls when to use the edit template on a per-row basis using an angular expression
           (enableCellEdit must also be true for editing).
            This option can be overridden in a column definition. */
         cellEditableCondition: 'true',
 		
         //Enables cell selection.
         enableCellSelection: false,
 
         //Enable or disable resizing of columns
         enableColumnResize: false,
 
         //Enable or disable reordering of columns
         enableColumnReordering: false,
 
         //Enable or disable HEAVY column virtualization. This turns off selection checkboxes and column pinning and is designed for spreadsheet-like data.
         enableColumnHeavyVirt: false,
 
         //Enables the server-side paging feature
         enablePaging: false,
 
         //Enable column pinning
         enablePinning: false,
         
         //Enable drag and drop row reordering. Only works in HTML5 compliant browsers.
         enableRowReordering: false,
         
         //To be able to have selectable rows in grid.
         enableRowSelection: true,
 
         //Enables or disables sorting in grid.
         enableSorting: true,
 
         // string list of properties to exclude when auto-generating columns.
         excludeProperties: [],
         
         /* filterOptions -
         filterText: The text bound to the built-in search box. 
         useExternalFilter: Bypass internal filtering if you want to roll your own filtering mechanism but want to use builtin search box.
         */
         filterOptions: {
             filterText: "",
             useExternalFilter: false
         },
         
         //Defining the height of the footer in pixels.
         footerRowHeight: 55,
         
         //Initial fields to group data by. Array of field names, not displayName.
         groups: [],
 
         //The height of the header row in pixels.
         headerRowHeight: 30,
 
         //Define a header row template for further customization. See github wiki for more details.
         headerRowTemplate: undefined,
 
         /*Enables the use of jquery UI reaggable/droppable plugin. requires jqueryUI to work if enabled. 
         Useful if you want drag + drop but your users insist on crappy browsers. */
         jqueryUIDraggable: false,
 
         //Enable the use jqueryUIThemes
         jqueryUITheme: false,
 
         //Prevent unselections when in single selection mode.
         keepLastSelected: true,
 
         /*Maintains the column widths while resizing. 
         Defaults to true when using *'s or undefined widths. Can be ovverriden by setting to false.*/
         maintainColumnRatios: undefined,
 
         //Set this to false if you only want one item selected at a time
         multiSelect: true,
 
         // pagingOptions -
 
         pagingOptions: {
             // pageSizes: list of available page sizes.
             pageSizes: [250, 500, 1000], 
             //pageSize: currently selected page size. 
             pageSize: 250,
             //totalServerItems: Total items are on the server. 
             totalServerItems: 0,
             //currentPage: the uhm... current page.
             currentPage: 1
         },
         
         //Pins the selection checkbox column
         pinSelectionCheckbox: false,
 
         //Array of plugin functions to register in ng-grid
         plugins: [],
 
         //Row height of rows in grid.
         rowHeight: 30,
         
         //Define a row template to customize output. See github wiki for more details.
         rowTemplate: undefined,
         
         //all of the items selected in the grid. In single select mode there will only be one item in the array.
         selectedItems: [],
         
         //Disable row selections by clicking on the row and only when the checkbox is clicked.
         selectWithCheckboxOnly: false,
         
         /*Enables menu to choose which columns to display and group by. 
         If both showColumnMenu and showFilter are false the menu button will not display.*/
         showColumnMenu: false,
 
         /*Enables display of the filterbox in the column menu. 
         If both showColumnMenu and showFilter are false the menu button will not display.*/
         showFilter: false,
         
         //Show or hide the footer alltogether the footer is enabled by default
         showFooter: false,
 
         //Show the dropzone for drag and drop grouping
         showGroupPanel: false,
         
         //Row selection check boxes appear as the first column.
         showSelectionCheckbox: false,
         
         /*Define a sortInfo object to specify a default sorting state. 
         You can also observe this variable to utilize server-side sorting (see useExternalSorting).
         Syntax is sortInfo: { fields: ['fieldName1', 'fieldName2'], directions: ['asc' || 'desc']}*/
         sortInfo: undefined,
 
         //Set the tab index of the Vieport.
         tabIndex: -1,
         /*Prevents the internal sorting from executing. 
         The sortInfo object will be updated with the sorting information so you can handle sorting (see sortInfo)*/
         useExternalSorting: false,
         
         /*i18n language support. choose from the installed or included languages, en, fr, sp, etc...*/
         i18n: 'en',
         
         //the threshold in rows to force virtualization on
         virtualizationThreshold: 50,
 
         //Enables or disables text highlighting in grid by adding the "unselectable" class (See CSS file)
         enableHighlighting: false,
 
         //Function that fires once the grid has initialized
         init: undefined

Most of the options are pretty self explanatory.

Clone this wiki locally