Report data is component which is reponsible for showing data inside Grid, Tile and List (refered to as GTL). This component shows a lot of data so it comes with API along side of it. This API is for working with GTL and both changing its state and getting data out of it.
To initiate any action you just simply call specific function called sendDataWithRx
which is hooked to Rx.js
's Subject and forwards these messeges to corresponding controller.
You have to specify 3 attributes when comunicating with report data API
- controller -
reportDataController
, constant and should not be changed - action - what action should be initiated
- data - if action requires some data pass them via this attribute
Example of how to send data to GTL:
sendDataWithRx({
controller: 'reportDataController',
action: 'SOME_ACTION_NAME',
data: []
})
Notice that data is always array even if you are sending single value always pass it as array.
Some actions will store data in ManageIQ.qe.gtl.result
, it's either direct result (string, number) or object which contains item or items, based on action.
Action which selects item based on its id. Data should be array with first attribut ID of item and second true|false
to select|deselect item.
sendDataWithRx({
controller: 'reportDataController',
action: 'select_item',
data: [1, true]
})
Action to click on item and take you to detail page of such item. Data should be array with one attribute ID.
sendDataWithRx({
controller: 'reportDataController',
action: 'click_item',
data: [1]
})
Action to select all items on screen. Data should be array with one attribute true|false
to select|deselect all items.
sendDataWithRx({
controller: 'reportDataController',
action: 'select_all',
data: [true]
})
To navigate to specific page call this action. Data should be array with one attribute, page number.
sendDataWithRx({
controller: 'reportDataController',
action: 'go_to_page',
data: [5]
})
This action will lead you to last page, no need to send any data.
sendDataWithRx({
controller: 'reportDataController',
action: 'last_page'
})
Action which is oposite of last_page
, it will take you to first page. Again no data needed.
sendDataWithRx({
controller: 'reportDataController',
action: 'first_page'
})
To navigate to previous page call action previous_page
, no data required.
sendDataWithRx({
controller: 'reportDataController',
action: 'previous_page'
})
This action is oposite of previous_page
and it will take you to next page. No data needed.
sendDataWithRx({
controller: 'reportDataController',
action: 'next_page'
})
This action will store into ManageIQ.qe.gtl.result
page number on which you currently are. No data needed.
sendDataWithRx({
controller: 'reportDataController',
action: 'get_current_page'
})
Action which stores into ManageIQ.qe.gtl.result
number of pages, no data needed.
sendDataWithRx({
controller: 'reportDataController',
action: 'get_pages_amount'
})
This actions stores into ManageIQ.qe.gtl.result
number of items per page, no data needed.
sendDataWithRx({
controller: 'reportDataController',
action: 'get_items_per_page'
})
To change how many items should be visible per page call this function. Data should be number of items per page, please use 5
, 10
, 20
, 50
, 100
or 1000
as items per page.
sendDataWithRx({
controller: 'reportDataController',
action: 'set_items_per_page',
data: [10]
})
To change sorting order call this function as object it requires array with object containing column id and if isAscending.
sendDataWithRx({
controller: 'reportDataController',
action: 'set_sorting',
data: [{sortBy: 2, isAscending: true}]
})
To retrieve object how data are sorted call this action and it will store into ManageIQ.qe.gtl.result
desired information, no data needed.
sendDataWithRx({
controller: 'reportDataController',
action: 'get_sorting'
})
Action which will store into ManageIQ.qe.gtl.result
all items on screen, no data needed.
sendDataWithRx({
controller: 'reportDataController',
action: 'get_all_items'
})
This action is for retrieving one item into ManageIQ.qe.gtl.result
, data should be array with one item which is either ID (number) or name (string). If item is not present on screen no data will be returned.
sendDataWithRx({
controller: 'reportDataController',
action: 'get_item',
data: ['aaaop3322']
})
For some really sophisticated filtering over items call this action which will then stores the results into ManageIQ.qe.gtl.result
. This action can take multiple data over which to query and it can then return multiple items which are found.
sendDataWithRx({
controller: 'reportDataController',
action: 'query',
data: [{name: 'cfmear01', datastore: 'some-data-store'}]
})
This action will store into ManageIQ.qe.gtl.result
if item is visible. Data should be id or name of item.
sendDataWithRx({
controller: 'reportDataController',
action: 'is_displayed',
data: [2]
})
This action will store into ManageIQ.qe.gtl.result
object which will contain information about pagination - total
, start
, end
, pageCount
. No data required.
sendDataWithRx({
controller: 'reportDataController',
action: 'pagination_range'
})
If you want to get item from this API, you will receive object with multiple items
- click - function to click on item
- is_selected - function to retrieve if item is selected
- select - select item
- unselect - unselect item
- item - object with item's information
- cells - values of each cell
- id - item's id
- long_id - item's long_id
- quad - quad information
- topLeft -
fileicon
|fonticon
|tooltip
|text
|background
|color
- topRight -
fileicon
|fonticon
|tooltip
|text
|background
|color
- bottomLeft -
fileicon
|fonticon
|tooltip
|text
|background
|color
- bottomRight -
fileicon
|fonticon
|tooltip
|text
|background
|color
- topLeft -
- gtlType -
grid
|tile
|list