EasyUI Forum
September 13, 2025, 04:41:39 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: DataGrid  (Read 6606 times)
ehussain
Newbie
*
Posts: 16


View Profile Email
« on: January 01, 2015, 02:22:10 AM »

Can we show [ sound.wav ] file in DataGrid and play?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 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>';
            }
        }
    ]]
})
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!