You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Controller and data provider building blocks to create your own very special angular grid without writing any boilerplate code.
Goal
There are several grid component supporting the angular framework, but most of them use the configuration method instead of the template approach.
So instead of using simple table, tr and td tags, you have to create a big configuration object with cell renderers and some other stuff.
With this approach you lose the simple way to arrange the part of the grid and design it with simple html and css.
Atomic grid try to solve this problem by giving building blocks for creating your own custom grid component in minutes.
Using this component you will get controllers and data providers for your grid without any view restriction.
Changing the property will change the page size and refresh the grid's content
setPage(newPageNumber: number): void
Change the grid page number without doing a search
page: number
Changing the property will change the page number and refresh the grid's content
Selection
Controller method / property
Description
multiSelection: boolean
Getter/setter for is the multiselection enabled for the grid
selectedItem: undefined | T
Get the selected item if multiselection is disabled
selectedItems: undefined | Array
Get the selected items if multiselection is enabled
Events
Controller method / property
Description
onBeforeSearch(listener)
Trigger before do a search, can be cancelled
onAfterSearch(listener)
Trigger after do a search
onBeforeChangeState(listener)
Trigger before change state (page, size, sort), can be cancelled
onBeforeChangeSelection(listener)
Trigger before change selection (page, size, sort, selection), can be cancelled
Use cases
Initialize grid state with custom paging and sorting parameters
<!-- Create a reference to the grid controller and disable autosearch --><tableat-grid="$ctrl.myGrid" at-grid-auto-search="false">...</table>
myGrid: AtomicGridNg1Controller<T>$postLink(){this.myGrid.setSort('field1',true);// Reverse sort by the field1this.myGrid.setSort('field2',false,true);// Sort by the field2 appended as second sortingthis.myGrid.setSize(20);// Set page size to 20this.myGrid.setPage(2);// Go the the 2nd pagethis.myGrid.search();// Do a search to fetch data}