Demos

DEMO 2

This demo shows how to

This demo and demo 1 use the same SQL table, but here records flagged as deleted are also displayed.

Please note that is a live demo and your tests will be recorded in a database!
Instructions: double-click on a cell to open the row editor.

Id Name Email Start Date Salary Deleted Actions
52964the highest Date is in 2019...employee@email.com2019-12-010.00
52963hjktfygtuiygemployee@email.com2011-01-120.00
52962Employee name...employee@email.com2011-01-010.00
52961asdfsdafemployee@email.com2011-01-0110.10
52960dokter darkdokter_dark@email.com2011-01-010.00
52959ayoubmengademployee@email.com2011-01-010.00
52958testtest@email.com2011-01-010.00
52957dfddsfgemployee@email.com2011-01-010.00
52956nombreemployee@email.com2011-01-010.00
52955Employee name...employee@email.com2011-01-060.00
52954Employee name...employee@email.com2011-01-010.00
52953Employee name...employee@email.com2011-01-010.00
52952Employee name...employee@email.com2011-01-010.00
52951Employee name...employee@email.com2011-01-010.00
52950testemployee@email.com2011-04-020.00
52949??????employee@email.com2011-01-010.00
52948??????testadfa@gmail.com2011-01-0120.00
52947testemployee@email.coms2011-01-060.00
52946???employee@email.com2011-01-1210.00
52945Employee name...employee@email.com2011-01-010.00
52944Employee name...employee@email.com2011-01-010.00
52943Employee name...employee@email.com2011-01-010.00
52942Jorge employee@email.com2011-01-010.00
52941Employee name...employee@email.com2011-01-010.00
52940Employee name...employee@email.com2011-01-010.00
52939Employee name...employee@email.com2011-01-010.00
52938erg4g24tgh42temployee@email.com2011-01-010.00
52937ze name...employee@email.com2011-01-010.00
52936Employee name...employee@email.com2011-03-120.00
52935Employee name...employee@email.com2011-01-010.00
52934Employee name...employee@email.com2011-01-010.00
52933Employee name...employee@email.com2011-01-010.00
52932taki sobie koles bonzokloes@email.com2019-12-3112.05
52931siano na sniadanie dla koziolkadfskoziolek@email.com0000-00-000.00
52930ssssssss ?????????@email.com2001-01-200.00
52929Employee name...employee@email.com2011-01-010.00
52928gfddfgemployee@email.com2011-01-140.00
52927Employee name...employeeaa@email.com1995-01-010.00
52926Employee name...employee@email.com2011-01-010.00
52925u9i090909employee@email.com2005-02-200.00
52924Employee name...employee@email.com2011-01-010.00
52923Employee name...employee@email.com2011-01-010.00
52922tstingemployee@email.com2011-01-050.00
52921Test Me NOWemployee1@email.com2011-01-010.00
52920Employee name...jjemployee@emailerwr.com2011-01-010.00
52919Employee name...employee@email.com2011-01-010.00
52918Employee name...employee@email.com2011-01-010.00
52917Employee name...employee@email.com2011-01-010.00
52916Employee name...employee@email.com2011-01-010.00
52915Employee name...employee@email.com2011-01-010.00
52914Employee name...employee@email.com2011-01-010.00
52913Employee name...employee@email.com2011-01-010.00
52912Employee name...employee@email.com2011-01-010.00
52911Employee name...employee@email.com2011-01-010.00
52910Employee name...employee@email.com2011-01-010.00
52909Employee name...employee@email.com2011-01-010.00
52908Employee name...employee@email.com2011-01-010.00
52907Employee name...employee@email.com2011-01-010.00
52906Employee name...employee@email.com2011-01-010.00
52905oöoiöoiöoiöioöoiöemployee@email.com2011-01-010.00
52904Employee name...employee@email.com2011-01-010.00
52903Employee name...employee@email.com2011-01-010.00
52902holaemployee@email.com2011-01-010.00
52901rrrrremployee@email.com2011-01-010.00
52900Employee name...employee@email.com2011-01-010.00
52899Employee name...employee@email.com2011-01-010.00
52898Employee name...employee@email.com2011-01-010.00
52897Employee name...employee@email.com2011-01-010.00
52896Employee name...employee@email.com2011-01-010.00
52895i7i7l78l789employee@email.com2011-01-010.00
52894Employee name...employee@email.com2011-01-010.00
52893Employee name...employee@email.com2011-01-010.00
52892Employee name...employee@email.com2011-01-010.00
52891Employee name...employee@email.com2011-01-010.00
52890Employee name...employee@email.com2011-01-010.00
52889Employee name...employee@email.com2011-01-010.00
52888employee@email.com2011-01-010.00
52887Employee name...employee@email.com2011-01-010.00
52886Employee name...employee@email.com2011-01-010.00
52885Employee name...employee@email.com2011-01-010.00
52884Employee name...employee@email.com2011-01-010.00
52883Employee name...employee@email.com2011-01-010.00
52882Employee name...employee@email.com2011-01-010.00
52881Employee name...employee@email.com2011-01-010.00
52880Employee name...employee@email.com2011-01-010.00
52879Employee name...employee@email.com2011-01-010.00
52878Employee name...employee@email.com2011-01-010.00
52877Employee name...employee@email.com2011-01-010.00
52876Employee name...employee@email.com2011-01-010.00
52875Employee name...employee@email.com2011-01-010.00
52874Employee name...employee@email.com2011-01-010.00
52873Employee name...employee@email.com2011-01-010.00
52872Employee name...employee@email.com2011-01-010.00
52871Employee name...employee@email.com2011-01-010.00
52870Employee name...employee@email.com2011-01-010.00
52869Employee name...employee@email.com2011-01-010.00
52868Employee name...employee@email.com2011-01-010.00
52867Employee name...employee@email.com2011-01-010.00
52866Employee name...employee@email.com2011-01-010.00
52865Employee name...employee@email.com2011-01-010.00
			//ezEditTable configuration object
			var demo2Config = {
				editable: true,
				scroll_into_view: true,
				form_submit_interval: 900,
				auto_save: false,
				cell_editors:[
					{ type: 'none' },
					{ type: 'input', attributes:[['title', 'First name and last name']], allow_empty_value:true },
					{ type: 'input', attributes:[['title', 'email address']] },
					{ type: 'custom', target: 'dateEditor' },
					{ type: 'input', attributes:[['maxLength', 9], ['title', '9 digits max.']], css:'alignRight' },
					{ type: 'boolean' },
					{ type: 'command', 
						buttons:{ 
							enable: ['update', 'insert', 'delete', 'submit', 'cancel'], 
							'update': { title:'Edit row' },
							'insert': { title:'Add row'  },
							'delete': { title:'Delete row' },
							'submit': { text:'Save', title:'Save'  },
							'cancel': { text:'Close', title:'Close' }
						} 
					}
				],
				actions:{
					'update': { 
						uri: 'php/employeeUpdate.php', submit_method: 'form', form_method: 'POST', 
						param_names: ['id','name','email','startdate','salary','active']
					},
					'insert': { 
						uri: 'php/employeeInsert.php', submit_method: 'form', form_method: 'POST', 
						param_names: ['id','name','email','startdate','salary','active'],
						default_record: ['', 'Employee name...', 'employee@email.com', '2011-01-01','0', '']
					},
					'delete': { 
						uri: 'php/script.deleteEmployee.php', submit_method: 'script', bulk_delete: false,
						param_names: ['id']
					}
				},
				//Server activity callback events
				on_server_activity_start: function(o, row){ setTimeout(function(){ o.Get('divLoader').style.display = 'block';}, 5); },
				on_server_activity_stop: function(o, row){ setTimeout(function(){ o.Get('divLoader').style.display = 'none';}, 5); },
				//Data validation delegate, the script does not provide data validation tools
				validate_modified_value: function(o, colIndex, oldVal, newVal, cell, editor){
					if(colIndex==2 && oldVal != newVal){ 
						if(!et_ValidateEmail(newVal)){
							alert('Please insert a valid email!'); 
							return false;
						} else return true;
					}
					else if(colIndex == 4 && oldVal != newVal){
						if(isNaN(newVal)){
							alert('Please insert a number!');
							return false;
						} else return true;
					}
					else return true;
				},
				open_custom_editor: function(o, cell, editor){
					cell.appendChild(editor);
					editor.style.display = ''; 
				},
				close_custom_editor: function(o, cell, editor){ 
					editor.style.display = 'none';
					document.body.appendChild(editor);
					var d = o.Get('daySlc'), m = o.Get('monthSlc'), y = o.Get('yearSlc');
					d.value = '';
					m.value = '';
					y.value = '';
				},
				get_custom_editor_value: function(o, editor, colIndex){
					var strDate;
					var d = o.Get('daySlc'), m = o.Get('monthSlc'), y = o.Get('yearSlc');
					strDate = y.value+'-'+m.value+'-'+d.value;
					return strDate;
				},
				set_custom_editor_value: function(o, editor, colIndex, val){
					o.config.SetDateEditorValue(o, val, 'YMD');
				},
				//Custom toolip on row selection
				on_after_selected_row: function(o, row){ 
					if(!o.customTooltip || !demo2ActionsInfo || !row.getAttribute('id')) return;
					var recordId = row.getAttribute('id').replace('tr','');
					var actionInfo = demo2ActionsInfo[recordId]; //gets the associated actionInfo object
					var div = o.Get('divActionInfo_'+recordId);
					if(div){ div.style.display = 'block'; return; } //div already exists
					if(actionInfo && actionInfo.hasOwnProperty('createDate')){
						var locatorURL = 'http://www.infosniper.net/index.php?map_source=1&overview_map=1&lang=1&map_type=1&zoom_level=7&ip_address=';
						div = o.CreateElm('div', ['id','divActionInfo_'+recordId]);
						div.style.cssText = 'position:absolute; display:block; background:#FFFF99; border:1px solid #999; color:#000; padding:5px; margin:-70px 0 0 0px;';
						div.innerHTML = '
Created on: '+actionInfo.createDate+ ' by: '+actionInfo.originIp+'
' + '
Modified on: '+actionInfo.modDate+' by: '+(actionInfo.modIp!='' ? ''+actionInfo.modIp+'' : '')+'
' + '
Deleted on: '+actionInfo.delDate+' by: '+(actionInfo.delIp!='' ? ''+actionInfo.delIp+'' : '')+'
'; row.cells[0].appendChild(div); } }, on_before_deselected_row: function(o, row){ if(!demo2ActionsInfo || !row.getAttribute('id')) return; var recordId = row.getAttribute('id').replace('tr',''); var div = o.Get('divActionInfo_'+recordId); if(div){ div.parentNode.removeChild(div); div = null; } }, //Messages msg_submit_ok: 'Data processed successfully!', msg_confirm_delete_selected_rows: 'Are you sure you want to delete the selected record?', msg_error_occured: 'Error!' , msg_submit_unsuccessful: 'Data could not be saved correctly!', //Custom date editor function, does not belong to ezEditTable script SetDateEditorValue: function(o, val, dateType){ var date = tf_FormatDate(val, dateType); var d = o.Get('daySlc'), m = o.Get('monthSlc'), y = o.Get('yearSlc'); var day = date.getDate(), month = date.getMonth()+1, year = date.getFullYear(); d.value = day.toString().length==1 ? '0'+day.toString() : day; m.value = month.toString().length==1 ? '0'+month.toString() : month; y.value = year; } };

Top of page
E.n.j.o.y.  ads-free content!