顯示具有 style 標籤的文章。 顯示所有文章
顯示具有 style 標籤的文章。 顯示所有文章

2023年4月20日 星期四

V80204 - css - 自定 style - 自定字型,顏色,背景顏色

 目的: V80204 - 自定 style  - css  - 自定字型,顏色,背景顏色

處理說明:  1>利用 labelstyle 及 fieldstyle 設定 字型,顏色
                        labelStyle: "font-size: 20pt; color: blue; background:  gray; ",
                        fieldStyle: "font-size: 20pt; background:  yellow; ",
                   2>利用外部 css 檔案, class 設定
                        var Tmp_Str = "<link type='text/css' rel='stylesheet' href='../JsFunction/mycss.css'  >";
                         $('head').append(Tmp_Str);
                   3>利用自定 class 來設定  字型,顏色                          
                         fieldCls: "my_redcolor  my_bigfont",
                   4>設定 panel 的 顏色 - 
                       bodyStyle: 'background:#ffc; ',
                   5>設定標題顏色 & 字型大小
                         var cmp_TITLE = get_cmp_lbl0("試車/飛(前中)登錄", 550);    
                         cmp_TITLE.style = "font-size: 14pt; color: blue;:text-align:center; ";



1>V80204.js
 //包含 mycss.css
 var Tmp_Str = "<link type='text/css' rel='stylesheet' href='../JsFunction/mycss.css'  >";
 $('head').append(Tmp_Str);

