This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.krams.tutorial.service; | |
import java.util.List; | |
import org.krams.tutorial.domain.Event; | |
import org.krams.tutorial.repository.jpa.IEventRepository; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.stereotype.Service; | |
import org.springframework.transaction.annotation.Transactional; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> | |
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %> | |
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> | |
<c:url value="/" var="rootUrl"/> | |
<c:url value="/resources" var="resourcesUrl"/> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<c:url value="/" var="rootUrl"/> | |
<c:url value="/resources" var="resourcesUrl"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- CSS Imports--> | |
<link rel="stylesheet" type="text/css" media="screen" href="${resourcesUrl}/css/jquery/dark-hive/jquery-ui-1.8.6.custom.css"/> | |
<link rel="stylesheet" type="text/css" media="screen" href="${resourcesUrl}/css/jqgrid/ui.jqgrid.css"/> | |
<link rel="stylesheet" type="text/css" media="screen" href="${resourcesUrl}/css/main/main.css"/> | |
<!-- JS Imports --> | |
<script type="text/javascript" src="${resourcesUrl}/js/jquery/jquery-1.5.2.min.js"></script> | |
<script type="text/javascript" src="${resourcesUrl}/js/jquery/jquery-ui-1.8.12.custom.min.js"></script> | |
<script type="text/javascript" src="${resourcesUrl}/js/datejs/date.js"></script> | |
<script type="text/javascript" src="${resourcesUrl}/js/jqgrid/grid.locale-en.js" ></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="menu"> | |
<ul> | |
<li><a href="${rootUrl}event">Events (DataTables)</a></li> | |
<li><a href="${rootUrl}jqgrid/event">Events (jQgrid)</a></li> | |
<li><a href="${rootUrl}error">Errors</a></li> | |
<li><a href="${rootUrl}monitor/event">Monitor Events</a></li> | |
<li><a href="${rootUrl}monitor/error">Monitor Errors</a></li> | |
</ul> | |
<br style="clear:left"/> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="jqgrid"> | |
<table id="grid"></table> | |
<div id="pager"></div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
$("#grid").jqGrid({ | |
url:'${rootUrl}jqgrid/event/getall', | |
datatype: 'json', | |
mtype: 'POST', | |
colNames:['Id', | |
'Name', | |
'Description', | |
'Participants', | |
'Date'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addRow() { | |
// Get the currently selected row | |
$("#grid").jqGrid('editGridRow','new', | |
{ url: "${rootUrl}jqgrid/event/add", | |
serializeEditData: function(data){ | |
data.id = 0; | |
data.date = new Date(data.date).toISOString(); | |
return $.param(data); | |
}, | |
recreateForm: true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function editRow() { | |
// Get the currently selected row | |
var row = $("#grid").jqGrid('getGridParam','selrow'); | |
if( row != null ) | |
$("#grid").jqGrid('editGridRow',row, | |
{ url: "${rootUrl}jqgrid/event/edit", | |
serializeEditData: function(data){ | |
data.date = new Date(data.date).toISOString(); | |
return $.param(data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function deleteRow() { | |
// Get the currently selected row | |
var row = $("#grid").jqGrid('getGridParam','selrow'); | |
// A pop-up dialog will appear to confirm the selected action | |
if( row != null ) | |
$("#grid").jqGrid( 'delGridRow', row, | |
{ url: '${rootUrl}jqgrid/event/delete', | |
recreateForm: true, | |
beforeShowForm: function(form) { |
OlderNewer