    <div class="ajax-pagination-container">
        <div class="content">
        <div class="table-meta-data"
             data-route-name="opendata_revision_index"
             data-route-params="{&quot;_rubric&quot;:&quot;\/opendata\/&quot;,&quot;code&quot;:&quot;7710539135-MD&quot;,&quot;revisionDate&quot;:&quot;20150508T151016&quot;,&quot;formDate&quot;:&quot;20130719&quot;}"
             data-current-query-params="{&quot;id&quot;:&quot;181&quot;,&quot;itemsToDisplay&quot;:[&quot;281&quot;,&quot;274&quot;],&quot;page&quot;:&quot;41&quot;,&quot;sortingColumnId&quot;:&quot;274&quot;,&quot;sort&quot;:&quot;fiv274_value&quot;,&quot;direction&quot;:&quot;asc&quot;}"></div>
        <table class="table table-bordered revision-table">
            <thead>
                <tr id="column-header-list">
                                                                                                                <th class="sorted">
                                                                                    <a translationCount="" class="asc" href="/opendata/7710539135-MD/data-20150508T151016-structure-20130719?id=181&amp;itemsToDisplay%5B0%5D=281&amp;itemsToDisplay%5B1%5D=274&amp;page=1&amp;sortingColumnId=274&amp;sort=fiv274_value&amp;direction=desc" title="Субъект Российской Федерации, предоставляющий сведения">Субъект Российской Федерации, предоставляющий сведения</a>

                        </th>
                                                                                            <th class="">
                                                                                    <a translationCount="" class="sortable" href="/opendata/7710539135-MD/data-20150508T151016-structure-20130719?id=181&amp;itemsToDisplay%5B0%5D=281&amp;itemsToDisplay%5B1%5D=274&amp;page=1&amp;sortingColumnId=281&amp;sort=fiv281_value&amp;direction=asc" title="Численность детей; получающих образовательные услуги по дошкольному образованию и (или) услуги по из содержанию (присмотру и уходу)  на 1 число текущего месяца (человек)">Численность детей; получающих образовательные услуги по дошкольному образованию и (или) услуги по из содержанию (присмотру и уходу)  на 1 число текущего месяца (человек)</a>

                        </th>
                                                        </tr>
                <tr>
                                            <th>
                            <div class="input-append filter-form">
                                <input
                                    type="text"
                                    class="column-filter"
                                    data-column-id="274"
                                    data-countable=""
                                    value=""/>
                                <button type="submit" class="btn filter-button"><i class="fa fa-filter"></i></button>
                            </div>
                        </th>
                                            <th>
                            <div class="input-append filter-form">
                                <input
                                    type="text"
                                    class="column-filter"
                                    data-column-id="281"
                                    data-countable="1"
                                    value=""/>
                                <button type="submit" class="btn filter-button"><i class="fa fa-filter"></i></button>
                            </div>
                        </th>
                                                        </tr>
            </thead>
            <tbody>
                                    <tr>
                                                                                                                                                <td >
                                    Смоленская область
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <td class="numeric">
                                    30943
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </tr>
                                    <tr>
                                                                                                                                                <td >
                                    Смоленская область
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <td class="numeric">
                                    31142
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </tr>
                                    <tr>
                                                                                                                                                <td >
                                    Смоленская область
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <td class="numeric">
                                    32902
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </tr>
                                    <tr>
                                                                                                                                                <td >
                                    Смоленская область
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <td class="numeric">
                                    32588
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </tr>
                                    <tr>
                                                                                                                                                <td >
                                    Смоленская область
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <td class="numeric">
                                    32674
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </tr>
                                    <tr>
                                                                                                                                                <td >
                                    Смоленская область
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <td class="numeric">
                                    31340
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </tr>
                                    <tr>
                                                                                                                                                <td >
                                    Ставропольский край
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <td class="numeric">
                                    95982
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </tr>
                                    <tr>
                                                                                                                                                <td >
                                    Ставропольский край
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <td class="numeric">
                                    97891
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </tr>
                                    <tr>
                                                                                                                                                <td >
                                    Ставропольский край
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <td class="numeric">
                                    103040
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </tr>
                                    <tr>
                                                                                                                                                <td >
                                    Ставропольский край
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <td class="numeric">
                                    103472
                                </td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </tr>
                            </tbody>
        </table>
        <div class="table-nav pull-right">
            <button class="clear-filters btn btn-default">Сбросить фильтры</button>
        </div>
        <div class="ajax-pagination">
            <div>
    
