{% extends "data_list.html" %}
{% load i18n %}
{% block headjs %}
    <script>
        $('#id_datalist').hide();
    </script>
{% endblock %}
{%  block search_div  %}
    <div id="id_search" class="news_topsearch">
        <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
            <td width="50"><div class="news_topsearch1">{% trans "时段类型" %}</div></td>
            <td>
                 <div align="right" style="width:300px;" class="topSearchBtn floatR">
                     <span class="Link_blue1">
                         <span class="action_topSearch floatL"></span><a href="javascript:void(0)" id="id_normal_search" class="floatL">{% trans "普通时段" %}</a>
                     </span>
                     <span class="Link_blue1">
                        <span class="action_topSearch floatL"></span><a href="javascript:void(0)" id="id_flexible_search" class="floatL">{% trans "弹性时段" %}</a>
                    </span>
                 </div>
            </td>
        </tr> </table>
    </div>
{% endblock%}
{% block extrajs %}
    //var g = $('#id_datalist').get(0).g;
    //g.init_query = ['timetable_type=0'],
    //g.disable_cols = ['SchclassID', 'change_at', 'only_first_last', 'is_support_cross', 'cross_days', 'is_ot_ft'],
    //g.load_data();
    $('#id_datalist > h1').text('{% trans '普通时段' %}')
    $('#id_datalist').show();
{% endblock %}
{% block extend_model_grid %}
    disable_cols :['SchclassID', 'change_at|time_format', 'only_first_last', 'is_support_cross', 'cross_days', 'is_ot_ft'],
{% endblock %}
{% block addjs %}
    //function is_row_operations_show(rowdata){
    //    return rowdata[0]!=1
    //};
    $("#id_normal_search").click(function(){
        var g = $('#id_datalist').get(0).g;
        g.init_query = ['timetable_type=0'],
        g.disable_cols = ['SchclassID', 'change_at|time_format', 'only_first_last', 'is_support_cross', 'cross_days', 'is_ot_ft'],
        g.load_data();
        $('#id_datalist > h1').text('{% trans '普通时段' %}')
    });
    $("#id_flexible_search").click(function(){
        var g = $('#id_datalist').get(0).g;
        g.init_query = ['timetable_type=1'],
        g.disable_cols = ['SchclassID', 'StartTime|time_format', 'EndTime|time_format', 'CheckIn', 'CheckOut', 'IsCheckInOverTime', 'IsOverTime', 'is_support_cross', 'cross_days', 'WorkDay'],
        g.load_data();
        $('#id_datalist > h1').text('{% trans '弹性时段' %}')
    });
{% endblock%}