EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: skogkatt on December 26, 2014, 02:01:06 AM



Title: add icon column in a Combogrid
Post by: skogkatt on December 26, 2014, 02:01:06 AM
is it possible to add a random column and put an icon or a linkbutton ?  ???


Title: Re: add icon column in a Combogrid
Post by: stworthy on December 26, 2014, 06:47:05 AM
You may need to describe your question in more details. If you want to format a specified column, please use the 'formatter' function to custom its appearance.


Title: Re: add icon column in a Combogrid
Post by: skogkatt on December 29, 2014, 01:02:48 PM
Thank's stworthy for the reply  :D

Basically this is my code :

   <select class="easyui-combogrid" style="width:300px" data-options="
         panelWidth: 300,
         multiple: false,
         idField: 'Nom',
         textField: 'Libelle',
         url: 'datagrid_data1.json',
         method: 'get',
         columns: [[
            {field:'id',title:'ID',width:100},
            {field:'Nom',title:'Name',width:340},
         ]],
         fitColumns: true
      ">
   </select>

so i want to add a column in the combogrid witch i can put an icon in each record in my list to show the status of this record for example.

Another question : How can i use the formatter ?

Thank's


Title: Re: add icon column in a Combogrid
Post by: stworthy on December 29, 2014, 06:21:59 PM
Please try this:
Code:
columns: [[
{field:'id',title:'ID',width:100},
{field:'Nom',title:'Name',width:340},
{field:'status',title:'Status',width:80,
formatter:function(value,row){
return '<img src="..."/>';
}
}
]],


Title: Re: add icon column in a Combogrid
Post by: skogkatt on December 30, 2014, 02:15:20 AM
No, it's not working  :-[