EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: ehussain on January 01, 2015, 02:22:10 AM



Title: DataGrid
Post by: ehussain on January 01, 2015, 02:22:10 AM
Can we show [ sound.wav ] file in DataGrid and play?


Title: Re: DataGrid
Post by: jarry on January 01, 2015, 08:33:13 AM
Use the 'formatter' function and you will be able to attach an '<audio>' element to the datagrid column.
Code:
$('#dg').datagrid({
    columns:[[
        {field:'itemid',title:'ItemID',width:100},
        {field:'productid',title:'ProductID',width:100},
        {field:'audio',title:'Audio',width:200,
            formatter:function(value,row){
                return '<audio controls>' +
                    '<source src="test.mp3">'+
                    '</audio>';
            }
        }
    ]]
})