W2UI Demo: grid-23
by Yohan Yang
HTML
<script src="http://rawgit.com/vitmalina/w2ui/master/dist/w2ui.min.js"></script>
<link rel="stylesheet" href="http://rawgit.com/vitmalina/w2ui/master/dist/w2ui.min.css">
<div id="grid" style="width: 100%; height: 400px;"></div>
JavaScript
$(function () {
$('#grid').w2grid({
name: 'grid',
columns: [
{ field: 'fname', caption: 'Full Name', size: '200px',
render: function (record, index, column_index) {
var html = '<div>'+ record.fname + ' ' + record.lname + '</div>';
return html;
},
sortable: true
},
{ field: 'email', caption: 'Email', size: '100%' },
{ field: 'profit',caption: 'Profit', size: '120px', render: 'money' },
{ field: 'sdate', caption: 'Start Date', size: '120px', render: 'date' }
],
records: [
{ recid: 1, fname: '요한', lname: '양', email: '[email protected]', profit: 2500, sdate: '1/3/2012' },
{ recid: 2, fname: 'Stuart', lname: 'Motzart', email: '[email protected]', profit: 1004, sdate: '4/13/2012' },
{ recid: 3, fname: 'Jin', lname: 'Franson', email: '[email protected]', profit: 473, sdate: '3/3/2012' },
{ recid: 4, fname: 'Susan', lname: 'Ottie', email: '[email protected]', profit: 304, sdate: '5/3/2012' },
{ recid: 5, fname: 'Kelly', lname: 'Silver', email: '[email protected]', profit: 9300, sdate: '8/19/2012' },
{ recid: 6, fname: 'Francis', lname: 'Gatos', email: '[email protected]', sdate: '6/12/2012' },
{ recid: 7, fname: 'Mark', lname: 'Welldo', email: '[email protected]', profit: 3400, sdate: '8/13/2012' },
{ recid: 8, fname: 'Thomas', lname: 'Bahh', email: '[email protected]', profit: 2030, sdate: '4/31/2012' },
{ recid: 10, fname: 'John', lname: 'Doe', email: '[email protected]', profit: 13004, sdate: '1/3/2012' },
{ recid: 12, fname: 'Stuart', lname: 'Motzart', email: '[email protected]', sdate: '4/13/2012' },
{ recid: 13, fname: 'Jin', lname: 'Franson', email: '[email protected]', profit: 4043, sdate: '3/3/2012' },
{ recid: 14, fname: 'Susan', lname: 'Ottie',...