Source

Jmesa /

Filename Size Date modified Message
.settings
grails-app
lib
scripts
src/templates
web-app
1.0 KB
902 B
2.7 KB
3.6 KB
115 B
1.1 KB
Overview

Allows Grails applications to easily integrate  with the functionality. Utilizes Jmesa feature as an underlying
mechanism so serves managing representation of data in tabular form, filter,sort, paginate, export
your data.I recommend you read the Jmesa documentation before continuing to get a feel for how this plugin 
operates. 

Concepts
Sort: Allow sorting feature based on Domain class field name. 
Paginate: Provide the number of record need to be display.
Export/Import: Provide Export and Import of data in Pdf and Excel format.
Filter: Allowing filtering of data based on domain class field name.

Installation
Install the plugin by providing path to local file system where the plugin.zip file is located .
grails install-plugin jmesa

Simple Example

GSP :

{code}
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        ...
        <script language="javascript" src="<Js path>"></script>
        <link rel="stylesheet" type="text/css" href="<Css path>" />
        <script type="text/javascript">
        function onInvokeAction(id) {
            setExportToLimit(id, '');
            createHiddenInputFieldsForLimitAndSubmit(id);
        }
        function onInvokeExportAction(id) {
            var parameterString = createParameterStringForLimit(id);
            location.href = '../list?' + parameterString;
        }
        </script>
    </head>
    <body>
        .........
        
         <form name="modelForm" action="list">
                <jmesa:tableFacade id="tag" items="${modelsList}" maxRows="25" stateAttr="restore" var="modelInstance" autoFilterAndSort="true" maxRowsIncrements="25,50,100">
                    <jmesa:htmlTable style=" border-collapse: separate">
                        <jmesa:htmlRow highlighter="true">
                            <jmesa:htmlColumn property="name" sortable="true" filterable="true" cellEditor="org.jmesa.view.editor.BasicCellEditor" nowrap>
								<g:link action="show" id="${modelInstance.id}">${modelInstance.name}</g:link>
							 </jmesa:htmlColumn>
    	                     <jmesa:htmlColumn property="description" sortable="true" filterable="true" cellEditor="org.jmesa.view.editor.BasicCellEditor">${modelInstance.description}</jmesa:htmlColumn>
                             <jmesa:htmlColumn width="50px" property="source" sortable="true" filterable="true" title="Source TDS">${modelInstance.source}</jmesa:htmlColumn>
                             <jmesa:htmlColumn width="50px" property="status" sortable="true" filterable="true" title="Model Status">${modelInstance.status}</jmesa:htmlColumn>
                        </jmesa:htmlRow>
                    </jmesa:htmlTable>
                </jmesa:tableFacade>
            </form>
            
            .........
            
      <body>

{code}
Controller :

{code}
		TableFacade tableFacade = new TableFacadeImpl("tag",request)
        tableFacade.items = modelsList  // list of records which you want to render
        Limit limit = tableFacade.limit
		if(limit.isExported()){
            tableFacade.setExportTypes(response,limit.getExportType())
            tableFacade.setColumnProperties(<properties you need to render in export file as ',' separated>)
            tableFacade.render()
        }else
            return [modelsList : modelsList]
{code}

Contributing
All contributions are welcome.
For code changes please ensure you supply working tests and documentation.
Requests for additional information to go along with this documentation are also welcomed.

Credits
Jmesa was written by jeff johnston and plugin build by Lokanada Reddy, Vivek Singh