Ext.js给form加背景图片

{
                iconCls: ‘zyl_icons_showdetail‘,
                tooltip: ‘查看‘,
                handler: function(gridView, rowIndex, colIndex) {
                    var rowInfo = gridView.up(‘grid‘).getStore().getAt(rowIndex);
                    if (Ext.isEmpty(rowInfo.get(‘adFlag‘))) {
                        rowInfo.set(‘adFlag‘, 0);
                    }
                    var viewWindow = me.getOpBillLineInfoViewWindow(new Array());
                    var viewForm = viewWindow.getOpBillLineInfoViewTab().getOpBillLineInfoViewForm();
                    viewForm.setOperatorType(rowInfo.data);
                    viewWindow.showData = rowInfo.data;
                    viewWindow.show();

                    var imgSign=‘url(../../images/seal/unsign.png) 0px 0 no-repeat‘;
                    var imgReceipt=‘‘;
                    var imgSettle=‘‘;
                    var imgRefund=‘‘;
                    if(rowInfo.data.billState==4){
                        imgSign=‘url(../../images/seal/sign.png) 0px 0 no-repeat‘;
                    }
//----------------------------------------------回单信息-----------------------------------------------
//----------------------------------------------------------------------------------------------------
                    if(rowInfo.data.receiptMethodCode!=1){

                    //回单状态 0.未收回、1.已收回 、2.已寄出、3、已接收、4.已返客户
                    //回单图片 receiptCol已收集1 receiptMail 2已寄出 receiptRec 3已返发站 receiptRt 4已返客户
                    Ext.Ajax.request({
                        url: opHostName + ‘/op/receiptBillCollect.do‘ + urlToken,
                        params: {
                            ‘uniteBillCode‘: rowInfo.data.uniteBillCode
                        },
                        success: function (response) {
                            var respText = Ext.JSON.decode(response.responseText);
                            if (respText.data == null) {
                                return;
                            }
                            var receiptForm = Ext.getCmp(‘Op_OpBillLineInfo_ReceiptBillCollectForm_ID‘).getForm();
                            var receiptModel = Ext.create(‘Op.OpBillLineInfo.RecBillCollectModel‘, respText.data);
                            receiptForm.loadRecord(receiptModel);

                            if(respText.data.status==1){
                                imgReceipt=‘,url(../../images/seal/receiptCol.png) 840px 0px no-repeat‘;
                            }else if(respText.data.status==2){
                                imgReceipt=‘,url(../../images/seal/receiptMail.png) 840px 0px no-repeat‘;
                            }else if(respText.data.status==3){
                                imgReceipt=‘,url(../../images/seal/receiptRec.png) 840px 0px no-repeat‘;
                            }else if(respText.data.status==4){
                                imgReceipt=‘,url(../../images/seal/receiptRt.png) 840px 0px no-repeat‘;
                            }
                                viewForm.setBodyStyle(‘background: ‘+imgSign+imgReceipt+imgRefund+imgSettle);
                            if (respText.data.openBillTime != null) {
                                receiptForm.findField(‘openBillTime‘).setValue(Ext.Date.format(new Date(respText.data.openBillTime), ‘Y-m-d H:i:s‘))
                            }
                            if (respText.data.signTime != null) {
                                receiptForm.findField(‘signTime‘).setValue(Ext.Date.format(new Date(respText.data.signTime), ‘Y-m-d H:i:s‘))
                            }
                            if (respText.data.inventoryEnterTime != null) {
                                receiptForm.findField(‘inventoryEnterTime‘).setValue(Ext.Date.format(new Date(respText.data.inventoryEnterTime), ‘Y-m-d H:i:s‘))
                            }
                            if (respText.data.modifyTime != null) {
                                receiptForm.findField(‘modifyTime‘).setValue(Ext.Date.format(new Date(respText.data.modifyTime), ‘Y-m-d H:i:s‘))
                            }
                            if (respText.data.backTime != null) {
                                receiptForm.findField(‘backTime‘).setValue(Ext.Date.format(new Date(respText.data.backTime), ‘Y-m-d H:i:s‘))
                            }
                        },
                        failure: function (response) {
                            Ext.ux.Toast.msg(‘提示‘, response.responseText, ‘error‘);
                        }
                    });

                    }
//----------------------------------------------记账信息-----------------------------------------------
//----------------------------------------------------------------------------------------------------
                   if(rowInfo.data.collectGoodsPrice!=0){
                    Ext.Ajax.request({
                        url: foHostName + ‘/fo/queryCashAccountList.do‘ + urlToken,
                        params: {
                            ‘uniteBillCode‘: rowInfo.data.uniteBillCode
                        },
                        success: function (response) {
                            var result = Ext.JSON.decode(response.responseText);
                            var grid = Ext.getCmp(‘Op_OpBillLineInfo_AccountGridPanel_ID‘).getStore();
                            if (!Ext.isEmpty(result.data)) {
                                grid.removeAll();
                                grid.add(result.data);

                                for(var j = 0,len = result.data.length; j < len; j++){

                                    if(result.data[j].status==1&&result.data[j].priceType==40){
                                       imgRefund=‘,url(../../images/seal/refund.png) 560px 0 no-repeat‘;
                                       break;
                                    }else{
                                       imgRefund=‘,url(../../images/seal/unrefund.png) 560px 0 no-repeat‘;
                                    }

                                    if(result.data[j].status==1&&(result.data[j].priceType==31||result.data[j].priceType==33||result.data[j].priceType==34||result.data[j].priceType==35||result.data[j].priceType==36)){
                                       imgSettle=‘,url(../../images/seal/tranceFeeSettle.png) 280px 0 no-repeat‘;
                                       break;
                                    }else if(result.data[j].priceType==31||result.data[j].priceType==33||result.data[j].priceType==34||result.data[j].priceType==35||result.data[j].priceType==36){
                                       imgSettle=‘,url(../../images/seal/tranceFeeUnSettle.png) 280px 0 no-repeat‘;
                                    }
                                }
                               viewForm.setBodyStyle(‘background: ‘+imgSign+imgReceipt+imgRefund+imgSettle);
                            }
                        },
                        failure: function (response) {
                            Ext.ux.Toast.msg(‘提示‘, response.responseText, ‘error‘);
                        }
                    });
                        }

                        viewForm.setBodyStyle(‘background: ‘+imgSign+imgReceipt+imgRefund+imgSettle);

                }
            }

