Changeset 1798 for trunk/web-app/js


Ignore:
Timestamp:
May 2, 2011, 11:55:13 AM (10 years ago)
Author:
robert@…
Message:

After searching, several actions can be performed on search results. These actions are called by sending data to a URL. This was done using the HTTP GET method, but that resulted in error with the length of the query string (see #422). This is solved by sending all data using the HTTP POST method.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1010.settings
        1111*.log
         12dtd
  • trunk/web-app/js/advancedQueryResults.js

    r1668 r1798  
    5858}
    5959
    60 function performAction( form, action, module ) {
     60function performAction( form, action, module, url ) {
    6161        // Make sure the data from the paginated table is submitted
    6262        // This is performed with javascript, because otherwise
    6363        // checkboxes of hidden rows won't be taken into account
    6464        // See also http://datatables.net/examples/api/form.html
     65       
     66        if( url == undefined )
     67                url = '/advancedQuery/performAction';
    6568       
    6669        // First remove all previously created inputs, in order to avoid any collissions
     
    7477        $('input', oTable.fnGetNodes()).each(function(idx,el) {
    7578                var $el = $(el);
    76                 if( $el.attr( 'name' ) == "id" && $(el).attr( 'checked' ) ) {
     79                if( $el.attr( 'name' ) == "uuid" && $(el).attr( 'checked' ) ) {
    7780                        checked = true;
    78                         form.append( $( '<input type="hidden" name="id" value="' + $el.attr( 'value' ) + '" class="created" />' ) );
     81                        form.append( $( '<input type="hidden" name="tokens" value="' + $el.attr( 'value' ) + '" class="created" />' ) );
    7982                }
    8083        })
     
    8891        $( '[name=actionName]', form ).val( action );
    8992        $( '[name=moduleName]', form ).val( module );
    90         submitForm( form, '/advancedQuery/performAction' );
     93       
     94        form.attr( 'action', url );
     95        form.submit();
    9196}
Note: See TracChangeset for help on using the changeset viewer.