The Table view displays a table of search results.
Name | Default value | Description |
id | Required. The unique ID for this control. | |
data | "preview" | The type of data to retrieve from the search results ( results | preview | events | summary | timeline ). |
dataOverlayMode | "none" | The type of overlay to display ( heatmap | highlow | none ). |
displayRowNumbers | false | Indicates whether to display row numbers. |
drilldown | "row" | The type of drilldown action ( row | cell | none ). |
drilldownRedirect | true | Indicates whether to redirect to a search page when clicked. When true, a refined search corresponding to the point that was clicked is displayed in the search app. When false, you must create a click event handler to define a drilldown action. You can also use the preventDefault method in the click event handler to bypass the default redirect to search. |
fields | null | The fields to display in the table. Specify a comma-separated string or an array of strings. |
format | null | The properties for a sparkline, in the format:format: { "sparkline_fieldname": [ { "type": "sparkline", // Sparkline options "options": { "property-1": "value-1", ... "property-n": "value-n" } } ] }where sparkline_fieldname and type are required. For more, see How to customize table cells and format sparklines. |
managerid | null | The ID of the search manager to bind this view to. |
pagerPosition | "bottom" | The position on the page where the page is displayed ( top | bottom ). |
pageSize | 10 | The number of results per page. |
settings | The properties of the view. See the methods below to get and set values. | |
showPager | true | Indicates whether to display the table pagination control. |
wrap | false | Indicates whether to wrap text in the results table. |
Name | Description |
addRowExpansionRenderer(renderer) | Adds a row renderer to the table, where renderer is an instance of your custom row renderer. |
addCellRenderer(renderer) | Adds a cell renderer to the table, where renderer is an instance of your custom cell renderer. |
collapseRow | Collapses the currently-expanded row. |
expandRow(index) | Expands the row specified by index, and collapses the currently-expanded row. |
getCellRenderers | Gets an array of the cell renderers that have been added to the table. |
getRowExpansionRenderers | Gets an array of the row renderers that have been added to the table. |
removeRowExpansionRenderer(renderer) | Removes a row renderer from the table, where renderer is an instance of your custom row renderer. |
removeCellRenderer(renderer) | Removes a cell renderer from the table, where renderer is an instance of your custom cell renderer. |
render | Draws the view to the screen. Called only when you create the view manually. |
settings.get( property ) | Returns the value of property for the current component. |
settings.set( property, value ) | Sets the value of property to the specified value for the current component. |
Name | Description |
click:cell | Fired when a cell is clicked. |
click:row | Fired when a row is clicked. |
require([ "splunkjs/mvc/tableview", "splunkjs/mvc/simplexml/ready!" ], function(TableView) { // Instantiate components new TableView({ id: "example-table", managerid: "example-search", pageSize: "5", el: $("#mytableview") }).render(); });