<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-9-19 上午10:33:42  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
    <a:view>
        <a:link id="hls_fin_calc_config_quote_execute_link_id" model="hls.HLS500.hls_fin_calc_config_quote_execute" modelaction="batch_update"/>
        <script type="text/javascript"><![CDATA[
            function hls500_show_display_line() {
                hls500_show_display_line_btn_enable();
                var records = $('show_display_line_ds').getAll();
                if (records.length) {
                    var quote_data = [];
                    for (var i = 0;i < records.length;i++) {
                        var record = records[i];
                        if (record.dirty) {
                            if (record.get('display_flag') == 'Y') {
                                $('${/parameter/@calc_grid_id}').showColumn(record.get('column_name'));
                                $('${/parameter/@calc_export_grid_id}').showColumn(record.get('column_name'));
                            }else{
                                $('${/parameter/@calc_grid_id}').hideColumn(record.get('column_name'));
                                $('${/parameter/@calc_export_grid_id}').hideColumn(record.get('column_name'));
                            }
                            record.set('calc_session_id','${/parameter/@calc_session_id}');
                            record.set('_status','update');
                            quote_data.push(record.data);
                        }
                    }
                    Leaf.request({
                        url: $('hls_fin_calc_config_quote_execute_link_id').getUrl(),
                        para: quote_data,
                        success: function() {
                            success_sidebar_show();
                            $('${/parameter/@winid}').close();
                        },
                        failure: function() {
                            hls500_show_display_line_btn_enable('Y');
                        },
                        error: function() {
                            hls500_show_display_line_btn_enable('Y');
                        },
                        scope:this
                    });
                } else {
                    hls500_show_display_line_btn_enable('Y');
                    Leaf.showMessage('${l:PROMPT}', '${l:HLS500.CALC_CONFIG_QUOTE_NULL_FIELD}');
                    return;
                }
            }
            
            function hls500_show_display_line_btn_enable(flag) {
                if (flag == 'Y') {
                    $('hls500_show_display_line_id').enable();
                } else {
                    $('hls500_show_display_line_id').disable();
                }
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="show_display_line_ds" autoQuery="true" fetchAll="true" queryUrl="${/request/@context_path}/autocrud/hls.HLS500.hls_fin_calc_config_ln/query?enabled_flag=Y&amp;display_flag=C&amp;calc_session_id=${/parameter/@calc_session_id}">
                <a:fields>
                    <a:field name="display_flag" checkedValue="Y" uncheckedValue="C"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton id="hls500_show_display_line_id" click="hls500_show_display_line" text="HLS.CONFIRM"/>
            </a:screenTopToolbar>
            <a:grid id="show_display_line_grid_id" bindTarget="show_display_line_ds" height="420" width="500">
                <a:columns>
                    <a:column name="display_flag" editor="show_display_line_grid_checkbox_id" prompt="HLS.DISPLAY_FLAG" width="60"/>
                    <a:column name="upper_column_name" prompt="HLS.COLUMN_NAME" width="210"/>
                    <a:column name="prompt" prompt="HLS.COLUMN_DESC" width="210"/>
                </a:columns>
                <a:editors>
                    <a:checkBox id="show_display_line_grid_checkbox_id"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
