EXT gridPanel 添加图片

var workAreaGrid = new Ext.grid.GridPanel({

            region: 'west',

            title: '工作面预警结果',

            store: wkSto,

            width: 500,

            split: true,

            margins: "0 3 0 0",

            stripeRows: true,

            autoExpandColumn: '4',

            //            loadMask: {

            //                msg: '正在加载数据,请稍侯……'

            //            },

            columns: [new Ext.grid.RowNumberer(), {

                header: 'ID',

                hidden: true,

                width: 0,

                dataIndex: 'ID'

            },

            {

                header: 'intClassBJ',

                hidden: true,

                width: 0,

                dataIndex: 'BJ'

            },

            {

                header: 'intClassYJ',

                hidden: true,

                width: 0,

                dataIndex: 'YJ'

            },

            {

                header: '工作面名称',

                width: 120,

                dataIndex: 'chrWorName'

            },

            {

                header: '时间',

                width: 100,

                dataIndex: 'date'

            },

            {

                header: '采掘工艺',

                width: 100,

                dataIndex: 'GX'

            },

            {

                header: '状态预警',

                width: 100,

                dataIndex: 'intClassBJ',

                renderer: function (record) {

                    var str;

                    switch (record.toString()) {

                        case "0": str = "<img src=\"SubSystem/WSFT_System/resources/Imgs/0.jpg\"/>";

                            break;

                        case "1": str = "<img src=\"SubSystem/WSFT_System/resources/Imgs/1.jpg\"/>";

                            break;

                        case "2": str = "<img src=\"SubSystem/WSFT_System/resources/Imgs/2.jpg\"/>";

                            break;

                    }

                    return str;

                }

            },

            {

                header: '趋势预警',

                width: 100,

                dataIndex: 'intClassBJ',

                renderer: function (record) {

                    var str;

                    switch (record.toString()) {

                        case "0": str = "<img src=\"SubSystem/WSFT_System/resources/Imgs/0j.jpg\"/>";

                            break;

                        case "1": str = "<img src=\"SubSystem/WSFT_System/resources/Imgs/1j.jpg\"/>";

                            break;

                        case "2": str = "<img src=\"SubSystem/WSFT_System/resources/Imgs/2j.jpg\"/>";

                            break;

                    }

                    

                    return str;

                }

            }],

            listeners: {

                celldblclick: function (grid, rowIndex, record) {



                    //alert(record.toString());

                }

            }

        });

 

你可能感兴趣的:(gridPanel)