51
edits
Changes
Created page with "XML Javascript Function is a section on Custom_Field_Type:_Special_-_XML_Data type field. Javascript and jQuery scripts can be added, which will run when the Special - XM..."
XML Javascript Function is a section on [[Custom_Field_Type:_Special_-_XML_Data]] type field.
Javascript and jQuery scripts can be added, which will run when the Special - XML Data field's button is clicked, and the new window with the XML is opened.
Example:
If the sum of cells with a specific css class (cellToTotal) (as defined in [[XML_Section_Builder]]) has to be alerted:
<pre style="white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;">
var specCellSum=0;
$(".cellToTotal").each(function(){
specCellSum+=parseFloat($(this));
});
alert(specCellSum);
</pre>
==See Also==
* [[Custom Field Type: Special - XML Data]]
[[Category:Custom Fields]][[Category:XML]]
Javascript and jQuery scripts can be added, which will run when the Special - XML Data field's button is clicked, and the new window with the XML is opened.
Example:
If the sum of cells with a specific css class (cellToTotal) (as defined in [[XML_Section_Builder]]) has to be alerted:
<pre style="white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;">
var specCellSum=0;
$(".cellToTotal").each(function(){
specCellSum+=parseFloat($(this));
});
alert(specCellSum);
</pre>
==See Also==
* [[Custom Field Type: Special - XML Data]]
[[Category:Custom Fields]][[Category:XML]]