extjs6中grid里放置图片

news/2024/7/24 3:49:35

1.加黑体的是实现代码,在view中操作

 

 

/**
 * Created by Wwei on 2017/7/1.
 */
Ext.define('Admin.view.userpanoram.UserPanoram', {
    extend: 'Ext.Panel',
    xtype: 'userpanoram',
    title: '我的工作室',

    requires: [
        'Admin.view.userpanoram.UserPanoramController',
        'Ext.button.Button'
    ],
    controller: "userpanoram",
    layout: {
        type: 'vbox',
        align: 'stretch'
    },

    items: [{
        xtype: 'form',
        reference: 'form',
        defaultButton: 'btn_search',
        layout: 'column',
        defaults: {
            labelAlign: 'right'
        },
        style: {
            margin: '12px 0px 0px -28px'
        },
        items: [{
            xtype: 'textfield',
            reference: 'viewUuid',
            fieldLabel: 'viewUuid',
            name: 'viewUuid'
        },{
            xtype: 'datefield',
            name: 'startTime',
            reference:'startTime',
            fieldLabel: '起始时间',
            labelWidth: 60,
            format: 'Y-m-d',
            editable: false
        }, {
            xtype: 'datefield',
            name: 'endTime',
            reference:'endTime',
            fieldLabel: '结束时间',
            labelWidth: 60,
            format: 'Y-m-d',
            editable: false
        }]
    }, {
        xtype: 'grid',
        sortableColumns: false,
        reference: 'grid',
        flex: 1,
        store: 'userpanoram.UserPanoram',
        columns: [{
            xtype: 'rownumberer'
        },{
            text: '主键',
            dataIndex: 'id',
            width: 50
        },{
            text: '用户id',
            dataIndex: 'userId',
            width: 50
        },{
            text: '图片id',
            dataIndex: 'panoramaId',
            width: 50
        },{
            text: 'newViewUuid',
            dataIndex: 'newViewUuid',
            width: 50
        },{
            text: 'ViewUuid',
            dataIndex: 'ViewUuid',
            width: 50
        },{
            text: '缩略图路径',
            dataIndex: 'thumbPath',
            width: 100,
            renderer: function (v) {
                return '<image style="width : 185px; height : 70px;" src="'+v+'" />'
            }
        }, {
            text: '名称',
            dataIndex: 'name',
            width: 100
        }, {
            text: '风格',
            dataIndex: 'style',
            width: 100
        }, {
            text: '户型',
            dataIndex: 'houseType',
            width: 100
        }, {
            text: '空间',
            dataIndex: 'space',
            width: 100
        },{
            text: '创建时间',
            dataIndex: 'createTime',
            width:100
        }],
        selModel: {
            selType: 'checkboxmodel'
        },
        dockedItems: [{
            xtype: 'toolbar',
            items: [ '->', {
                text: '查询',
                iconCls: 'fa fa-search',
                reference: 'btn_search',
                handler: 'search'
            }
             , {
                    text: '清空条件',
                    iconCls: 'fa fa-search',
                    listeners: {
                        click: 'reset'
                    }
                }]
        }, {
            xtype: 'pagingtoolbar',
            store: 'userpanoram.UserPanoram',
            dock: 'bottom',
            displayInfo: true
        }],
        listeners: {
            beforerender: 'gridBeforeRender',
            render: 'search'
        }
    }]
});

2.效果如图

 

转载于:https://www.cnblogs.com/Java-Starter/p/7229215.html


http://www.niftyadmin.cn/n/719380.html

相关文章

白话经典算法系列之五 归并排序的实现

归并排序是建立在归并操作上的一种有效的排序算法。该算法是採用分治法&#xff08;Divide and Conquer&#xff09;的一个很典型的应用。首先考虑下怎样将将二个有序数列合并。这个很easy&#xff0c;仅仅要从比較二个数列的第一个数&#xff0c;谁小就先取谁&#xff0c;取了…

JS实现的随机乱撞的彩色圆球特效代码

<!doctype html> <html lang"en"> <head><meta charset"UTF-8"><title>HTML5学习第5天[乱撞的球]</title><style>body{font-family: 微软雅黑; }body,h1{margin:0;}canvas{display:block;margin-left: auto;mar…

Python入门系列——第5篇

输入和格式说明符 在前面&#xff0c;我们所写过的所有程序中&#xff0c;没有出现过输入。现在&#xff0c;我们来学习一下输入函数。好了&#xff0c;具体请看代码。#python3 print("Hello") your_answer input() print("How old are you?") your_age …

来自MSDN的细菌觅食优化算法

http://msdn.microsoft.com/zh-cn/magazine/hh882453.aspx

React 性能优化技巧(纯干货)

本文篇幅较长&#xff0c;将从 编译阶段 -> 路由阶段 -> 渲染阶段 -> 细节优化 -> 状态管理 -> 海量数据源&#xff0c;长列表渲染 方向分别加以探讨。 一 不能输在起跑线上&#xff0c;优化babel配置,webpack配置为项 1 真实项目中痛点 当我们用create-rea…

Python基础-生成器

列表生成式&#xff1a;[f(x) for i in range(k)]&#xff1a;其中k是常数,f(x)是一个关于i的常数使用函数实现生成器&#xff1a;def fib(max):n,a,b 0,0,1while n<max:yield b #关键 yield具有保持值&#xff0c;并通过生成器的__next__()方法返回a,b b,abn 1return…

kbone-多端统一开发工具(小程序)

kbone 是一个致力于微信小程序和 Web 端同构的解决方案。 简介 微信小程序的底层模型和 Web 端不同&#xff0c;我们想直接把 Web 端的代码挪到小程序环境内执行是不可能的。kbone 的诞生就是为了解决这个问题&#xff0c;它实现了一个适配器&#xff0c;在适配层里模拟出了浏…

HTML meta 标签

2019独角兽企业重金招聘Python工程师标准>>> <!DOCTYPE html> <html> <meta http-equiv"Content-Type" content"text/html; charsetutf-8" /> <body> <form name”login” action”login.php” methodpost> 用户…