Name | Type | Default | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
altRows | Boolean | false | ||||||||||||
Sets or gets whether the jqxDataTable automatically alternates row colors. Code examples
Set the
Get the
Try it: altRows is set to true
|
||||||||||||||
autoRowHeight | Boolean | true | ||||||||||||
Sets or gets whether the jqxDataTable automatically calculates the rows height and wraps the cell text. Code examples
Set the
Get the
Try it: autoRowHeight is set to false
|
||||||||||||||
aggregatesHeight | Number | 34 | ||||||||||||
Sets or gets the height of the aggregates bar. Aggregates bar is displayed after setting Code examples
Set the
Get the
Try it: aggregatesHeight is set to 40
|
||||||||||||||
autoShowLoadElement | Boolean | true | ||||||||||||
Sets or gets whether the loading html element with animated gif is automatically displayed by the widget during the data binding process. Code examples
Set the
Get the
|
||||||||||||||
columnsHeight | Number | 30 | ||||||||||||
Sets or gets the height of the columns header. Code examples
Set the
Get the
Try it: columnsHeight is set to 20
|
||||||||||||||
columns | Array | [] | ||||||||||||
Sets the jqxDataTable's columns. List of properties:
Code examples
Set the $("#table").jqxDataTable({ altrows: true, sortable: true, columns: [ { text: 'First Name', dataField: 'First Name', width: 100 }, { text: 'Last Name', dataField: 'Last Name', width: 100 }, { text: 'Product', dataField: 'Product', width: 180 }, { text: 'Unit Price', dataField: 'Price', width: 90, align: 'right', cellsAlign: 'right', cellsFormat: 'c2' }, { text: 'Quantity', dataField: 'Quantity', width: 80, align: 'right', cellsAlign: 'right' } ]});
Try it: columns is set to a custom array
|
||||||||||||||
columnGroups | Array | [] | ||||||||||||
Sets the jqxDataTable's column groups. The columnGroups property enables you to create a jqxDataTable with multi column headers. List of properties:
Code examples
Set the // prepare the datavar source ={ dataType: "xml", dataFields: [ { name: 'SupplierName', type: 'string' }, { name: 'Quantity', type: 'number' }, { name: 'OrderDate', type: 'date' }, { name: 'OrderAddress', type: 'string' }, { name: 'Freight', type: 'number' }, { name: 'Price', type: 'number' }, { name: 'City', type: 'string' }, { name: 'ProductName', type: 'string' }, { name: 'Address', type: 'string' } ], url: '../sampledata/orderdetailsextended.xml', root: 'DATA', record: 'ROW'};var dataAdapter = new $.jqx.dataAdapter(source, { loadComplete: function () { }});// create jqxDataTable.$("#dataTable").jqxDataTable({ width: 690, height: 400, source: dataAdapter, pageable: true, altRows: true, columnsResize: true, columns: [ { text: 'Supplier Name', cellsAlign: 'center', align: 'center', dataField: 'SupplierName', width: 110 }, { text: 'Name', columngroup: 'ProductDetails', cellsAlign: 'center', align: 'center', dataField: 'ProductName', width: 120 }, { text: 'Quantity', columngroup: 'ProductDetails', dataField: 'Quantity', cellsFormat: 'd', cellsAlign: 'center', align: 'center', width: 80 }, { text: 'Freight', columngroup: 'OrderDetails', dataField: 'Freight', cellsFormat: 'd', cellsAlign: 'center', align: 'center', width: 100 }, { text: 'Order Date', columngroup: 'OrderDetails', cellsAlign: 'center', align: 'center', cellsFormat: 'd', dataField: 'OrderDate', width: 100 }, { text: 'Order Address', columngroup: 'OrderDetails', cellsAlign: 'center', align: 'center', dataField: 'OrderAddress', width: 100 }, { text: 'Price', columngroup: 'ProductDetails', dataField: 'Price', cellsFormat: 'c2', align: 'center', cellsAlign: 'center', width: 70 }, { text: 'Address', columngroup: 'Location', cellsAlign: 'center', align: 'center', dataField: 'Address', width: 120 }, { text: 'City', columngroup: 'Location', cellsAlign: 'center', align: 'center', dataField: 'City', width: 80 } ], columnGroups: [ { text: 'Product Details', align: 'center', name: 'ProductDetails' }, { text: 'Order Details', parentGroup: 'ProductDetails', align: 'center', name: 'OrderDetails' }, { text: 'Location', align: 'center', name: 'Location' } ]}); |
||||||||||||||
columnsResize | Boolean | false | ||||||||||||
Sets or gets the jqxDataTable's columnsResize. Code examples
Set the
Get the
Try it: columnsResize is set to true
|
||||||||||||||
columnsReorder | Boolean | false | ||||||||||||
Sets or gets the jqxDataTable's columnsReorder. Code examples
Set the
Get the
Try it: columnsReorder is set to true
|
||||||||||||||
disabled | Boolean | false | ||||||||||||
Sets or gets whether the jqxDataTable is disabled. Code examples
Set the
Get the
Try it: disabled is set to true
|
||||||||||||||
editable | Boolean | false | ||||||||||||
Sets or gets whether the jqxDataTable editing is enabled. Code examples
Set the
Get the
Try it: editable is set to true
|
||||||||||||||
editSettings | Object | { saveOnPageChange: true, saveOnBlur: true, saveOnSelectionChange: true, cancelOnEsc: true, saveOnEnter: true, editSingleCell: false, editOnDoubleClick: true, editOnF2: true } | ||||||||||||
Sets or gets the jqxDataTable's edit settings. Code examples
Set the
Get the
|
||||||||||||||
exportSettings | Object | { columnsHeader: true, hiddenColumns: false, serverURL: null, characterSet: null, recordsInView: true, fileName: "jqxDataTable"} | ||||||||||||
Determines the Data Export settings used by jqxDataTable when
Code example
Set the
Get the
|
||||||||||||||
enableHover | Boolean | true | ||||||||||||
Sets or gets whether row highlighting is enabled. Code examples
Set the
Get the
Try it: enableHover is set to false
|
||||||||||||||
enableBrowserSelection | Boolean | false | ||||||||||||
Enables or disables the default text selection of the web browser. Code examples
Set the
Get the
|
||||||||||||||
filterable | Boolean | false | ||||||||||||
Enables/Disables the filtering feature. Code examples
Set the
Get the
Try it: filterable is set to true
|
||||||||||||||
filterHeight | Number | 30 | ||||||||||||
Sets or gets the Filter Element's height. Code examples
Set the
Get the
Try it: filterHeight is set to 35
|
||||||||||||||
filterMode | String | "default" | ||||||||||||
Determines the Filter's mode. Possible values: Code examples
Set the
Get the
Try it: filterMode is set to "advanced"
|
||||||||||||||
groups | Array | [] | ||||||||||||
Sets or gets the jqxDataTable's data groups. Set this property if you want to display the data grouped by a set of column(s). Code examples
Set the <!DOCTYPE html><html lang="en"><head> <title id="Description">Data Grouping in jqxDataTable</title> <meta name="description" content="This sample demonstrates how we can Group Data by using jQWidgets DataTable."> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.11.1.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 () { // prepare the data var source = { dataType: "xml", dataFields: [ { name: 'SupplierName', type: 'string' }, { name: 'Quantity', type: 'number' }, { name: 'OrderDate', type: 'date' }, { name: 'OrderAddress', type: 'string' }, { name: 'Freight', type: 'number' }, { name: 'Price', type: 'number' }, { name: 'City', type: 'string' }, { name: 'ProductName', type: 'string' }, { name: 'Address', type: 'string' } ], url: '../sampledata/orderdetailsextended.xml', root: 'DATA', record: 'ROW' }; var dataAdapter = new $.jqx.dataAdapter(source, { loadComplete: function () { // data is loaded. } }); // create jqxDataTable. $("#dataTable").jqxDataTable( { source: dataAdapter, pageable: true, altRows: true, sortable: true, groups: ['SupplierName'], width: 660, groupsRenderer: function(value, rowData, level) { return "Supplier Name: " + value; }, columns: [ { text: 'Supplier Name', hidden: true, cellsAlign: 'left', align: 'left', dataField: 'SupplierName', width: 180}, { text: 'Product Name', cellsAlign: 'left', align: 'left', dataField: 'ProductName', width: 150 }, { text: 'Quantity', dataField: 'Quantity', cellsformat: 'd', cellsAlign: 'right', align: 'right', width: 80 }, { text: 'Price', dataField: 'Price', cellsformat: 'c2', align: 'right', cellsAlign: 'right', width: 70 }, { text: 'Address', cellsAlign: 'center', align: 'center', dataField: 'Address', width: 250 }, { text: 'City', cellsAlign: 'center', align: 'center', dataField: 'City' } ] }); }); </script></head><body class='default'> <div id="dataTable"></div></body></html>
Get the
Try it: groups is set to 'firstname'
|
||||||||||||||
groupsRenderer | Function | null | ||||||||||||
Callback function which allows you to customize the rendering of the group headers. Code examples
Set the <!DOCTYPE html><html lang="en"><head> <title id="Description">Data Grouping in jqxDataTable</title> <meta name="description" content="This sample demonstrates how we can Group Data by using jQWidgets DataTable."> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.11.1.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 () { // prepare the data var source = { dataType: "xml", dataFields: [ { name: 'SupplierName', type: 'string' }, { name: 'Quantity', type: 'number' }, { name: 'OrderDate', type: 'date' }, { name: 'OrderAddress', type: 'string' }, { name: 'Freight', type: 'number' }, { name: 'Price', type: 'number' }, { name: 'City', type: 'string' }, { name: 'ProductName', type: 'string' }, { name: 'Address', type: 'string' } ], url: '../sampledata/orderdetailsextended.xml', root: 'DATA', record: 'ROW' }; var dataAdapter = new $.jqx.dataAdapter(source, { loadComplete: function () { // data is loaded. } }); // create jqxDataTable. $("#dataTable").jqxDataTable( { source: dataAdapter, pageable: true, altRows: true, sortable: true, groups: ['SupplierName'], width: 660, groupsRenderer: function(value, rowData, level) { return "Supplier Name: " + value; }, columns: [ { text: 'Supplier Name', hidden: true, cellsAlign: 'left', align: 'left', dataField: 'SupplierName', width: 180}, { text: 'Product Name', cellsAlign: 'left', align: 'left', dataField: 'ProductName', width: 150 }, { text: 'Quantity', dataField: 'Quantity', cellsformat: 'd', cellsAlign: 'right', align: 'right', width: 80 }, { text: 'Price', dataField: 'Price', cellsformat: 'c2', align: 'right', cellsAlign: 'right', width: 70 }, { text: 'Address', cellsAlign: 'center', align: 'center', dataField: 'Address', width: 250 }, { text: 'City', cellsAlign: 'center', align: 'center', dataField: 'City' } ] }); }); </script></head><body class='default'> <div id="dataTable"></div></body></html>
Get the
|
||||||||||||||
height | Number/String | null | ||||||||||||
Sets or gets the jqxDataTable's height. Code examples
Set the
Get the
Try it: height is set to 350
|
||||||||||||||
initRowDetails | Function | null | ||||||||||||
Callback function which is used for initialization of the expanded row's details. The function is called just once when the row is expanded for first time. List of parameters:
If initRowDetails returns false, the row's details would be collapsed and the row's expand/collapse toggle button would be hidden.
Code examples
Set the <!DOCTYPE html><html lang="en"><head> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.11.1.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/jqxmenu.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdatatable.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxtabs.js"></script> <script type="text/javascript" src="../../scripts/demos.js"></script> <script type="text/javascript"> $(document).ready(function () { // prepare the data var data = new Array(); var firstNames = ["Nancy", "Andrew", "Janet", "Margaret", "Steven", "Michael", "Robert", "Laura", "Anne"]; var lastNames = ["Davolio", "Fuller", "Leverling", "Peacock", "Buchanan", "Suyama", "King", "Callahan", "Dodsworth"]; var titles = ["Sales Representative", "Vice President, Sales", "Sales Representative", "Sales Representative", "Sales Manager", "Sales Representative", "Sales Representative", "Inside Sales Coordinator", "Sales Representative"]; var titleofcourtesy = ["Ms.", "Dr.", "Ms.", "Mrs.", "Mr.", "Mr.", "Mr.", "Ms.", "Ms."]; var birthdate = ["08-Dec-48", "19-Feb-52", "30-Aug-63", "19-Sep-37", "04-Mar-55", "02-Jul-63", "29-May-60", "09-Jan-58", "27-Jan-66"]; var hiredate = ["01-May-92", "14-Aug-92", "01-Apr-92", "03-May-93", "17-Oct-93", "17-Oct-93", "02-Jan-94", "05-Mar-94", "15-Nov-94"]; var address = ["507 - 20th Ave. E. Apt. 2A", "908 W. Capital Way", "722 Moss Bay Blvd.", "4110 Old Redmond Rd.", "14 Garrett Hill", "Coventry House", "Miner Rd.", "Edgeham Hollow", "Winchester Way", "4726 - 11th Ave. N.E.", "7 Houndstooth Rd."]; var city = ["Seattle", "Tacoma", "Kirkland", "Redmond", "London", "London", "London", "Seattle", "London"]; var postalcode = ["98122", "98401", "98033", "98052", "SW1 8JR", "EC2 7JR", "RG1 9SP", "98105", "WG2 7LT"]; var country = ["USA", "USA", "USA", "USA", "UK", "UK", "UK", "USA", "UK"]; var homephone = ["(206) 555-9857", "(206) 555-9482", "(206) 555-3412", "(206) 555-8122", "(71) 555-4848", "(71) 555-7773", "(71) 555-5598", "(206) 555-1189", "(71) 555-4444"]; var notes = ["Education includes a BA in psychology from Colorado State University in 1970. She also completed 'The Art of the Cold Call.' Nancy is a member of Toastmasters International.", "Andrew received his BTS commercial in 1974 and a Ph.D. in international marketing from the University of Dallas in 1981. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager in January 1992 and to vice president of sales in March 1993. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.", "Janet has a BS degree in chemistry from Boston College (1984). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate in 1991 and promoted to sales representative in February 1992.", "Margaret holds a BA in English literature from Concordia College (1958) and an MA from the American Institute of Culinary Arts (1966). She was assigned to the London office temporarily from July through November 1992.", "Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree in 1976. Upon joining the company as a sales representative in 1992, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London. He was promoted to sales manager in March 1993. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management.' He is fluent in French.", "Michael is a graduate of Sussex University (MA, economics, 1983) and the University of California at Los Angeles (MBA, marketing, 1986). He has also taken the courses 'Multi-Cultural Selling' and 'Time Management for the Sales Professional.' He is fluent in Japanese and can read and write French, Portuguese, and Spanish.", "Robert King served in the Peace Corps and traveled extensively before completing his degree in English at the University of Michigan in 1992, the year he joined the company. After completing a course entitled 'Selling in Europe,' he was transferred to the London office in March 1993.", "Laura received a BA in psychology from the University of Washington. She has also completed a course in business French. She reads and writes French.", "Anne has a BA degree in English from St. Lawrence College. She is fluent in French and German."]; var k = 0; for (var i = 0; i < firstNames.length; i++) { var row = {}; row["firstname"] = firstNames[k]; row["lastname"] = lastNames[k]; row["title"] = titles[k]; row["titleofcourtesy"] = titleofcourtesy[k]; row["birthdate"] = birthdate[k]; row["hiredate"] = hiredate[k]; row["address"] = address[k]; row["city"] = city[k]; row["postalcode"] = postalcode[k]; row["country"] = country[k]; row["homephone"] = homephone[k]; row["notes"] = notes[k]; data[i] = row; k++; } var source = { localData: data, dataType: "array" }; // initialize the row details. var initRowDetails = function (id, row, element, rowinfo) { var tabsdiv = null; var information = null; var notes = null; // update the details height. rowinfo.detailsHeight = 200; element.append($("<div style='margin: 10px;'><ul style='margin-left: 30px;'><li class='title'>Title</li><li>Notes</li></ul><div class='information'></div><div class='notes'></div></div>")); tabsdiv = $(element.children()[0]); if (tabsdiv != null) { information = tabsdiv.find('.information'); notes = tabsdiv.find('.notes'); var title = tabsdiv.find('.title'); title.text(row.firstname); var container = $('<div style="margin: 5px;"></div>') container.appendTo($(information)); var photocolumn = $('<div style="float: left; width: 15%;"></div>'); var leftcolumn = $('<div style="float: left; width: 45%;"></div>'); var rightcolumn = $('<div style="float: left; width: 40%;"></div>'); container.append(photocolumn); container.append(leftcolumn); container.append(rightcolumn); var photo = $("<div class='jqx-rc-all' style='margin: 10px;'><b>Photo:</b></div>"); var image = $("<div style='margin-top: 10px;'></div>"); var imgurl = '../../images/' + row.firstname.toLowerCase() + '.png'; var img = $('<img height="60" src="' + imgurl + '"/>'); image.append(img); image.appendTo(photo); photocolumn.append(photo); var firstname = "<div style='margin: 10px;'><b>First Name:</b> " + row.firstname + "</div>"; var lastname = "<div style='margin: 10px;'><b>Last Name:</b> " + row.lastname + "</div>"; var title = "<div style='margin: 10px;'><b>Title:</b> " + row.title + "</div>"; var address = "<div style='margin: 10px;'><b>Address:</b> " + row.address + "</div>"; $(leftcolumn).append(firstname); $(leftcolumn).append(lastname); $(leftcolumn).append(title); $(leftcolumn).append(address); var postalcode = "<div style='margin: 10px;'><b>Postal Code:</b> " + row.postalcode + "</div>"; var city = "<div style='margin: 10px;'><b>City:</b> " + row.city + "</div>"; var phone = "<div style='margin: 10px;'><b>Phone:</b> " + row.homephone + "</div>"; var hiredate = "<div style='margin: 10px;'><b>Hire Date:</b> " + row.hiredate + "</div>"; $(rightcolumn).append(postalcode); $(rightcolumn).append(city); $(rightcolumn).append(phone); $(rightcolumn).append(hiredate); var notescontainer = $('<div style="white-space: normal; margin: 5px;"><span>' + row.notes + '</span></div>'); $(notes).append(notescontainer); $(tabsdiv).jqxTabs({ width: 600, height: 170 }); } } var dataAdapter = new $.jqx.dataAdapter(source); $("#dataTable").jqxDataTable( { width: 632, source: dataAdapter, pageable: true, pageSize: 3, rowDetails: true, sortable: true, ready: function () { // expand the first details. $("#dataTable").jqxDataTable('showDetails', 0); }, initRowDetails: initRowDetails, columns: [ { text: 'First Name', dataField: 'firstname', width: 100 }, { text: 'Last Name', dataField: 'lastname', width: 100 }, { text: 'Title', dataField: 'title', width: 180 }, { text: 'City', dataField: 'city', width: 100 }, { text: 'Country', dataField: 'country'} ] }); }); </script></head><body class='default'> <div id="dataTable"></div></body></html>
Get the
|
||||||||||||||
incrementalSearch | Boolean | true | ||||||||||||
Determines whether the incremental search is enabled. The feature allows you to quickly find and select data records by typing when the widget is on focus. Code examples
Set the
Get the
|
||||||||||||||
localization | Object | default localization strings. | ||||||||||||
Applies a localization to the jqxDataTable's Strings. Default localization object:{ // separator of parts of a date (e.g. '/' in 11/05/1955) '/': "/", // separator of parts of a time (e.g. ':' in 05:44 PM) ':': ":", // the first day of the week (0 = Sunday, 1 = Monday, etc) firstDay: 0, days: { // full day names names: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // abbreviated day names namesAbbr: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // shortest day names namesShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] }, months: { // full month names (13 months for lunar calendards -- 13th month should be "" if not lunar) names: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""], // abbreviated month names namesAbbr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""] }, // AM and PM designators in one of these forms: // The usual view, and the upper and lower case versions // [standard,lowercase,uppercase] // The culture does not use AM or PM (likely all standard date formats use 24 hour time) // null AM: ["AM", "am", "AM"], PM: ["PM", "pm", "PM"], eras: [ // eras in reverse chronological order. // name: the name of the era in this culture (e.g. A.D., C.E.) // start: when the era starts in ticks (gregorian, gmt), null if it is the earliest supported era. // offset: offset in years from gregorian calendar { "name": "A.D.", "start": null, "offset": 0 } ], twoDigitYearMax: 2029, patterns: { // short date pattern d: "M/d/yyyy", // long date pattern D: "dddd, MMMM dd, yyyy", // short time pattern t: "h:mm tt", // long time pattern T: "h:mm:ss tt", // long date, short time pattern f: "dddd, MMMM dd, yyyy h:mm tt", // long date, long time pattern F: "dddd, MMMM dd, yyyy h:mm:ss tt", // month/day pattern M: "MMMM dd", // month/year pattern Y: "yyyy MMMM", // S is a sortable format that does not vary by culture S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss", // formatting of dates in MySQL DataBases ISO: "yyyy-MM-dd hh:mm:ss", ISO2: "yyyy-MM-dd HH:mm:ss", d1: "dd.MM.yyyy", d2: "dd-MM-yyyy", d3: "dd-MMMM-yyyy", d4: "dd-MM-yy", d5: "H:mm", d6: "HH:mm", d7: "HH:mm tt", d8: "dd/MMMM/yyyy", d9: "MMMM-dd", d10: "MM-dd", d11: "MM-dd-yyyy" }, percentSymbol: "%", currencySymbol: "$", currencySymbolposition: "before", decimalSeparator: '.', thousandsSeparator: ',', pagerGoToPageString: "Go to page:", pagerShowRowsString: "Show rows:", pagerRangeString: " of ", pagerPreviousButtonString: "previous", pagerNextButtonString: "next", pagerFirstButtonsSring: "first", pagerLastButtonString:"last", filterApplyString: "Apply", filterCancelString: "Cancel", filterClearString: "Clear Filter", filterString: "advanced", filterSearchString: "Search:", filterStringComparisonOperators: ['empty', 'not empty', 'contains', 'contains(match case)', 'does not contain', 'does not contain(match case)', 'starts with', 'starts with(match case)', 'ends with', 'ends with(match case)', 'equal', 'equal(match case)', 'null', 'not null'], filterNumericComparisonOperators: ['equal', 'not equal', 'less than', 'less than or equal', 'greater than', 'greater than or equal', 'null', 'not null'], filterDateComparisonOperators: ['equal', 'not equal', 'less than', 'less than or equal', 'greater than', 'greater than or equal', 'null', 'not null'], filterBooleanComparisoOoperators: ['equal', 'not equal'], validationString: "Entered value is not valid", emptyDataString: "No data to display", filterSelectString: "Select Filter", loadText: "Loading...", clearString: "Clear", todayString: "Today", loadingErrorMessage: "The data is still loading and you cannot set a property or call a method. You can do that once the data binding is completed. jqxDataTable raises the 'bindingComplete' event when the binding is completed." }; Code examples
Set the <!DOCTYPE html><html lang="en"><head> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.11.1.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/jqxpanel.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcalendar.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdatetimeinput.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdatatable.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxnumberinput.js"></script> <script type="text/javascript" src="../../scripts/demos.js"></script> <script type="text/javascript" src="../../jqwidgets/globalization/globalize.js"></script> <script type="text/javascript" src="../sampledata/generatedata.js"></script> <script type="text/javascript"> $(document).ready(function () { var data = generatedata(250); var source = { localdata: data, dataFields: [ { name: 'name', type: 'string' }, { name: 'productname', type: 'string' }, { name: 'available', type: 'bool' }, { name: 'date', type: 'date'}, { name: 'quantity', type: 'number' }, { name: 'price', type: 'number' } ], datatype: "array" }; var dataAdapter = new $.jqx.dataAdapter(source); var getLocalization = function () { var localizationobj = {}; localizationobj.pagerGoToPageString = "Gehe zu:"; localizationobj.pagerShowRowsString = "Zeige Zeile:"; localizationobj.pagerRangeString = " von "; localizationobj.pagerNextButtonString = "voriger"; localizationobj.pagerFirstButtonString = "first"; localizationobj.pagerLastButtonString = "last"; localizationobj.pagerPreviousButtonString = "nächster"; localizationobj.sortAscendingString = "Sortiere aufsteigend"; localizationobj.sortDescendingString = "Sortiere absteigend"; localizationobj.sortRemoveString = "Entferne Sortierung"; localizationobj.firstDay = 1; localizationobj.percentSymbol = "%"; localizationobj.currencySymbol = "€"; localizationobj.currencySymbolPosition = "after"; localizationobj.decimalSeparator = "."; localizationobj.thousandsSeparator = ","; var days = { // full day names names: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"], // abbreviated day names namesAbbr: ["Sonn", "Mon", "Dien", "Mitt", "Donn", "Fre", "Sams"], // shortest day names namesShort: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"] }; localizationobj.days = days; var months = { // full month names (13 months for lunar calendards -- 13th month should be "" if not lunar) names: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", ""], // abbreviated month names namesAbbr: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dez", ""] }; var patterns = { d: "dd.MM.yyyy", D: "dddd, d. MMMM yyyy", t: "HH:mm", T: "HH:mm:ss", f: "dddd, d. MMMM yyyy HH:mm", F: "dddd, d. MMMM yyyy HH:mm:ss", M: "dd MMMM", Y: "MMMM yyyy" } localizationobj.patterns = patterns; localizationobj.months = months; return localizationobj; } $("#dataTable").jqxDataTable( { width: 685, source: dataAdapter, filterable: true, pageable: true, editable: true, localization: getLocalization(), columns: [ { text: 'Name', dataField: 'name', width: 115 }, { text: 'Produkt', dataField: 'productname', width: 220 }, { text: 'Datum', dataField: 'date', width: 210, cellsAlign: 'right', cellsFormat: 'd'}, { text: 'Qt.', dataField: 'quantity', cellsAlign: 'right', width: 60 }, { text: 'Preis', dataField: 'price', cellsFormat: "c2", cellsAlign: 'right' } ] }); }); </script></head><body class='default'> <div id="dataTable"> </div></body></html>
Get the
|
||||||||||||||
pagerHeight | Number | 28 | ||||||||||||
Sets or gets the height of the jqxDataTable's Pager(s). Pager(s) is(are) displayed after setting Code examples
Set the
Get the
Try it: pagerHeight is set to 35
|
||||||||||||||
pageSize | Number | 10 | ||||||||||||
Sets or gets the rows count per page when paging is enabled. Code examples
Set the
Get the
Try it: pageSize is set to 15
|
||||||||||||||
pageSizeOptions | Array | ['5', '10', '20'] | ||||||||||||
Sets or gets the jqxDataTable's page size options when paging is enabled and the Code examples
Set the
Get the
|
||||||||||||||
pageable | Boolean | false | ||||||||||||
Determines whether the jqxDataTable is in paging mode. Code examples
Set the
Get the
Try it: pageable is set to true
|
||||||||||||||
pagerPosition | String | "bottom" | ||||||||||||
Sets or gets the Pager's position. Possible values: Code examples
Set the
Get the
Try it: pagerPosition is set to 'top'
|
||||||||||||||
pagerMode | String | "default" | ||||||||||||
Sets or gets the Pager's mode. Possible values: Code examples
Set the
Get the
Try it: pagerMode is set to 'advanced'
|
||||||||||||||
pagerButtonsCount | Number | 5 | ||||||||||||
Sets or gets the count of the buttons displayed on the Pager when Code examples
Set the
Get the
Try it: pagerButtonsCount is set to 10
|
||||||||||||||
pagerRenderer | Function | null | ||||||||||||
Enables custom rendering of the Pager. Code examples
Set the
Get the
|
||||||||||||||
ready | Function | null | ||||||||||||
Callback function which is called when the jqxDataTable is rendered and data binding is completed.. Code examples
Set the
Get the
|
||||||||||||||
rowDetails | Boolean | false | ||||||||||||
Sets or gets whether the jqxDataTable rows have details and can be expanded/collapsed. See the Code examples
Set the
Get the
Try it: rowDetails is set to true
|
||||||||||||||
renderToolbar | Function | null | ||||||||||||
Enables custom rendering of the Toolbar. Code examples
Set the
Get the
|
||||||||||||||
renderStatusbar | Function | null | ||||||||||||
Enables custom rendering of the Statusbar. Code examples
Set the
Get the
|
||||||||||||||
rendering | Function | null | ||||||||||||
Callback function which is called before the rendering of the jqxDataTable's rows. Code examples
Set the <!DOCTYPE html><html lang="en"><head> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.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="../../jqwidgets/jqxlistbox.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxtooltip.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxinput.js"></script> <script type="text/javascript" src="../../scripts/demos.js"></script> <script type="text/javascript"> var that = this; $(document).ready(function () { var orderdetailsurl = "../sampledata/orderdetails.xml"; var ordersSource = { dataFields: [ { name: 'OrderID', type: 'int' }, { name: 'Freight', type: 'float' }, { name: 'ShipName', type: 'string' }, { name: 'ShipAddress', type: 'string' }, { name: 'ShipCity', type: 'string' }, { name: 'ShipCountry', type: 'string' }, { name: 'ShippedDate', type: 'date' } ], root: "Orders", record: "Order", dataType: "xml", id: 'OrderID', url: orderdetailsurl, addRow: function (rowID, rowData, position, commit) { // synchronize with the server - send insert command // call commit with parameter true if the synchronization with the server is successful // and with parameter false if the synchronization failed. // you can pass additional argument to the commit callback which represents the new ID if it is generated from a DB. commit(true); }, updateRow: function (rowID, rowData, commit) { // synchronize with the server - send update command // call commit with parameter true if the synchronization with the server is successful // and with parameter false if the synchronization failed. commit(true); }, deleteRow: function (rowID, commit) { // synchronize with the server - send delete command // call commit with parameter true if the synchronization with the server is successful // and with parameter false if the synchronization failed. commit(true); } }; var dataAdapter = new $.jqx.dataAdapter(ordersSource, { loadComplete: function () { // data is loaded. } }); this.editrow = -1; $("#dataTable").jqxDataTable( { width: 670, source: dataAdapter, pageable: true, sortable: true, altrows: true, editable: true, editSettings: { saveOnPageChange: true, saveOnBlur: true, saveOnSelectionChange: false, cancelOnEsc: true, saveOnEnter: true, editOnDoubleClick: false, editOnF2: false }, // called when jqxDataTable is going to be rendered. rendering: function() { // destroys all buttons. if ($(".editButtons").length > 0) { $(".editButtons").jqxButton('destroy'); } if ($(".cancelButtons").length > 0) { $(".cancelButtons").jqxButton('destroy'); } }, // called when jqxDataTable is rendered. rendered: function () { if ($(".editButtons").length > 0) { $(".cancelButtons").jqxButton(); $(".editButtons").jqxButton(); var editClick = function (event) { var target = $(event.target); // get button's value. var value = target.val(); // get clicked row. var rowIndex = parseInt(event.target.getAttribute('data-row')); if (isNaN(rowIndex)) { return; } if (value == "Edit") { // begin edit. $("#dataTable").jqxDataTable('beginRowEdit', rowIndex); target.parent().find('.cancelButtons').show(); target.val("Save"); } else { // end edit and save changes. target.parent().find('.cancelButtons').hide(); target.val("Edit"); $("#dataTable").jqxDataTable('endRowEdit', rowIndex); } } $(".editButtons").on('click', function (event) { editClick(event); }); $(".cancelButtons").click(function (event) { // end edit and cancel changes. var rowIndex = parseInt(event.target.getAttribute('data-row')); if (isNaN(rowIndex)) { return; } $("#dataTable").jqxDataTable('endRowEdit', rowIndex, true); }); } }, pagerButtonsCount: 8, columns: [ { text: 'Order ID', editable: false, dataField: 'OrderID', width: 100 }, { text: 'Freight', dataField: 'Freight', cellsFormat: 'f2', cellsAlign: 'right', align: 'right', width: 100 }, { text: 'Ship Country', dataField: 'ShipCountry', width: 150, columnType: 'custom', createEditor: function (row, cellValue, editor, width, height) { // create jqxInput editor. var textBox = $("<input style='padding-left: 4px; box-sizing: border-box; -moz-box-sizing: border-box; border: none;'/>").appendTo(editor);; var countries = new Array("Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burma", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombia", "Comoros", "Congo, Democratic Republic", "Congo, Republic of the", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Greece", "Greenland", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Mongolia", "Morocco", "Monaco", "Mozambique", "Namibia", "Nauru", "Nepal", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Samoa", "San Marino", " Sao Tome", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"); textBox.jqxInput({ source: countries, width: '100%', height: '100%' }); textBox.val(cellValue); }, initEditor: function (row, cellValue, editor) { // set jqxInput editor's initial value. editor.find('input').val(cellValue); }, getEditorValue: function (index, value, editor) { // get jqxInput editor's value. return editor.find('input').val(); } }, { text: 'Shipped Date', dataField: 'ShippedDate', cellsAlign: 'right', align: 'right', cellsFormat: 'd', width: 200 }, { text: 'Edit', cellsAlign: 'center', align: "center", columnType: 'none', editable: false, sortable: false, dataField: null, cellsRenderer: function (row, column, value) { // render custom column. return "<button data-row='" + row + "' class='editButtons'>Edit</button><button style='display: none; margin-left: 5px;' data-row='" + row + "' class='cancelButtons'>Cancel</button>"; } } ] }); }); </script></head><body class='default'> <div id="dataTable"> </div></body></html>
Get the
|
||||||||||||||
rendered | Function | null | ||||||||||||
Callback function which is called after the rendering of the jqxDataTable's row. Code examples
Set the <!DOCTYPE html><html lang="en"><head> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.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="../../jqwidgets/jqxlistbox.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxtooltip.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxinput.js"></script> <script type="text/javascript" src="../../scripts/demos.js"></script> <script type="text/javascript"> var that = this; $(document).ready(function () { var orderdetailsurl = "../sampledata/orderdetails.xml"; var ordersSource = { dataFields: [ { name: 'OrderID', type: 'int' }, { name: 'Freight', type: 'float' }, { name: 'ShipName', type: 'string' }, { name: 'ShipAddress', type: 'string' }, { name: 'ShipCity', type: 'string' }, { name: 'ShipCountry', type: 'string' }, { name: 'ShippedDate', type: 'date' } ], root: "Orders", record: "Order", dataType: "xml", id: 'OrderID', url: orderdetailsurl, addRow: function (rowID, rowData, position, commit) { // synchronize with the server - send insert command // call commit with parameter true if the synchronization with the server is successful // and with parameter false if the synchronization failed. // you can pass additional argument to the commit callback which represents the new ID if it is generated from a DB. commit(true); }, updateRow: function (rowID, rowData, commit) { // synchronize with the server - send update command // call commit with parameter true if the synchronization with the server is successful // and with parameter false if the synchronization failed. commit(true); }, deleteRow: function (rowID, commit) { // synchronize with the server - send delete command // call commit with parameter true if the synchronization with the server is successful // and with parameter false if the synchronization failed. commit(true); } }; var dataAdapter = new $.jqx.dataAdapter(ordersSource, { loadComplete: function () { // data is loaded. } }); this.editrow = -1; $("#dataTable").jqxDataTable( { width: 670, source: dataAdapter, pageable: true, sortable: true, altrows: true, editable: true, editSettings: { saveOnPageChange: true, saveOnBlur: true, saveOnSelectionChange: false, cancelOnEsc: true, saveOnEnter: true, editOnDoubleClick: false, editOnF2: false }, // called when jqxDataTable is going to be rendered. rendering: function() { // destroys all buttons. if ($(".editButtons").length > 0) { $(".editButtons").jqxButton('destroy'); } if ($(".cancelButtons").length > 0) { $(".cancelButtons").jqxButton('destroy'); } }, // called when jqxDataTable is rendered. rendered: function () { if ($(".editButtons").length > 0) { $(".cancelButtons").jqxButton(); $(".editButtons").jqxButton(); var editClick = function (event) { var target = $(event.target); // get button's value. var value = target.val(); // get clicked row. var rowIndex = parseInt(event.target.getAttribute('data-row')); if (isNaN(rowIndex)) { return; } if (value == "Edit") { // begin edit. $("#dataTable").jqxDataTable('beginRowEdit', rowIndex); target.parent().find('.cancelButtons').show(); target.val("Save"); } else { // end edit and save changes. target.parent().find('.cancelButtons').hide(); target.val("Edit"); $("#dataTable").jqxDataTable('endRowEdit', rowIndex); } } $(".editButtons").on('click', function (event) { editClick(event); }); $(".cancelButtons").click(function (event) { // end edit and cancel changes. var rowIndex = parseInt(event.target.getAttribute('data-row')); if (isNaN(rowIndex)) { return; } $("#dataTable").jqxDataTable('endRowEdit', rowIndex, true); }); } }, pagerButtonsCount: 8, columns: [ { text: 'Order ID', editable: false, dataField: 'OrderID', width: 100 }, { text: 'Freight', dataField: 'Freight', cellsFormat: 'f2', cellsAlign: 'right', align: 'right', width: 100 }, { text: 'Ship Country', dataField: 'ShipCountry', width: 150, columnType: 'custom', createEditor: function (row, cellValue, editor, width, height) { // create jqxInput editor. var textBox = $("<input style='padding-left: 4px; box-sizing: border-box; -moz-box-sizing: border-box; border: none;'/>").appendTo(editor);; var countries = new Array("Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burma", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombia", "Comoros", "Congo, Democratic Republic", "Congo, Republic of the", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Greece", "Greenland", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Mongolia", "Morocco", "Monaco", "Mozambique", "Namibia", "Nauru", "Nepal", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Samoa", "San Marino", " Sao Tome", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"); textBox.jqxInput({ source: countries, width: '100%', height: '100%' }); textBox.val(cellValue); }, initEditor: function (row, cellValue, editor) { // set jqxInput editor's initial value. editor.find('input').val(cellValue); }, getEditorValue: function (index, value, editor) { // get jqxInput editor's value. return editor.find('input').val(); } }, { text: 'Shipped Date', dataField: 'ShippedDate', cellsAlign: 'right', align: 'right', cellsFormat: 'd', width: 200 }, { text: 'Edit', cellsAlign: 'center', align: "center", columnType: 'none', editable: false, sortable: false, dataField: null, cellsRenderer: function (row, column, value) { // render custom column. return "<button data-row='" + row + "' class='editButtons'>Edit</button><button style='display: none; margin-left: 5px;' data-row='" + row + "' class='cancelButtons'>Cancel</button>"; } } ] }); }); </script></head><body class='default'> <div id="dataTable"> </div></body></html>
Get the
|
||||||||||||||
rtl | Boolean | false | ||||||||||||
Sets or gets a value indicating whether widget's elements are aligned to support locales using right-to-left fonts. Code example
Set the
Get the
Try it: rtl is set to true
|
||||||||||||||
source | Object | null | ||||||||||||
Determines the jqxDataTable's data source. The Code examples
Set the <!DOCTYPE html><html lang="en"><head> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.11.1.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/customers.xml"; // prepare the data var source = { datatype: "xml", datafields: [ { name: 'CompanyName', map: 'm\\:properties>d\\:CompanyName', type: 'string' }, { name: 'ContactName', map: 'm\\:properties>d\\:ContactName', type: 'string' }, { name: 'ContactTitle', map: 'm\\:properties>d\\:ContactTitle', type: 'string' }, { name: 'City', map: 'm\\:properties>d\\:City', type: 'string' }, { name: 'PostalCode', map: 'm\\:properties>d\\:PostalCode', type: 'string' }, { name: 'Country', map: 'm\\:properties>d\\:Country', type: 'string' } ], root: "entry", record: "content", id: 'm\\:properties>d\\:CustomerID', url: url }; var dataAdapter = new $.jqx.dataAdapter(source); // Create jqxGrid $("#dataTable").jqxDataTable( { width: 670, source: dataAdapter, pageable: true, pagerButtonsCount: 10, columnsresize: true, columns: [ { text: 'Company Name', datafield: 'CompanyName', width: 250 }, { text: 'Contact Name', datafield: 'ContactName', width: 150 }, { text: 'Contact Title', datafield: 'ContactTitle', width: 180 }, { text: 'City', datafield: 'City', width: 120 }, { text: 'Postal Code', datafield: 'PostalCode', width: 90 }, { text: 'Country', datafield: 'Country', width: 100 } ] }); }); </script></head><body class='default'> <div id="dataTable"></div></body></html>
Try it: source is set to dataAdapter
|
||||||||||||||
sortable | Boolean | false | ||||||||||||
Enables/Disables the sorting feature. Code examples
Set the
Get the
Try it: sortable is set to true
|
||||||||||||||
showAggregates | Boolean | false | ||||||||||||
Determines whether the jqxDataTable's Aggregates bar is visible. Code examples
Set the
Get the
Try it: showAggregates is set to true
|
||||||||||||||
showToolbar | Boolean | false | ||||||||||||
Determines whether the jqxDataTable's Toolbar is visible. Code examples
Set the
Get the
Try it: showToolbar is set to true
|
||||||||||||||
showStatusbar | Boolean | false | ||||||||||||
Determines whether the jqxDataTable's Statusbar is visible. Code examples
Set the
Get the
Try it: showStatusbar is set to true
|
||||||||||||||
statusBarHeight | Number | 34 | ||||||||||||
Sets or gets the height of the Statusbar. Statusbar is displayed after setting Code examples
Set the
Get the
Try it: statusBarHeight is set to 40
|
||||||||||||||
scrollBarSize | Number | 17 | ||||||||||||
Sets or gets the size of the scrollbars. Code examples
Set the
Get the
Try it: scrollBarSize is set to 20
|
||||||||||||||
selectionMode | String | "multipleRows" | ||||||||||||
Sets or gets the selection mode. Possible values: Code examples
Set the
Get the
|
||||||||||||||
serverProcessing | Boolean | false | ||||||||||||
Sets or gets whether the Paging, Sorting and Filtering are handled by a Server and jqxDataTable sends Ajax requests to a Server and displays the returned data. When the current page, page size, sort order or sort column is changed, jqxDataTable will automatically perform a new data binding with the updated parameters. For server synchronization after adding, removing, updating rows, see the By default, the jqxDataTable sends the following data to the server:
Code examples
Set the
jqxDataTable Server Paging & Filtering <!DOCTYPE html><html lang="en"><head> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.11.1.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 () { // prepare the data var source = { dataType: "json", dataFields: [ { name: 'ShipCountry', type: 'string' }, { name: 'ShipCity', type: 'string' }, { name: 'ShipAddress', type: 'string' }, { name: 'ShipName', type: 'string' }, { name: 'Freight', type: 'number' }, { name: 'ShippedDate', type: 'date' } ], root: 'value', url: "http://services.odata.org/V3/Northwind/Northwind.svc/Orders?$format=json" }; var filterChanged = false; var dataAdapter = new $.jqx.dataAdapter(source, { formatData: function (data) { if (data.sortdatafield && data.sortorder) { // update the $orderby param of the OData service. // data.sortdatafield - the column's datafield value(ShipCountry, ShipCity, etc.). // data.sortorder - the sort order(asc or desc). data.$orderby = data.sortdatafield + " " + data.sortorder; } if (data.filterslength) { filterChanged = true; var filterParam = ""; for (var i = 0; i < data.filterslength; i++) { // filter's value. var filterValue = data["filtervalue" + i]; // filter's condition. For the filterMode="simple" it is "CONTAINS". var filterCondition = data["filtercondition" + i]; // filter's data field - the filter column's datafield value. var filterDataField = data["filterdatafield" + i]; // "and" or "or" depending on the filter expressions. When the filterMode="simple", the value is "or". var filterOperator = data[filterDataField + "operator"]; var startIndex = 0; if (filterValue.indexOf('-') == -1) { if (filterCondition == "CONTAINS") { filterParam += "substringof('" + filterValue + "', " + filterDataField + ") eq true"; filterParam += " " + filterOperator + " "; } } else { if (filterDataField == "ShippedDate") { var dateGroups = new Array(); var startIndex = 0; var item = filterValue.substring(startIndex).indexOf('-'); while (item > -1) { dateGroups.push(filterValue.substring(startIndex, item + startIndex)); startIndex += item + 1; item = filterValue.substring(startIndex).indexOf('-'); if (item == -1) { dateGroups.push(filterValue.substring(startIndex)); } } if (dateGroups.length == 3) { filterParam += "year(ShippedDate) eq " + parseInt(dateGroups[0]) + " and month(ShippedDate) eq " + parseInt(dateGroups[1]) + " and day(ShippedDate) eq " + parseInt(dateGroups[2]); } filterParam += " " + filterOperator + " "; } } } // remove last filter operator. filterParam = filterParam.substring(0, filterParam.length - filterOperator.length - 2); data.$filter = filterParam; source.totalRecords = 0; } else { if (filterChanged) { source.totalRecords = 0; filterChanged = false; } } if (source.totalRecords) { // update the $skip and $top params of the OData service. // data.pagenum - page number starting from 0. // data.pagesize - page size data.$skip = data.pagenum * data.pagesize; data.$top = data.pagesize; } return data; }, downloadComplete: function (data, status, xhr) { if (!source.totalRecords) { source.totalRecords = data.value.length; } } } ); $("#dataTable").jqxDataTable( { width: 670, pageable: true, pagerButtonsCount: 10, serverProcessing: true, source: dataAdapter, altRows: true, filterable: true, filterMode: 'simple', sortable: true, columnsResize: true, columns: [ { text: 'Ship Name', dataField: 'ShipName', width: 200 }, { text: 'Ship Country', dataField: 'ShipCountry', width: 200 }, { text: 'Ship City', dataField: 'ShipCity', width: 200 }, { text: 'Ship Address', dataField: 'ShipAddress', width: 200 }, { text: 'Ship Date', dataField: 'ShippedDate', width: 200, cellsFormat: 'yyyy-MM-dd' } ] }); }); </script></head><body class='default'> <h3 style="font-size: 16px; font-family: Verdana;">Data Source: "http://services.odata.org"</h3> <div id="dataTable"></div></body></html>
Get the
Try it: serverProcessing is set to true
|
||||||||||||||
showHeader | Boolean | true | ||||||||||||
Sets or gets the jqxDataTable's columns visibility. Code examples
Set the
Get the
Try it: showHeader is set to false
|
||||||||||||||
theme | String | '' | ||||||||||||
Sets the widget's theme. jQWidgets uses a pair of css files - jqx.base.css and jqx.[theme name].css. The base stylesheet creates the styles related to the widget's layout like margin, padding, border-width, position. The second css file applies the widget's colors and backgrounds. The jqx.base.css should be included before the second CSS file. In order to set a theme, you need to do the following:
Try it: theme is set to 'energyblue'
|
||||||||||||||
toolbarHeight | Number | 34 | ||||||||||||
Sets or gets the height of the Toolbar. Toolbar is displayed after setting Code examples
Set the
Get the
Try it: toolbarHeight is set to 40
|
||||||||||||||
width | Number/String | null | ||||||||||||
Sets or gets the jqxDataTable's width. Code examples
Set the
Get the
Try it: width is set to 670
|
||||||||||||||
Events |
||||||||||||||
bindingComplete | Event | |||||||||||||
This event is triggered when the jqxDataTable binding is completed.
*Bind to that event before the jqxDataTable's initialization. Otherwise, if you are populating the widget from a local data source and bind to Code examples
Bind to the
|
||||||||||||||
cellBeginEdit | Event | |||||||||||||
This is triggered when a cell edit begins. Note: To turn on cell editing, you should set the Code examples
Bind to the
|
||||||||||||||
cellEndEdit | Event | |||||||||||||
This is triggered when a cell edit ends. Note: To turn on cell editing, you should set the Code examples
Bind to the
|
||||||||||||||
cellValueChanged | Event | |||||||||||||
This event is triggered when a cell value is changed. Code examples
Bind to the
|
||||||||||||||
columnResized | Event | |||||||||||||
This event is triggered when a column is resized. Code examples
Bind to the
|
||||||||||||||
columnReordered | Event | |||||||||||||
This event is triggered when the column's order is changed. Code examples
Bind to the
|
||||||||||||||
sort | Event | |||||||||||||
This event is triggered when the jqxDataTable sort order or sort column is changed. Code examples
Bind to the
|
||||||||||||||
filter | Event | |||||||||||||
This event is triggered when the jqxDataTable's rows filter is changed. Code examples
Bind to the
|
||||||||||||||
pageChanged | Event | |||||||||||||
This is triggered when the jqxDataTable's current page is changed. Code examples
Bind to the
|
||||||||||||||
pageSizeChanged | Event | |||||||||||||
This is triggered when the jqxDataTable's page size is changed. Code examples
Bind to the
|
||||||||||||||
rowClick | Event | |||||||||||||
This is triggered when a row is clicked. Code examples
Bind to the
|
||||||||||||||
rowDoubleClick | Event | |||||||||||||
This is triggered when a row is double-clicked. Code examples
Bind to the
|
||||||||||||||
rowSelect | Event | |||||||||||||
This is triggered when a row is selected. Code examples
Bind to the
|
||||||||||||||
rowUnselect | Event | |||||||||||||
This is triggered when a row is unselected. Code examples
Bind to the
|
||||||||||||||
rowBeginEdit | Event | |||||||||||||
This is triggered when a row edit begins. Code examples
Bind to the
|
||||||||||||||
rowEndEdit | Event | |||||||||||||
This is triggered when a row edit ends. Code examples
Bind to the
|
||||||||||||||
rowExpand | Event | |||||||||||||
This is triggered when a row is expanded. Code examples
Bind to the
|
||||||||||||||
rowCollapse | Event | |||||||||||||
This is triggered when a row is collapsed. Code examples
Bind to the
|
||||||||||||||
Methods |
||||||||||||||
addRow | Method | |||||||||||||
Adds a new row. For synchronization with a server, please look also the jqxDataAdapter plug-in's help documentation.
None Code example
Invoke the
|
||||||||||||||
addFilter | Method | |||||||||||||
Adds a new filter.
|
||||||||||||||
applyFilters | Method | |||||||||||||
Applies the added/removed filters.
None Code example
Invoke the
|
||||||||||||||
beginUpdate | Method | |||||||||||||
Begins an update and stops all refreshes.
None Code example
Invoke the
|
||||||||||||||
beginRowEdit | Method | |||||||||||||
Begins a row edit operation when
None Code example
Invoke the
|
||||||||||||||
beginCellEdit | Method | |||||||||||||
Begins a cell edit operation when
None Code example
Invoke the
|
||||||||||||||
clearSelection | Method | |||||||||||||
Clears the selection.
None Code example
Invoke the
|
||||||||||||||
clearFilters | Method | |||||||||||||
Clears the filters.
None Code example
Invoke the
|
||||||||||||||
clear | Method | |||||||||||||
Clears the jqxDataTable.
None Code example
Invoke the
Try it: clears the jqxDataTable.
|
||||||||||||||
destroy | Method | |||||||||||||
Destroys jqxDataTable and removes it from the DOM.
None Code example
Invoke the
Try it: destroy the jqxDataTable.
|
||||||||||||||
deleteRow | Method | |||||||||||||
Deletes a row. For synchronization with a server, please look also the jqxDataAdapter plug-in's help documentation.
None Code example
Invoke the
|
||||||||||||||
endUpdate | Method | |||||||||||||
Ends the update and resumes all refreshes.
None Code example
Invoke the
|
||||||||||||||
ensureRowVisible | Method | |||||||||||||
Moves the vertical scrollbar to a row index.
None Code example
Invoke the
|
||||||||||||||
endRowEdit | Method | |||||||||||||
Ends a row edit when
None Code example
Invoke the
Invoke the
|
||||||||||||||
endCellEdit | Method | |||||||||||||
Ends a cell edit operation when
None Code example
Invoke the
|
||||||||||||||
exportData | Method | |||||||||||||
Exports jqxDataTable's data to Excel, HTML, XML, JSON, CSV or TSV. See also the
Object(optional) - depends on whether the export is to a file or not. Code example
Invoke the
Export to Excel works with the ExcelML format. ExcelML is XML-based file format. It complies to the Microsoft XMLSS specification and is supported in Microsoft Office 2003 and later. * When you open export to Excel, you may receive the following message: "The file you are trying to open, 'file_name.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening this file. Do you want to open the file now?" The reason of this warning message is explained in details in the following post: excel-2007-extension-warning.aspx |
||||||||||||||
focus | Method | |||||||||||||
Focus jqxDataTable.
None Code example
Invoke the
Try it: focus the jqxDataTable.
|
||||||||||||||
getColumnProperty | Method | |||||||||||||
Gets a property value of a column.
Object Code example
Invoke the
|
||||||||||||||
goToPage | Method | |||||||||||||
Navigates to a page when
None Code example
Invoke the
|
||||||||||||||
goToPrevPage | Method | |||||||||||||
Navigates to a previous page when
None Code example
Invoke the
|
||||||||||||||
goToNextPage | Method | |||||||||||||
Navigates to a next page when
None Code example
Invoke the
|
||||||||||||||
getSelection | Method | |||||||||||||
Returns an array of selected rows.
Array Code example
Invoke the
Invoke the
|
||||||||||||||
getRows | Method | |||||||||||||
Returns an array of all rows loaded in the widget.
Array Code example
Invoke the
Invoke the
|
||||||||||||||
getView | Method | |||||||||||||
Returns an array of all rows displayed in the view. This method takes into account the Sorting Order and returns the Filtered Set of Rows, if Filtering is applied. The method is different from getRows, because getRows returns a Rows array in their data binding order and that array is not affected by filtering and sorting.
Array Code example
Invoke the
Invoke the
|
||||||||||||||
getCellValue | Method | |||||||||||||
Returns a value of a cell.
Object Code example
Invoke the
|
||||||||||||||
hideColumn | Method | |||||||||||||
Hides a column.
None Code example
Invoke the
|
||||||||||||||
hideDetails | Method | |||||||||||||
Hides the details of a row.
None Code example
Invoke the
|
||||||||||||||
isBindingCompleted | Method | |||||||||||||
Returns whether the binding is completed and if the result is true, this means that you can invoke methods and set properties. Otherwise, if the binding is not completed and you try to set a property or invoke a method, the widget will throw an exception.
Boolean Code example
Invoke the
|
||||||||||||||
lockRow | Method | |||||||||||||
Locks a row i.e editing of the row would be disabled.
None Code example
Invoke the
|
||||||||||||||
refresh | Method | |||||||||||||
Performs a layout and updates the HTML elements position and size.
None Code example
Invoke the
|
||||||||||||||
render | Method | |||||||||||||
Renders jqxDataTable.
None Code example
Invoke the
|
||||||||||||||
removeFilter | Method | |||||||||||||
Removes a filter.
None Code example
Invoke the
|
||||||||||||||
scrollOffset | Method | |||||||||||||
Scrolls to a position.
Object - object.left and object.top Code example
Invoke the
Get the scroll position.
|
||||||||||||||
setColumnProperty | Method | |||||||||||||
Sets a property of a column. See the
None Code example
Invoke the
|
||||||||||||||
showColumn | Method | |||||||||||||
Shows a column.
None Code example
Invoke the
|
||||||||||||||
selectRow | Method | |||||||||||||
Selects a row.
None Code example
Invoke the
|
||||||||||||||
showDetails | Method | |||||||||||||
Shows a row details.
None Code example
Invoke the
|
||||||||||||||
setCellValue | Method | |||||||||||||
Sets a value of a cell.
None Code example
Invoke the
|
||||||||||||||
sortBy | Method | |||||||||||||
Sorts a column, if
None Code example
Invoke the
|
||||||||||||||
updating | Method | |||||||||||||
Gets a boolean value which determines whether jqxDataTable is in update state i.e the
Boolean Code example
Invoke the
|
||||||||||||||
updateBoundData | Method | |||||||||||||
Performs a data bind and updates jqxDataTable with the new data.
None Code example
Invoke the
|
||||||||||||||
unselectRow | Method | |||||||||||||
Unselects a row.
None Code example
Invoke the
|
||||||||||||||
updateRow | Method | |||||||||||||
Updates the row's data. For synchronization with a server, please look also the jqxDataAdapter plug-in's help documentation.
None Code example
Invoke the
|
||||||||||||||
unlockRow | Method | |||||||||||||
Unlocks a row.
None Code example
Invoke the
|