UNPKG

jqwidgets-scripts-custom

Version:

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

79 lines (74 loc) 3.79 kB
<!DOCTYPE html> <html lang="en"> <head> <title id='Description'>In this example, the first Grid column is pinned and will be always visible while scrolling.</title> <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/jqxlistbox.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxdropdownlist.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxmenu.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxgrid.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxgrid.sort.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxgrid.pager.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxgrid.selection.js"></script> <script type="text/javascript" src="../../../scripts/demos.js"></script> <script type="text/javascript"> $(document).ready(function () { var url = "../../sampledata/products.xml"; // prepare the data var source = { datatype: "xml", datafields: [ { name: 'ProductName' }, { name: 'QuantityPerUnit' }, { name: 'UnitPrice', type: 'float' }, { name: 'UnitsInStock', type: 'float' }, { name: 'UnitsOnOrder', type: 'float' }, { name: 'ReorderLevel', type: 'float' }, { name: 'CategoryID', type: 'int' } ], root: "Products", record: "Product", id: 'ProductID', url: url }; var categories = {}; var categoriesurl = '../../sampledata/categories.xml'; $.ajax({ async: false, url: categoriesurl, success: function (data, status, xhr) { categories = $("Category", data); } }); $("#grid").jqxGrid( { width: getWidth('Grid'), source: source, sortable: true, pageable: true, autoheight: true, columns: [ { text: 'Product Name', datafield: 'ProductName', width: 250, pinned: true }, { text: 'Category', datafield: 'CategoryID', width: 120, cellsalign: 'right' }, { text: 'Quantity Per Unit', datafield: 'QuantityPerUnit', width: 200, cellsalign: 'right' }, { text: 'Unit Price', datafield: 'UnitPrice', width: 120, cellsformat: 'c2', cellsalign: 'right' }, { text: 'Units On Order', datafield: 'UnitsOnOrder', width: 120, cellsalign: 'right' }, { text: 'Reorder Level', datafield: 'ReorderLevel', width: 120, cellsalign: 'right' } ] }); }); </script> </head> <body class='default'> <div id="grid"> </div> </body> </html>