Changeset 831


Ignore:
Timestamp:
Feb 27, 2011, 11:46:55 PM (14 years ago)
Author:
gav
Message:

Refactor taskShow.js.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/taskDetailed/_showProcedureTab.gsp

    r826 r831  
    2525        <br />
    2626
    27         <div id="maintenanceEntryContainer"></div>
     27        <div id="pmEntryContainer"></div>
    2828
    29         <div style="text-align:right;" id="maintenanceEntryButton">
     29        <div style="text-align:right;" id="pmEntryButton">
    3030            <span class="buttons">
    3131                <input type="button"
    3232                            class="add"
    33                             value="Add Maintenance Entry"
    34                             onclick="getMaintenanceEntryForm(${taskInstance?.id}, 6)" />
     33                            value="Add PM Entry"
     34                            onclick="loadEntryForm(jQuery('#pmEntryContainer'),
     35                                                                    jQuery('#pmEntryButton'),
     36                                                                    {taskId: ${taskInstance?.id}, entryTypeId: 6})" />
    3537            </span>
    3638        </div>
  • trunk/web-app/js/taskShow.js

    r826 r831  
    11
    2 function getMaintenanceEntryForm(taskId, entryTypeId) {
    3 
    4     var p = {};
    5     for (var i = 0, j = arguments.length; i < j; i++){
    6         p[i] = arguments[i];
    7     }
     2// Load an Entry from via AJAX.
     3// @container Container object to load response into.
     4// @button Button object used to trigger this function.
     5// @args Params map to pass to actionUrl.
     6function loadEntryForm(container, button, params) {
    87
    98    var actionUrl = getContextPath()+"/entryDetailed/ajaxCreate/";
    10     var container = jQuery('#maintenanceEntryContainer');
    11     var button = jQuery('#maintenanceEntryButton');
    12     var params = {taskId: taskId, entryTypeId: entryTypeId};
    139
    1410    function success(data, textStatus, jqXHR){
Note: See TracChangeset for help on using the changeset viewer.