/**
 * 
 * @param string ajaxUrl
 * @param string selector default is "table_sortable"
 * @returns no return value
 */
function changePositionInList(ajaxUrl, selector) {

    selector = typeof selector !== 'undefined' ? selector : 'table_sortable';
    var dataPositions = new Array();
    $('#'+ selector +' tr').each(function(index, element) {
        var el = $(element);
        var id = el.data("id");
        el.data('position', index);
        dataPositions[id] = index;
    });

    //send positions to server
    params = {data: dataPositions}
    $.get(ajaxUrl, params);

}

