.&1|?" {}:+dt 4BEn!3_${Eڞtڹċ.5[ooL_p:޵vqey3kk:u-؅i\䳨LMԣA+Q,:! uWhCEsMxЃQ]Fv2w𼽅*]e7fSKRŶik(Z@¦k4K[_MD5Deƴz&t1F "`׸Q 3r̯]!VA/%Ćt Fp7"98/crQ|ۼR`$16'+LCMq\bGfX8nn&,`\f$?Rah4"MudDN; DOKQ! `^cLQ;^}|&SBZ|]6#p87C65PbLYL!LY_te~xxm|V'Ybؼ>Q uNJѫ;V=šhsc(+q-k@R yd ='pFrU1 /]pcT? A)3gVLLɌ1BD ]ne~Ŧ[+6ZwߝY5BSwKVLVT vYiQU@k(^*tWc EɊw;o#9Mt y,qk# 3Zߜ#%xόc&A|P,m8nn&,`\fΞde#?űu8nn&,`\fD8DBP ؄"g=e·57㉫\V=4!˯=Mg}xŷx]$CD|ϿaZ 4Yf"K<75HoR/z#] Cw!_n7}?e euY*^S'Y{tt0'!*a;0IFQVm g"~"|DQP^NΆ* h4,idAzn[s~n Y˞a 䯢ܤ&em\| DQP^NΆ* h4OƓ.̈/|{~0ur&}Yʤ=ő7Rf~jP|&4goT=d!uט&2Ds:0W9ct.'`i$F$A# Foe  /\NuKpPe:'pyNͰi 8nn&,`\f3W\!1@g,Æg0mL!WGo͋oY7ia vً<XuбftFM`A ;_NGR7-`vYi W[o曧Im +[.]2i^@8#`&S`D"-cFCĶ ='pFrU15WO"hsxbBأ!A +!seoVW@"HR=臨vk_Bzm5'.׷eٜbE~k=J zm5'.׷eٜ|[q*)q;E=쁏"&nLX GO8nn&,`\f&:R}zg_W?4%xkw;֊r啩|otꋔRD?qԷ a揷;Q?fljPCr\]֝c8nn&,`\fgta'WyO0)TSxOXQoH/}z5oA#ŽJKFJVBar) { var toTheme = function (className) { if (theme == "") return className; return className + " " + className + "-" + theme; } // appends buttons to the status bar. var container = $("
"); var buttonTemplate = "
"; var addButton = $(buttonTemplate); var editButton = $(buttonTemplate); var deleteButton = $(buttonTemplate); var cancelButton = $(buttonTemplate); var updateButton = $(buttonTemplate); container.append(addButton); container.append(editButton); container.append(deleteButton); container.append(cancelButton); container.append(updateButton); toolBar.append(container); addButton.jqxButton({cursor: "pointer", enableDefault: false, height: 25, width: 25 }); addButton.find('div:first').addClass(toTheme('jqx-icon-plus')); addButton.jqxTooltip({ position: 'bottom', content: "Add"}); editButton.jqxButton({ cursor: "pointer", disabled: true, enableDefault: false, height: 25, width: 25 }); editButton.find('div:first').addClass(toTheme('jqx-icon-edit')); editButton.jqxTooltip({ position: 'bottom', content: "Edit"}); deleteButton.jqxButton({ cursor: "pointer", disabled: true, enableDefault: false, height: 25, width: 25 }); deleteButton.find('div:first').addClass(toTheme('jqx-icon-delete')); deleteButton.jqxTooltip({ position: 'bottom', content: "Delete"}); updateButton.jqxButton({ cursor: "pointer", disabled: true, enableDefault: false, height: 25, width: 25 }); updateButton.find('div:first').addClass(toTheme('jqx-icon-save')); updateButton.jqxTooltip({ position: 'bottom', content: "Save Changes"}); cancelButton.jqxButton({ cursor: "pointer", disabled: true, enableDefault: false, height: 25, width: 25 }); cancelButton.find('div:first').addClass(toTheme('jqx-icon-cancel')); cancelButton.jqxTooltip({ position: 'bottom', content: "Cancel"}); var updateButtons = function (action) { switch (action) { case "Select": addButton.jqxButton({ disabled: false }); deleteButton.jqxButton({ disabled: false }); editButton.jqxButton({ disabled: false }); cancelButton.jqxButton({ disabled: true }); updateButton.jqxButton({ disabled: true }); break; case "Unselect": addButton.jqxButton({ disabled: false }); deleteButton.jqxButton({ disabled: true }); editButton.jqxButton({ disabled: true }); cancelButton.jqxButton({ disabled: true }); updateButton.jqxButton({ disabled: true }); break; case "Edit": addButton.jqxButton({ disabled: true }); deleteButton.jqxButton({ disabled: true }); editButton.jqxButton({ disabled: true }); cancelButton.jqxButton({ disabled: false }); updateButton.jqxButton({ disabled: false }); break; case "End Edit": addButton.jqxButton({ disabled: false }); deleteButton.jqxButton({ disabled: false }); editButton.jqxButton({ disabled: false }); cancelButton.jqxButton({ disabled: true }); updateButton.jqxButton({ disabled: true }); break; } } var rowIndex = null; $("#table").on('rowSelect', function (event) { var args = event.args; rowIndex = args.index; updateButtons('Select'); }); $("#table").on('rowUnselect', function (event) { updateButtons('Unselect'); }); $("#table").on('rowEndEdit', function (event) { updateButtons('End Edit'); }); $("#table").on('rowBeginEdit', function (event) { updateButtons('Edit'); }); addButton.click(function (event) { if (!addButton.jqxButton('disabled')) { // add new empty row. $("#table").jqxDataTable('addRow', null, {}, 'first'); // select the first row and clear the selection. $("#table").jqxDataTable('clearSelection'); $("#table").jqxDataTable('selectRow', 0); // edit the new row. $("#table").jqxDataTable('beginRowEdit', 0); updateButtons('add'); } }); cancelButton.click(function (event) { if (!cancelButton.jqxButton('disabled')) { // cancel changes. $("#table").jqxDataTable('endRowEdit', rowIndex, true); } }); updateButton.click(function (event) { if (!updateButton.jqxButton('disabled')) { // save changes. $("#table").jqxDataTable('endRowEdit', rowIndex, false); } }); editButton.click(function () { if (!editButton.jqxButton('disabled')) { $("#table").jqxDataTable('beginRowEdit', rowIndex); updateButtons('edit'); } }); deleteButton.click(function () { if (!deleteButton.jqxButton('disabled')) { $("#table").jqxDataTable('deleteRow', rowIndex); updateButtons('delete'); } }); }, columns: [ { text: 'Order ID', editable: false, dataField: 'OrderID', width: 200 }, { text: 'Freight', dataField: 'Freight', cellsFormat: 'f', cellsAlign: 'right', align: 'right', width: 200}, { text: 'Ship Country', dataField: 'ShipCountry', width: 250, columnType: 'custom', createEditor: function (row, cellValue, editor, width, height) { // create jqxInput editor. var textBox = $("").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: 'dd/MM/yyyy'} ] }); });