Ambrosia

 view release on metacpan or  search on metacpan

share/Templates/Templates/XSLT+DOJO/list_json.xsl  view on Meta::CPAN

<?xml version="1.0" encoding="UTF-8" ?>
<xslt:stylesheet version="1.0" 
	xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
	xmlns:xsl="http://www.w3.org/1999/XSL/TransformAlias"
	xmlns:atns="app://Ambrosia/EntityDataModel/2011/V1">

<xslt:import href="incDojo_JS_Css.xsl" />

<xslt:output method="xml" indent="yes" />
<xslt:namespace-alias stylesheet-prefix="xsl" result-prefix="xslt"/>

<xslt:include href="../../incName.xsl" />

<xslt:template match="/">

<xsl:stylesheet version="1.0">

<xsl:output method="html" indent="yes" />

<xsl:template match="/"><xsl:text disable-output-escaping="yes">&lt;!DOCTYPE HTML>
</xsl:text>
<html xml:lang="en" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<xslt:apply-imports/>

		<style type="text/css">
			@import "/ajax/libs/dojo/1.7.2/dojox/grid/resources/Grid.css";
			@import "/ajax/libs/dojo/1.7.2/dojox/grid/resources/claroGrid.css";

			.head {
				text-align:center;
				//font-weight:bold;
				font-size: 1.5em;
				height: 1.6em;
				width: 98%;
			}

			#grid {
				width: 98%;
				height: 80%;
			}
		</style>
		<link rel="stylesheet" type="text/css" href="/ajax/libs/dojo/1.7.2/dojox/grid/enhanced/resources/claro/EnhancedGrid.css"/>
		<link rel="stylesheet" type="text/css" href="/ajax/libs/dojo/1.7.2/dojox/grid/enhanced/resources/EnhancedGrid_rtl.css"/>


		<xsl:variable name="urlList">
		<xsl:value-of select="">
			<xslt:attribute name="select"><xslt:value-of select="concat('//',$UcAppName,'/@script')" /></xslt:attribute>
		</xsl:value-of>/json/<xsl:value-of select="//repository/@Name"/>
		</xsl:variable>

		<xsl:variable name="urlEdit">
		<xsl:value-of select="">
			<xslt:attribute name="select"><xslt:value-of select="concat('//',$UcAppName,'/@script')" /></xslt:attribute>
		</xsl:value-of>/<xsl:value-of select="//repository/@Name"/>
		</xsl:variable>

		<script type="text/javascript">
			require([
				"dojo/dom",
				"dojox/grid/EnhancedGrid",
				"dojox/data/QueryReadStore",
				"dojox/grid/enhanced/plugins/Pagination", "dojox/grid/enhanced/plugins/Filter",
		<xsl:if test="//repository/@mutable=1">
				"dijit/dijit", "dijit/form/Button", "dijit/Dialog",
		</xsl:if>
				"dojo/domReady!", "dojo/parser"], function(dom, DataGrid, QueryReadStore) {

					var qstore;
					function showFormEdit(id)
					{
						document.getElementById('exFormFrame').src="<xsl:value-of select="$urlEdit" />/"+id;
						dijit.byId('exForm').show();
					}

					var formatSaveButton = function(value){
						return new dijit.form.Button({
							label: "Edit",
							iconClass: "dijitIconEdit",
							onClick: function(){ showFormEdit(value) }
						});
					};

					dojo.declare("my.data.QueryReadStore", [QueryReadStore], {
							_filterResponse: function(data){
								return {numRows: data.repository.numRows, items:data.repository.items};
							},
						});

					qstore = new my.data.QueryReadStore({
						url: "<xsl:value-of select="$urlList" />"



( run in 1.113 second using v1.01-cache-2.11-cpan-364913b4093 )