How To: Use script to determine the current mode of a dataregion |
Article Type | How To |
Title | Use script to determine the current mode of a dataregion |
| <i>How can I determine the current displaymode (grid,details,etc) of a data region?</i><br />
<br />
Set the displaymode of an <a href="http://support.dataweb.com/default.view?Topic=views/xml/vxmlhtmlblock">ws:htmlblock</a>:<br />
<br />
Script inside of an ws:htmlblock is only executed when that ws:htmlblock is rendered. If you'd like to execute script only when your dataregion is in details mode, for example, enclose that script in an ws:htmlblock that displays only in details mode.<br />
<br />
The following view-code declares the variable "mode" and assigns to it a value according to its parent-dataregion's mode.<br />
<br />
<span class="smallCode"><pre>
<!--#var mode="details";-->
<ws:dataregion...>
<ws:htmlblock displaymodes="grid">
<!--#mode="grid";-->
</ws:htmlblock>
<ws:htmlblock displaymodes="update">
<!--#mode="update";-->
</ws:htmlblock>
<ws:htmlblock displaymodes="insert">
<!--#mode="insert";-->
</ws:htmlblock>
</ws:dataregion></pre></span> |
Last Reviewed | February 20, 2015 14:07:43 |
|