Excerpt | ||
---|---|---|
| ||
view-grid-column - adds column to existing grid. |
Overview
This module is used for adding new column to existing grid.
...
name | type | required | description |
---|---|---|---|
plugin | string | yes | Name of the plugin where the model view belongs. |
view | string | yes | Name of the view where the component belongs. |
model component | string | yes | Name of the model component where the hook listener will be added to. |
node value | node | yes | One or more definition of columns. See below. |
Column node:
name | type | required | description |
---|---|---|---|
name | string | yes Definition of the hook. Please see an article describing defining hook using XML | Name of the column. |
fields | string | yes | Fields of the column. |
expression | string | no | Column value expression. |
orderable | boolean | no | True if column sort should be enabled. |
searchable | boolean | no | True if column filter should be enabled. |
multiSearch | boolean | no | True if column should be included in advanced filters. |
hidden | boolean | no | True if column should be hidden. |
width | integer | no | Width of column. |
link | boolean | no | True if column value should be link to detail. |
align | string ("left" | "right") | no | You could use this attribute to set your custom aligment. By default each column (except that one which contains a numeric values) has content aligned to the left. |
More information about column definition can be found here.
Example
Please find below an example of plugin defining one hook module. Lines 8-10 contain a module which defines new on-save hook in model sampleModel which belongs to the plugin otherPlugin.
...
additional column.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<?xml version="1.0" encoding="UTF-8"?> <plugin plugin="samplePlugin" version="1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schema.qcadoo.org/plugin" xmlns:modelview="http://schema.qcadoo.org/modules/modelview" xsi:schemaLocation="http://schema.qcadoo.org/plugin http://schema.qcadoo.org/plugin.xsd http://schema.qcadoo.org/modules/modelview http://schema.qcadoo.org/modules/modelview.xsd"> <model<view:modelview-grid-hookcolumn plugin="orders" view="otherPluginordersList" modelcomponent="sampleModelgrid"> <model:onSave class="com.qcadoo.samplePlugin.SampleHookService" method="callMeOnSave<view:column name="realizationTime" fields="realizationTime" orderable="true" searchable="false" width="30" link="false" /> </modelview:modelview-grid-field>column> </plugin> |