UNPKG

jqwidgets-scripts-custom

Version:

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

89 lines (83 loc) 4.84 kB
<!DOCTYPE html> <html lang="en"> <head> <title id='Description'>Grid Custom Elemenet CustomizedEditors</title> <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" /> <meta name="description" content="This is an example of a Custom Elemenet Grid with a customized editor." /> <link rel="stylesheet" href="../../../jqwidgets/styles/jqx.base.css" type="text/css" /> <link rel="stylesheet" href="../../../styles/demos.css" type="text/css" /> <script type="text/javascript" src="../../../scripts/webcomponents-lite.min.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxcore.elements.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/jqxmenu.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxgrid.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxgrid.selection.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxgrid.pager.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxlistbox.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxgrid.edit.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxdropdownlist.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxcombobox.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxpanel.js"></script> <script type="text/javascript" src="../../../scripts/demos.js"></script> <script type="text/javascript"> var source = { datatype: 'xml', datafields: [ { name: 'ShippedDate', map: 'm\\:properties>d\\:ShippedDate', type: 'date' }, { name: 'Freight', map: 'm\\:properties>d\\:Freight', type: 'float' }, { name: 'ShipName', map: 'm\\:properties>d\\:ShipName', type: 'string' }, { name: 'ShipAddress', map: 'm\\:properties>d\\:ShipAddress', type: 'string' }, { name: 'ShipCity', map: 'm\\:properties>d\\:ShipCity', type: 'string' }, { name: 'ShipCountry', map: 'm\\:properties>d\\:ShipCountry', type: 'string' } ], root: 'entry', record: 'content', id: 'm\\:properties>d\\:OrderID', url: '../../sampledata/orders.xml' }; var ordersAdapter = new jqx.dataAdapter(source); JQXElements.settings['gridSettings'] = { source: ordersAdapter, selectionmode: 'singlecell', editable: true, pageable: true, autoheight: true, columns: [ { text: 'Ship City', datafield: 'ShipCity', width: 150, columntype: 'combobox', createeditor: (row, column, editor) => { var list = ['Stuttgart', 'Rio de Janeiro', 'Strasbourg']; editor.jqxComboBox({ autoDropDownHeight: true, source: list, promptText: 'Please Choose:' }); }, cellvaluechanging: (row, column, columntype, oldvalue, newvalue) => { if (newvalue == '') return oldvalue; } }, { text: 'Ship Country', datafield: 'ShipCountry', width: 150, columntype: 'dropdownlist', createeditor: (row, column, editor) => { var list = ['Germany', 'Brazil', 'France']; editor.jqxDropDownList({ autoDropDownHeight: true, source: list }); }, cellvaluechanging: (row, column, columntype, oldvalue, newvalue) => { if (newvalue == '') return oldvalue; } }, { text: 'Ship Name', datafield: 'ShipName', columntype: 'combobox' } ] } </script> </head> <body> <div class="example-description"> This example shows how to customize the Custom element Grid editors. </div> <jqx-grid settings="gridSettings"></jqx-grid> </body> </html>