<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2014-7-1 下午04:06:13  
    $Revision: 1.0  
    $Purpose: 分组定义
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:view>
        <a:link id="prj_cdd_item_sub_tab_group_link" url="prj_cdd_item_sub_tab_group.lview"/>
        <script type="text/javascript"><![CDATA[
    		function prj_cdd_item_tab_group_back(){
    		    $('${/parameter/@winid}').close();
    		}
    		
    		function prj_cdd_item_tab_group_save(){
    		    $('prj_cdd_item_tab_group_ds').submit();
    		}
    		
    		 function tplt_group_ef(record, name) {
                if (Ext.isEmpty(record.get('tab_group_id'))) {
                    return 'tplt_group_tf';
                }
                return '';
            }
            
            function hls220_group_render(id){
                var record = $('prj_cdd_item_tab_group_ds').findById(id);

                new Leaf.Window({
                    id:'prj_cdd_item_sub_tab_group_win',
                    url:$('prj_cdd_item_sub_tab_group_link').getUrl(),
                    params:{
                        'winid':'prj_cdd_item_sub_tab_group_win',
                        'parent_tab_group_id':record.get('tab_group_id')
                    },
                    width:550,
                    height:520
                });
            }
            
            function on_renderer(value, record, name){
                return '<a href="javascript:hls220_group_render('+record.id+')">' + "子分组" + '</a>';
            }
    	
    	]]></script>
        <a:dataSets>
            <a:dataSet id="prj_cdd_item_tab_group_ds" autoQuery="true" fetchAll="true" model="hls.HLS220.prj_cdd_item_tab_group" selectable="true">
                <a:fields>
                    <a:field name="tab_group_id"/>
                    <a:field name="tab_group" required="true"/>
                    <a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="prj_cdd_item_tab_group_back" text="HLS.BACK"/>
                <a:gridButton click="prj_cdd_item_tab_group_save" text="HLS.SAVE"/>
            </a:screenTopToolbar>
            <a:grid bindTarget="prj_cdd_item_tab_group_ds" height="400" navBar="true" width="600">
                <a:toolBar>
                    <a:button type="add"/>
                    <a:button type="clear"/>
                    <a:button type="delete"/>
                </a:toolBar>
                <a:columns>
                    <a:column name="tab_group" editorFunction="tplt_group_ef" prompt="分组编码" width="150"/>
                    <a:column name="tab_group_name" editor="tplt_group_tf" prompt="分组名称" width="200"/>
                    <a:column name="enabled_flag" align="center" editor="tplt_group_cb" prompt="启用" width="50"/>
                    <a:column name="render" align="center" renderer="on_renderer" prompt="子分组"  width="100"/>
                </a:columns>
                <a:editors>
                    <a:checkBox id="tplt_group_cb"/>
                    <a:textField id="tplt_group_tf"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