var Query1 = new Ext.FormPanel({
        id: 's1_form', flex:1,
        layout: { type: 'hbox', align: 'stretch' },
        fieldDefaults: { labelAlign: 'right' },
        defaults: { margin: { top: 3 } },
        height: 20,
        items: [
            {
                xtype: 'panel',
                id: 'panel1_1',
                layout: { type: 'hbox', align: 'stretch' },
                flex: 14,
                border: 0,
                items: [
                    {
                        xtype: 'panel',
                        id: 'panel1_11',
                        layout: { type: 'hbox', align: 'stretch' },
                        flex: 15,
                        border: 0,
                        items: [{
                            xtype: "fieldcontainer", fieldLabel: "WBS", labelWidth: 100, layout: "hbox", flex: 2,
                            labelStyle: "font-size: 20pt; color: blue; background:  gray; ",
                            items: [{
                                xtype: "textfield", id: "s1_WBS", name: "s1_WBS", width: 150,
                                padding: "0 4 0 0",                                
                                //Style: "font-size: 20pt; background-color:  red; ",
                                fieldStyle: "font-size: 20pt; background:  yellow; ",
                               //fieldCls: "required",
                                //fieldCls: "my_redcolor  my_bigfont",
                                //cls: "edit_BC",
                            },                            
                            {
                                xtype: "button", id: "s1_btn_WBS", name: "s1_btn_WBS", text: "...",
                                handler: function () {
                                    var win = EditPickx('WBS', '../api/V80204API/get_s_WBSPick', ['WBSNO'], ['s1_WBS'], J_pickstore_s_WBS, J_pickcolumns_s_WBS);
                                    win.show();
                                }
                            },
                            ]
                        }, // end of s1_WBS
                        {
                            xtype: "fieldcontainer", fieldLabel: "機種機號", labelWidth: 100, layout: "hbox", flex: 2,
                            items: [
                                { xtype: "textfield", id: "s1_ACNO", name: "s1_ACNO", width: 150, padding: "0 4 0 0" },
                            ]
                            },  // end of s_機種機號             
                            {  //顯示等候訊息
                                id: "s1_PROCMSG", name: "s1_PROCMSG", xtype: "panel", width: 150, height: 20, margin: "0 4 0 4",
                                hidden: false, border: 0, style: 'background-color:#FFFFFF;'
                            },
                        ]
                    },  // end of panel1
                ]
            },


2>mycss.css
<style type="text/css" >
#my_tbl {
    border-width: 9px;
    border-style: solid;    
}

.my_bigfont{
    font-size:  30px;
        color: yellow;
}

.my_redcolor {
    //background-color: red;
    background: red;
}


4>*.js

var DataPanel = Ext.create("Ext.panel.Panel", {
        flex: 4, layout: { type: 'hbox', align: 'stretch' },
        bodyStyle: 'background:#ffc; ',
        //bodyCls: 'my_lightgreen',
        fieldDefaults: { labelAlign: 'right' },  
        items: [
            //{ xtype: "panel", flex: 2, title: "", },
            {
     xtype: "fieldcontainer", fieldLabel: "WBS報工工時(小時)", labelWidth: 130, layout: "hbox", flex: 5,
                items: [{
                   xtype: "textfield", id: "s1_WBS_HR", name: "s1_WBS_HR", width: 150, 
                             padding: "0 4 0 0", fieldCls: "readonly",
                    // value: 'FM20120301001',
                },
                ]
            }], // end of s1_WBS_HR
    });  // end of DataPanel

2022年11月3日 星期四

V120502A - Table 的邊框設定 - 放大縮小設定 - 預覽列印設定

 目的: Table 的邊框設定 - 利用 border=1 和  style=' border:1 red solid;' 的差異

處理說明:  1>Cell無邊框
                         <table style = 'border: 1px solid blue; ' id = 'my_tbl' >
                            style設定的border只有針對目前的邊框做設定
                            並不會針對 table.cell設定邊框

                   2>Cell 有邊框
<table id = 'my_tbl' border=2px borderstyle='solid' bordercolor='#0000ff' width=100% height=100% >
                             table border設定, 也針對 cell 的邊框




1>*.js

var pub_print_area_Str = "<div  id='print_area'   style = 'border: 1px solid red;' width=100%  height=100% >"
    + "<table id = 'my_tbl'  style = 'border: 1px solid blue; '  > "
    //+ "<table  id = 'my_tbl'  border=2px  borderstyle='solid'   bordercolor='#0000ff'  width=100% height=100% > "
    + "<tr  id='my_tr1'><th>件號<br>(PART NO)</th><td>R=8-84-766-21-1</td></tr>"
    + "<tr  id='my_tr2'><th>EO號碼<br>(EONO)</th><td>GM1381+A15</td></tr>"
    + "<tr  id='my_tr3'><th>日期<br>(EONO)</th><td>2022/11/03</td></tr>"
    + "<tr  id='my_tr4'><th>數量<br>(EONO)</th><td>2</td></tr>"
    + "<tr  id='my_tr5'><th>工令單號<br>(SOR NO)</th><td>23169622</td></tr>"
    + "<tr  id='my_tr6'><th>品保<br>(QC)</th><td></td></tr>"
    + "<tr  id='my_tr6'><th>備註<br>(REMARK)</th><td>A052</td></tr>"
    + "</table>"
    + "</div>";


    var Tmp_sub_panel1 = $('#sub_panel1');
    Tmp_sub_panel1.append(pub_print_area_Str);
    

3>Table 邊框的設定


3.1>>*.js

var pub_print_area_Str = "<div  id='print_area'   class='break' style='width: 10cm; height: 6cm;border: 5px solid green;transform: scale(1);'>"
    + "<table  id = 'my_tbl' style='line-height: 14px; font-size: 12px;border-collapse:collapse;' border=1px  borderstyle='solid'   bordercolor='blue'  width=100% height=100% > "
    + "<tr ><th width=20% style='transform: scale(1);'>件號1<br>(PART NO)</th><td width=80%>R=8-84-766-21-1</td></tr>"
    + "<tr  ><th width=20% style='transform: scale(0.75);'>EO號碼<br>(EONO)</th><td width=80%>GM1381+A15</td></tr>"
    + "<tr  ><th width=20% style='transform: scale(0.75);'>日期<br>(DATE)</th><td width=80%>2022/11/03</td></tr>"
    + "<tr ><th width=20% style='transform: scale(0.75);'>數量<br>(QTY)</th><td width=80%>2</td></tr>"
    + "<tr  ><th width=20% style='transform: scale(0.75);'>工令單號<br>(SOR NO)</th><td width=80%>23169622</td></tr>"
    + "<tr  ><th width=20% style='transform: scale(0.75);'>品保<br>(QC)</th><td width=80%></td></tr>"
    + "<tr  ><th width=20% style='transform: scale(0.75);'>備註<br>(REMARK)</th><td width=80%>A052</td></tr>"
    + "</table>"
    + "</div>";