anchor.diff:    
     <script type="text/javascript">
   
  +  <%-- fires before showing the form with the new data after user clicked "add" button; receives as Parameter the id of the constructed form. --%>  
  +  var _beforeShowAddForm = function(formId) {
  +	   
  +  }
  +  
  +  <%-- fires before showing the form with the new data after user clicked "edit" button; receives as Parameter the id of the constructed form. --%>
  +  var _beforeShowEditForm = function(formId) {
  +	  
  +  }
  + 
  + 
  +  <%--  replaces the build in del function to prevent row deletion. Parameter passed to this function is the id of the edited row --%>
  +  var _del_function = function (id) {
  +	     alert("Record cannot be deleted. Instead, use the 'edit' button to mark the '"+$("#grid_id").getRowData(id).login+"' record as inactive.");
  +	     return false;
  + };	
  +	
  +	
  + <%--  The event  fire when error occurs from the ajax call and can be used for better formatting of the error messages. 
  +// To this event is passed response from the server. The event should return single message (not array), which then is displayed to the user. --%> 
  + var _errorTextFormat = function(response) {
  +		return response.responseText;
  +  }
  +
  +	
  +  <%--  fires after response has been received from server. used to display status from server 
  +  // Receives as parameters the data returned from the request and an array of the posted values of type id=value1,value2. 
  +  // When used this event should return array with the following items [success, message] 
  +  // where 
  +  // success is a boolean value if true the process continues, if false a error message appear and all other processing is stoped.  --%>
  +  var _afterSubmit = function(response, data) {
  +	  
  +       waspFade('statusMessage',response.responseText);
  +	
  +	   return [true,''];     
  + }
  +
  +  <%-- toggles on/off filter toolbar at the top --%>
  +  var _enableFilterToolbar=false;
  +  
  +  <%-- URL to fetch JSON-formatted data from server --%>
  +  var _url='/wasp/<tiles:insertAttribute name="area" />/listJSON.do?selId=${param.selId}';
  +  
  +  <%-- URL to submit CUD requests to the server --%>
  +  var _editurl='/wasp/<tiles:insertAttribute name="area" />/detail_rw/updateJSON.do';
  +  
  +  <%--  structure to define L&F of "edit row" functionality --%> 
  +  var _editAttr={
  +		  width:'auto',closeAfterEdit:true,closeOnEscape:true,afterSubmit:_afterSubmit,errorTextFormat:_errorTextFormat,beforeShowForm:_beforeShowEditForm,reloadAfterSubmit:true,recreateForm:true
  +  };
  +  
  +  <%-- structure to define L&F of "add row" functionality. see JQGrid for parameter descriptions --%>
  +  var _addAttr={
  +	serializeEditData: function(data){ return $.param($.extend({}, data, {id:0}));},//pass '0' on add instead of empty string
  +	closeAfterAdd:true,closeOnEscape:true,errorTextFormat:_errorTextFormat,afterSubmit:_afterSubmit,beforeShowForm:_beforeShowAddForm,width:'auto',reloadAfterSubmit:true,recreateForm:true
  +  };
  +  
  +  <%-- structure to define L&F of "delete row" functionality. see JQGrid for parameter descriptions --%>
  +  var _delAttr={};
  +  
  +  <%-- structure to define L&F of "search row" functionality. see JQGrid for parameter descriptions --%>
  +  var _searchAttr={drag:true,resize:true,modal:true,caption:'Lookup',closeOnEscape:true,sopt:['eq','ne'],multipleSearch: false, closeAfterSearch: true };
  +
  +  <%-- structure to define L&F of "navigator" functionality. see JQGrid for parameter descriptions --%>
  +  var _navAttr={view:true,del:true,delfunc:_del_function};
  +  
  +  <%-- these objects will be populated by the wasp:field tags included via "grid-columns" tile --%>
  +  var colNames=[];  
  +  var colModel=[];  
  +  var colErrors=[];
  +  
  +  <%-- disable support for legacy API --%>
     $.jgrid.no_legacy_api = true;
  - 
  +  
  +  <%-- default to JSON format --%>
     $.jgrid.useJSON = true;
  -
  -  _enableFilterToolbar=false;
  -  
  -  function odump(object, depth, max){
  +  
  +  <%-- include column definitions --%>
  +  <tiles:insertAttribute name="grid-columns" />
  +  	
  + <%-- add meta fields --%>
  + <c:forEach items="${_metaList}" var="_meta" varStatus="status">
  +
  +     <%-- get field name --%>
  +	_field_name='${_meta.k}';
  +	
  +	<%-- get field properties --%>
  +	_wasp_prop='${_meta.property}';
  +
  +	<%-- check if field is required --%>
  +	required='${_meta.property.constraint}'=='NotEmpty';
  +
  +	<%-- define rules to edit the field --%>
  +	editrules={edithidden:true};
  +	formoptions={};
  +	if(required){
  +		formoptions={elmsuffix:'<font color=red>*</font>'};
  +		editrules={edithidden:true,custom:true,custom_func:_validate_required};	
  +	}
  +
  +	editoptions={size:20};
  + 	edittype='text';
  + 	
  +   <%-- poluate "select" inputs --%>	 
  +   <c:if test="${not empty _meta.property.control}">
  +       editoptions={size:20,value:{}};
  +       edittype='select';
  +  		<c:if test="${_meta.property.control.items != null}">  	
  +  			<c:set var="selectItems" scope="request" value="${requestScope[_meta.property.control.items]}"/>
  +  			<c:set var="itemValue" scope="request">${_meta.property.control.itemValue}</c:set>
  +  			<c:set var="itemLabel" scope="request">${_meta.property.control.itemLabel}</c:set>   	
  +  		</c:if>
  + 		<c:if test="${_meta.property.control.items == null}">
  +	  		<c:set var="selectItems" scope="request" value="${_meta.property.control.options}" />
  + 			<c:set var="itemValue" scope="request">value</c:set>
  + 			<c:set var="itemLabel" scope="request">label</c:set>  	
  + 		</c:if>
  +  	              
  + 		selectItems=<wasp:json object="${selectItems}" />;
  +
  + 		editoptions['value']['']=' --- select --- ';
  + 		for(sKey in selectItems) {
  + 			_option=selectItems[sKey];
  + 			_value=_option['${itemValue}'];
  + 			_label=_option['${itemLabel}'];
  + 			
  + 			editoptions['value'][_value]=_label;
  + 		}
  + 		
  +  </c:if>          
  + 		
  +  <%-- list of column names --%>
  +  colNames.push('${_meta.property.label}');
  +
  +  <%-- list of column properties. see JQGrid for parameter descriptions --%>
  +  colModel.push(
  +		{name:'${_meta.k}', width:80, edittype:edittype, align:'right',hidden:true,editable:true,editrules:editrules,formoptions:formoptions,editoptions:editoptions}
  +  );
  +	
  +  <%-- list of column validation errors --%>
  +  colErrors.push('${_meta.property.error}');
  +
  +</c:forEach>
  +
  +
  +<%-- function to help with debugging --%>
  +function odump(object, depth, max){
     	depth = depth || 0;
     	max = max || 2;
   
  
positive.code:   height: '640', 
    loadui: 'block',
    scrollrows:true,
    loadonce: false, // to enable sorting on client side
    sortable: false, //to enable sorting
    
    loadComplete: function(data) {//pre-select row if userdata.selId is defined
  	    
  	        // data.userdata is the same as jQuery("#grid_id").getGridParam('userData');
  	        var userdata = jQuery("#grid_id").getGridParam('userData');
  	        
  	        if (!userdata.selId) return;//no row to pre-select
  	        
  	        var curPage = jQuery("#grid_id").getGridParam('page'); // is always 1
  	        if (curPage !== userdata.page) {
  	            setTimeout(function(){
  	                jQuery("#grid_id").setGridParam(
  
negative.code: }); 
  
  }
   
  createGrid();
  
  
  </script>
  </head>
  