class: jsList
Data grid control.
Example
Below is an example of typical jsList class.
var projects = new top.jsList('projects', {
box: document.getElementById('list_demo'),
header: 'Projects',
showToolbar: true,
searches: [
{ caption: 'Approved', type: 'List', fieldName: 'proj_active = ~VALUE~' },
{ caption: 'Project Name', type: 'Text', fieldName: 'proj_name', inTag: 'size=40' },
{ caption: 'Project Description', type: 'Text', fieldName: 'proj_desc', inTag: 'size=40' },
{ caption: 'Band Name', type: 'Text', fieldName: 'band_name', inTag: 'size=40' },
{ caption: 'Location', type: 'Text', fieldName: 'proj_location', inTag: 'size=40' },
{ caption: 'Submitted', type: 'Date', fieldName: 'proj_submitted::DATE' },
{ caption: 'Amount', type: 'Int', fieldName: 'proj_price' }
],
columns: [
{ caption: 'Project', size: '50%', type: 'Text' },
{ caption: 'Band', size: '30%', type: 'Text' },
{ caption: 'Location', size: '20%', type: 'Text' },
{ caption: 'Amount', size: '60px', type: 'Text', attr: 'align=right' },
{ caption: 'Submitted', size: '90px', type: 'Text', attr: 'align=right' },
{ caption: 'Approved', size: '60px', type: 'Text', attr: 'align=center' }
],
controls: [
{ type: 'server', caption: 'Generate More', param: 'generate', img: 'add.png' },
{ type: 'break'},
{ type: 'add', caption: 'Add New' },
{ type: 'delete', caption: 'Delete' }
]
srvFile: 'index_srv.php',
onAddOrEdit: 'projectEdit',
});
projects.output();
See Also