原文地址:https://www.cnblogs.com/feifeicui/p/10620931.html

时间: 2024-08-02 22:58:32

Ext.js给form加背景图片的相关文章

ExtJs4学习(十三)如何给文件上传按钮加背景图片

我们日常看到的上传按钮都是这样的 当然browse是默认的,我们可以去改变它,比如替换成"上传",配置为buttonText: '上传', 如果我们想给按钮添加背景图片呢,你可能注意到了这个配置 buttonConfig { xtype: 'filefield', emptyText: 'Select an image', fieldLabel: 'Photo', name: 'photo-path', buttonText: '', buttonConfig: { iconCls:

js 定时更改div背景图片

今天遇到一个业务场景,使用js将一个div标签的背景图片定时更换一下. 之前百度了几个,有css+js,也有css3的,不过css3的兼容有问题,之后同事提示,可以使用js直接来更换div的北京图片,不使用css+ul+il的形式. 推荐的阅读https://blog.csdn.net/woyizhidouzai0505/article/details/41176565?utm_source=blogxgwz1 这个博客写的很好,用的也是这个方法. 下面写两种情况: 第一种是先规定几张图片,随机

js中预加载图片

由于网页的一些图片加载都需要很长时间,所以为了缓解图片加载慢的问题,页面可以先预加载图片,代码如下: /*预加载图片*/var imgList = []; var imgArr = ["bg02.gif","video_btm.jpg"]; for(var i=0;i<imgArr.length;i++){ var img = new Image(); img.src = imgArr[i]; imgList.push(img); }

Java--添加背景图片

package com.welcome; import java.awt.BorderLayout; import java.awt.Container; import java.awt.FlowLayout; import java.awt.Font; import java.awt.GridLayout; import java.awt.Image; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java

JS中如何设置背景图片?

方法一:  预先设置好一个样式,当用到的时候,只需要给这个对象添加一个类名就行了. eg: css中:.bj { background: url(star.jpg) no-repeat center; background-size: cover; } js中: oBox.className = "bj"; 方法二: 直接使用JS的元素属性style 1 oBox.style.backgroundImage = "url(star.jpg)";//设置背景图的的地址

js 动态设置 div 背景图片 并滚动显示

var imgs =["../img/index/bgstyle/style1/index_top_bg2.jpg", "../img/index/bgstyle/style1/index_top_bg3.jpg", "../img/index/bgstyle/style1/index_top_bg1.jpg"]; //(设定想要显示的图片) var i = 0; var head=document.getElementsByClassName(

js根据ID修改背景图片

<SCRIPT language=javascript> function expand(el) { var childObj = document.getElementById("child" + el); var box = document.getElementById("box"); if (childObj.style.display == 'none') { childObj.style.display = 'block'; box.styl

js设置随机切换背景图片

<script> var imgs =["http://images.cnblogs.com/cnblogs_com/xiaobo-Linux/1112236/o_2.jpg", "http://images.cnblogs.com/cnblogs_com/xiaobo-Linux/1112236/o_default.png", "http://images.cnblogs.com/cnblogs_com/xiaobo-Linux/111223

css网页中设置背景图片的方法详解

css网页中设置背景图片的方法详解 在css代码中设置背景图片的方法,包括背景图片.背景重复.背景固定.背景定位等 用css设置网页中的背景图片,主要有如下几个属性: 1,背景颜色 {background-color:数值}2,背景图片 {background-image: url(URL)|none}3,背景重复 {background-repeat:inherit|no-repeat|repeat|repeat-x|repeat-y}4,背景固定 {background-attachment