UNPKG

jqwidgets-scripts-custom

Version:

jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.

58 lines (55 loc) 2.69 kB
<!DOCTYPE html> <html lang="en"> <head> <title id="Description">Data Binding to TSV data in jqxDataTable</title> <meta name="description" content="This sample demonstrates how we can bind jQWidgets DataTable widget to TSV Data by using jQWidgets DataAdapter plugin."> <link rel="stylesheet" href="../../../jqwidgets/styles/jqx.base.css" type="text/css" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1" /> <script type="text/javascript" src="../../../scripts/jquery-1.12.4.min.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxdata.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxbuttons.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxscrollbar.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxdatatable.js"></script> <script type="text/javascript" src="../../../scripts/demos.js"></script> <script type="text/javascript"> $(document).ready(function () { var url = '../../sampledata/homeprices.txt'; // prepare the data var source = { datatype: "tab", datafields: [ { name: 'Year', type: 'int' }, { name: 'HPI', type: 'float' }, { name: 'BuildCost', type: 'float' }, { name: 'Population', type: 'float' }, { name: 'Rate', type: 'float' } ], url: url }; var dataAdapter = new $.jqx.dataAdapter(source); $("#dataTable").jqxDataTable( { width: getWidth("dataTable"), pageable: true, pagerButtonsCount: 10, source: dataAdapter, columnsResize: true, columns: [ { text: 'Year', dataField: 'Year', width: 200 }, { text: 'HPI', dataField: 'HPI', cellsFormat: 'f2', width: 200 }, { text: 'Build Cost', dataField: 'BuildCost', cellsFormat: 'f2', width: 180 }, { text: 'Population', dataField: 'Population', cellsFormat: 'f2', width: 100 }, { text: 'Rate', dataField: 'Rate', cellsFormat: 'f5'} ] }); }); </script> </head> <body class='default'> <div id='dataTable'> </div> </body> </html>