Changes

Jump to: navigation, search

Custom Field Type: Special - Advanced Data Table

153 bytes removed, 13:29, 19 June 2017
no edit summary
=Overview=
[[File:xmlSample.png|framethumb|none|middle|500px|Example field configured as a budget sheet.|500px]]
This field type can be used to create worksheets or tables such as budget sheets, and lists of information. A wide range of complexity is supported from very simple tables to multi-section, multi-year budgets. This is accomplished through the ability to configure sub-sections within the same worksheet, and also define automatic cell calculations. This all adds up to a very robust, and flexible field.
Using the XML '''Section Builder''' you can create sections and define the attributes of each section and the cells within them. You can define the number of rows and columns, the display format, calculation formulas, and style your XML.
[[File:xml-sectionbuilder1.png|framethumb|none|middle|500px|The section builder.|500px]]
# While editing the custom field click on the '''Section Builder''' button (the four square icon) in the action bar.
== Create a Table with a Dynamic Number of Rows ==
[[File:xmlDynamic.png|framethumb|none|middle|500px|Example section set to dynamic rows.|500px]]
In addition to defining a set number of columns and rows, you can also configure a section to handle a dynamic number of rows. The user entering the data can add rows as necessary at time of entry. This is done by entering '''0''' for the '''Number of Rows''', which in turn exposes the following configuration options:
The presentation of the XML Data custom field is configured in the general settings page of the field. This is defined in the XSL Template (Extensible Style Sheet Language) option. The XSL Template includes a sample template option. Once you have inserted sample template you will need to specify which sections should appear and where they should appear.
[[File:xml-xsl.png|framethumb|none|middle|500px|The XSL template and configuration.|500px]]
# While editing the custom field locate the '''XSL Template''' option and insert the '''Sample Template'''.
<pre>if("<ssEscape>@level1.xml.fieldname.sectionnodename.rownodename.columnnodename.nodevalue@</ssEscape>"=="")
{result.isPassed=false;
result.addMsg('xml_@fieldname.id@','YourAlertMessage'); }</pre>
var saveFunc=saveXML;
saveXML=function() {
checkdupeval(); }
function checkdupeval() {
var result = 0;
if( a == b)
{
alert ("Please list each population no more than once."); result = 1;
}
}
if(result==0)
saveFunc();
}
</pre>
<pre><?xml version="1.0" encoding="UTF-8"?>
<worksheet>
<Expenses> <Salaries> <Amount>50000</Amount> <Notes>People I work with</Notes> <Date>2016-11-30</Date> </Salaries> <Supplies> <Amount>30000</Amount> <Notes>Things I need</Notes> <Date>2016-11-30</Date> </Supplies> <Total> <Amount>8000</Amount> <Notes></Notes> <Date>2016-11-30</Date> </Total> </Expenses>
</worksheet></pre>
{{CustomFieldPageFooter}}
[[Category:XML]]
Smartstaff, administrator
686
edits

Navigation menu