<div class="pagination">
            <span class="first">
            <a href="/opendata/7710539135-MD/data-20150508T151016-structure-20130719?id=181&amp;itemsToDisplay%5B0%5D=281&amp;itemsToDisplay%5B1%5D=274&amp;page=1&amp;sortingColumnId=274&amp;sort=fiv274_value&amp;direction=asc">&lt;&lt;</a>
        </span>
    
            <span class="previous">
            <a href="/opendata/7710539135-MD/data-20150508T151016-structure-20130719?id=181&amp;itemsToDisplay%5B0%5D=281&amp;itemsToDisplay%5B1%5D=274&amp;page=40&amp;sortingColumnId=274&amp;sort=fiv274_value&amp;direction=asc">&lt;</a>
        </span>
    
                        <span class="page">
                <a href="/opendata/7710539135-MD/data-20150508T151016-structure-20130719?id=181&amp;itemsToDisplay%5B0%5D=281&amp;itemsToDisplay%5B1%5D=274&amp;page=39&amp;sortingColumnId=274&amp;sort=fiv274_value&amp;direction=asc">39</a>
            </span>
        
                        <span class="page">
                <a href="/opendata/7710539135-MD/data-20150508T151016-structure-20130719?id=181&amp;itemsToDisplay%5B0%5D=281&amp;itemsToDisplay%5B1%5D=274&amp;page=40&amp;sortingColumnId=274&amp;sort=fiv274_value&amp;direction=asc">40</a>
            </span>
        
                        <span class="current">41</span>
        
                        <span class="page">
                <a href="/opendata/7710539135-MD/data-20150508T151016-structure-20130719?id=181&amp;itemsToDisplay%5B0%5D=281&amp;itemsToDisplay%5B1%5D=274&amp;page=42&amp;sortingColumnId=274&amp;sort=fiv274_value&amp;direction=asc">42</a>
            </span>
        
                        <span class="page">
                <a href="/opendata/7710539135-MD/data-20150508T151016-structure-20130719?id=181&amp;itemsToDisplay%5B0%5D=281&amp;itemsToDisplay%5B1%5D=274&amp;page=43&amp;sortingColumnId=274&amp;sort=fiv274_value&amp;direction=asc">43</a>
            </span>
        
    
            <span class="next">
            <a href="/opendata/7710539135-MD/data-20150508T151016-structure-20130719?id=181&amp;itemsToDisplay%5B0%5D=281&amp;itemsToDisplay%5B1%5D=274&amp;page=42&amp;sortingColumnId=274&amp;sort=fiv274_value&amp;direction=asc">&gt;</a>
        </span>
    
            <span class="last">
            <a href="/opendata/7710539135-MD/data-20150508T151016-structure-20130719?id=181&amp;itemsToDisplay%5B0%5D=281&amp;itemsToDisplay%5B1%5D=274&amp;page=53&amp;sortingColumnId=274&amp;sort=fiv274_value&amp;direction=asc">&gt;&gt;</a>
        </span>
    </div>

</div>        </div>
    </div>
</div>
<script type="application/javascript">
    var getTableUpdateUrl = function ($container) {
            var $metaData = $container.find('.table-meta-data'),
                filters = {},
                queryParams = $.extend($metaData.data('route-params'), $metaData.data('current-query-params'));

            if ('page' in queryParams) {
                delete queryParams['page'];
            }

            $container.find('.dataTables_scrollHead .column-filter').each(function () {
                var $me = $(this),
                    value = $me.val().trim();
                if (value.length) {
                    filters[$me.data('column-id')] = { value: value, countable: $me.data('countable') };
                }
            });

            queryParams['filters'] = filters;

            return Routing.generate($metaData.data('route-name'), $metaData.data('route-params'));
        },
        updateTable = function (url, $container) {
            var currentScrollPosition = $('.dataTables_scrollBody').scrollLeft();
            $.get(url, function (data) {
                var $data = $(data);
                $container.find('.content').replaceWith($data.find('.content'));
                initDataTable($container.find('.revision-table'));
                // Restore scroll position
                $('.dataTables_scrollBody').scrollLeft(currentScrollPosition);
            });
        },
        initDataTable = function ($container) {
            $container.dataTable({
                paging: false,
                scrollY: 300,
                scrollX: true,
                ordering: false,
                searching: false,
                lengthChange: false,
                info: false,
                language: {
                    zeroRecords: 'Ничего не найдено'
                }
            });
        };

    $(document).ready(function() {
        var $revisionTables = $('.revision-table');
        $revisionTables.each(function () {
            if (!$(this).hasClass('dataTable')) {
                initDataTable($(this));
            }
        });

        if ($revisionTables.length > 1) {
            return;
        }

        // Filter
        $(document).on('click', '.filter-form > button', function () {
            var $me = $(this),
                    $container = $me.closest('.ajax-pagination-container'),
                    url = getTableUpdateUrl($container);

            updateTable(url, $container);
        });

        $(document).on('keydown', '.column-filter', function (event) {
            var keyCode = (event.keyCode ? event.keyCode : event.which);
            if (keyCode == 13) {
                $(this).siblings('.filter-button').trigger('click');
            }
        });

        // Sorting
        $(document).on('click', '.ajax-pagination-container a', function (e) {
            e.preventDefault();
            var $me = $(this);
            updateTable($me.attr('href'), $me.closest('.ajax-pagination-container'));
        });

        // Clear filters
        $(document).on('click', '.clear-filters', function () {
            var $me = $(this),
                    $container = $me.closest('.ajax-pagination-container');
            $container.find('.column-filter').each(function () {
                $(this).val('');
            });

            var url = getTableUpdateUrl($container);
            updateTable(url, $container);
        });
    });
</script>
