﻿/*
Custom js for this application.
Dependencies: jQuery
*/
$(document).ready(function() {
    //custom parser sort cells based on checkbox checked status
    $.tablesorter.addParser({
        id: 'checkbox',
        is: function(s) { return false; },
        format: function(s) { return s.indexOf("checked") != -1 ? 1 : 0; },
        type: 'numeric'
    });

    $(".tablesorter").tablesorter();

    jQuery.fn.reloadReport = function() {
        var pageDDL = $(this);
        $.ajax({
            url: '/Account/ReportPatients',
            type: 'POST',
            data: { 'perPage': pageDDL.val() },
            dataType: 'html',
            success: function(res) { $('#report-grid').html(res); $(".tablesorter").tablesorter(); }
        });
    };
});
