Portfolio data sorter not working when data loaded via Ajax call

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #10035028
    ts
    Participant

    When you go to the site, please enter the zip code of 90277 – you will see a window pop up with a portfolio data sorter, but it is not working. If you look at the Javascript console, console.log outputs the result that is being loaded. it works when it is not loaded via this method. Please advise.


    #10035029
    Support
    Keymaster

    Hello,

    You need initialize the sort plugin in the html of ajax response. For it change your ajax code to:

    $.ajax({
        type: 'POST',
        url: 'getquote.php',
        data: {data: data},
        dataType: 'html', 
        success: function(response) {
    
        	$('#quotemodal').modal('show');
        	$('.modal-body').html(response);
    
            console.log(response);
    
            // Sort
    		(function($) {
    
    			'use strict';
    
    			if ($.isFunction($.fn['themePluginSort'])) {
    
    				$(function() {
    					$('[data-plugin-sort]:not(.manual), .sort-source:not(.manual)').each(function() {
    						var $this = $(this),
    							opts;
    
    						var pluginOptions = theme.fn.getOptions($this.data('plugin-options'));
    						if (pluginOptions)
    							opts = pluginOptions;
    
    						$this.themePluginSort(opts);
    					});
    				});
    
    			}
    
    		}).apply(this, [jQuery]);
    
            //var dstring = "hello! we have received your quote for a "+data['size']+" "+data['condition']+" container. it will cost you $"+response['port'][type]+". With $"+ roundTo((response['port']['trucking'] * response['port']['dist']), 2) +" shipping from our depot in "+response['port']['name']+" to "+response['client']['city']+" ("+roundTo(response['port']['dist'], 1)+"mi).";
    
            //console.log (type);
    
    			//alert ('hub name: ' + data.message.name);
    
            //gtag_report_conversion();
    
        }
    });

    We hope this helps!

    Please try that and let us know if you need further assistance.

    Kind Regards,

    Rodrigo.


    If you are satisfied with Porto HTML and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads


Viewing 2 posts - 1 through 2 (of 2 total)

This topic is marked as "RESOLVED" and can not rceive new replies.