Support for generated reports. Report rendering is pluggable, so reports can be quite varied. The general definition of a report is a component that loads data and displays it, possibly paginates, sorts and filters it, but for which interactions are done via custom mutations (disable, delete, sort) or reloads.
Reports can customize their layout via plugins, and the layout can then allow futher nested customization of element render. For example, it is trivial to create a layout renderer that is some kind of graph, and then use loaded data as the input for that display.
Customizing the report's state machine and possibly wrapping it with more complex layout controls makes it possible to create UI dashboards and much more complex application features.
Support for generated reports. Report rendering is pluggable, so reports can be quite varied. The general definition of a report is a component that loads data and displays it, possibly paginates, sorts and filters it, but for which interactions are done via custom mutations (disable, delete, sort) or reloads. Reports can customize their layout via plugins, and the layout can then allow futher nested customization of element render. For example, it is trivial to create a layout renderer that is some kind of graph, and then use loaded data as the input for that display. Customizing the report's state machine and possibly wrapping it with more complex layout controls makes it possible to create UI dashboards and much more complex application features.
(column-classes report-instance
{:com.fulcrologic.rad.report/keys [column-class]
:com.fulcrologic.rad.attributes/keys [qualified-key]
:as attr})
Returns a string of column classes that can be defined on the attribute at ::report/column-class or on the report in the ::report/column-classes map. The report map overrides the attribute
Returns a string of column classes that can be defined on the attribute at ::report/column-class or on the report in the ::report/column-classes map. The report map overrides the attribute
(control-renderer report-instance)
Get the report controls renderer for the given report instance.
Get the report controls renderer for the given report instance.
(current-page report-instance)
Returns the current page number displayed on the report
Returns the current page number displayed on the report
(current-rows report-instance)
Get a vector of the current rows that should be shown by the renderer (sorted/paginated/filtered). report-instance
is available in the rendering env
.
Get a vector of the current rows that should be shown by the renderer (sorted/paginated/filtered). `report-instance` is available in the rendering `env`.
(currently-selected-row report-instance)
Returns the currently-selected row index, if any.
Returns the currently-selected row index, if any.
(defsc-report sym arglist & args)
Define a report. Just like defsc, but you do not specify query/ident/etc.
Instead, use report-options (aliased as ro below):
ro/columns ro/route ro/row-pk ro/source-attribute
If you elide the body, one will be generated for you.
Define a report. Just like defsc, but you do not specify query/ident/etc. Instead, use report-options (aliased as ro below): ro/columns ro/route ro/row-pk ro/source-attribute If you elide the body, one will be generated for you.
(filter-rows! this)
Update the filtered rows based on current report parameters.
Update the filtered rows based on current report parameters.
(form-link report-instance row-props column-key)
Get the form link info for a given (column) key.
Returns nil if there is no link info, otherwise returns:
{:edit-form FormClass
:entity-id id-of-entity-to-edit}
Get the form link info for a given (column) key. Returns nil if there is no link info, otherwise returns: ``` {:edit-form FormClass :entity-id id-of-entity-to-edit} ```
(formatted-column-value
report-instance
row-props
{:com.fulcrologic.rad.report/keys [field-formatter column-styles]
:com.fulcrologic.rad.attributes/keys [qualified-key type style]
:as column-attribute})
Given a report instance, a row of props, and a column attribute for that report: returns the formatted value of that column using the field formatter(s) defined on the column attribute or report. If no formatter is provided a default formatter will be used.
Given a report instance, a row of props, and a column attribute for that report: returns the formatted value of that column using the field formatter(s) defined on the column attribute or report. If no formatter is provided a default formatter will be used.
(goto-page! this page-number)
Move to the next page (if there is one)
Move to the next page (if there is one)
(initialize-parameters
{:com.fulcrologic.fulcro.ui-state-machines/keys [app event-data] :as env})
(install-formatter! app type style formatter)
Install a formatter for the given data type and style. The data type must match a supported data type
of attributes, and the style can either be :default
or a user-defined keyword the represents the
style you want to support. Some common styles have predefined support, such as :USD
for US Dollars.
This should be called before mounting your app.
Ex.:
(install-formatter! app :boolean :default (fn [report-instance value] (if value "yes" "no")))
Install a formatter for the given data type and style. The data type must match a supported data type of attributes, and the style can either be `:default` or a user-defined keyword the represents the style you want to support. Some common styles have predefined support, such as `:USD` for US Dollars. This should be called before mounting your app. Ex.: ```clojure (install-formatter! app :boolean :default (fn [report-instance value] (if value "yes" "no"))) ```
(link report-instance row-props column-key)
Get a regular lambda link for a given (column) key.
Returns nil if there is no link info, otherwise returns:
{:edit-form FormClass
:entity-id id-of-entity-to-edit}
Get a regular lambda link for a given (column) key. Returns nil if there is no link info, otherwise returns: ``` {:edit-form FormClass :entity-id id-of-entity-to-edit} ```
(loading? report-instance)
Returns true if the given report instance has an active network load in progress.
Returns true if the given report instance has an active network load in progress.
(next-page! this)
Move to the next page (if there is one)
Move to the next page (if there is one)
(page-count report-instance)
Returns how many pages the current report has.
Returns how many pages the current report has.
(prior-page! this)
Move to the next page (if there is one)
Move to the next page (if there is one)
Alias to control/run!
. Runs the report.
Alias to `control/run!`. Runs the report.
(report-options uism-env & k-or-ks)
Returns the report options from the current report actor.
Returns the report options from the current report actor.
(rotate-result report-class grouped-result)
Given a report class that has columns, and a raw result grouped by those columns: returns a vector of rows that rotate the grouped result into a normal report shape.
Given a report class that has columns, and a raw result grouped by those columns: returns a vector of rows that rotate the grouped result into a normal report shape.
(run-report! this)
Run a report with the current parameters
Run a report with the current parameters
Alias to control/set-parameter!
. Set the given parameter value on the report. Usually used internally by controls.
Alias to `control/set-parameter!`. Set the given parameter value on the report. Usually used internally by controls.
(sort-rows! this by-attribute)
Sort the report by the given attribute. Changes direction if the report is already sorted by that attribute. The implementation
of sorting is built-in and uses compare, but you can override how sorting works by defining ::report/sort-rows
on your report.
Sort the report by the given attribute. Changes direction if the report is already sorted by that attribute. The implementation of sorting is built-in and uses compare, but you can override how sorting works by defining `::report/sort-rows` on your report.
(start-report! app report-class)
(start-report! app report-class options)
Start a report. Not normally needed, since a report is started when it is routed to; however, if you put a report on-screen initially (or don't use dynamic router), then you must call this to start your report.
options
can contain ::id
, which will cause an instance of the report to be started. Used by containers so that
multiple instances of the same report can co-exist with different views on the same screen.
Start a report. Not normally needed, since a report is started when it is routed to; however, if you put a report on-screen initially (or don't use dynamic router), then you must call this to start your report. `options` can contain `::id`, which will cause an instance of the report to be started. Used by containers so that multiple instances of the same report can co-exist with different views on the same screen.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close