Reply To: Portfolio data sorter not working when data loaded via Ajax call

#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