<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2013-9-16 下午03:50:02  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:view>
        <a:link id="pageLink_scaleplate_detail" url="${/request/@context_path}/modules/fnd/FND715/fnd_sc_scaleplate_detail.lview"/>
        <script type="text/javascript"><![CDATA[
    		function query()
    		{
    			$('fnd_sc_scaleplate_ds').query();
    		}
    		function save()
    		{
    		    if($('fnd_sc_scaleplate_ds').validate())
    		    {
    		    	$('fnd_sc_scaleplate_ds').submit();
    		    }
    		}
    		function addNew()
    		{
    		    $('fnd_sc_scaleplate_grid').showEditorByRecord($('fnd_sc_scaleplate_ds').create());   
    		}
    		
    		function winOpen_scaleplate_detail(sc_scaleplate_id)
    		{
    		    new Leaf.Window({
                    id: 'fnd_sc_scaleplate_detail',
                    url: $('pageLink_scaleplate_detail').getUrl(),
                    params:{
	                	sc_scaleplate_id:sc_scaleplate_id
	                },
                    title: '评级标尺明细',
                    fullScreen: true
                });
    		}
    		
    		function render_fnd_sc_scaleplate_grid(value,record,name)
    		{
    		    if(name=='scaleplate_detail')
    		    {
    		        if(!record.isNew)
    		        {
    		            return '<a href="javascript:winOpen_scaleplate_detail(' + record.get('sc_scaleplate_id') + ');">' + '配置' + '</a>';
    		        }
    		    }
    		    return '';
    		}
    		

    	]]></script>
        <a:dataSets>
            <a:dataSet id="template_type_ds" lookupCode="FND_SC_TEMPLATE_TYPE"/>
            <a:dataSet id="fnd_sc_scaleplate_ds" autoPageSize="true" autoQuery="true" model="fnd.FND715.fnd_sc_scaleplate" selectable="true">
                <a:fields>
                    <a:field name="sc_scaleplate_id"/>
                    <a:field name="template_type" required="true"/>
                    <a:field name="template_type_desc" displayField="code_value_name" options="template_type_ds" returnField="template_type" valueField="code_value"/>
                    <a:field name="description" required="true"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="query" text="HLS.QUERY"/>
                <a:gridButton click="addNew" text="HLS.NEW"/>
                <a:gridButton click="save" text="HLS.SAVE"/>
            </a:screenTopToolbar>
        </a:screenBody>
        <a:grid id="fnd_sc_scaleplate_grid" bindTarget="fnd_sc_scaleplate_ds" marginHeight="170" marginWidth="30" navBar="true">
            <a:columns>
                <a:column name="template_type_desc" editor="fnd_sc_scaleplate_cbb" prompt="标尺类型" width="100"/>
                <a:column name="description" editor="fnd_sc_scaleplate_tf" prompt="标尺名称" width="200"/>
                <a:column name="scaleplate_detail" prompt="标尺明细" renderer="render_fnd_sc_scaleplate_grid"/>
            </a:columns>
            <a:editors>
                <a:comboBox id="fnd_sc_scaleplate_cbb"/>
                <a:textField id="fnd_sc_scaleplate_tf"/>
            </a:editors>
        </a:grid>
    </a:view>
</a:screen>