display image in a grid using extjs

前端 未结 7 1099
囚心锁ツ
囚心锁ツ 2020-12-30 08:19

I am new to extjs. I want to display icon images for each grid elements. can you please help me anybody?

I am getting the image path from an xml file.

My cod

7条回答
  •  我在风中等你
    2020-12-30 08:59

    You need to add a renderer to your columns that you want to display an image. The renderer value is the function to call to render the image tag.

    One of your column elements modified:

    {header: "Photo", width: 100, renderer:renderIcon, dataIndex: 'form-file', sortable: true},
    

    A sample renderer function:

    function renderIcon(val) {
        return '';
    }
    

    In this example, the value of the dataIndex must be the full path of the image. If not then you must add some additional logic.

提交回复
热议问题