<commit_before>muTable
=======

A javascript library for interactive table UI


Dependency
==========
jQuery


How to Use
==========
Include the muTable.js in your page source
```
<script src="muTable/muTable.js"></script>
```
Optinal: you can also include the muTable stylesheet, or customize it
```
<link rel=StyleSheet href="muTable/style.css" type="text/css">
```

Create a div in your HTML for showing the table
```
<div class="mutable" id="table_div"></div>
```

Write appropriate JavaScript code to fetch and display data as a table
```javascript
$( document ).ready(function() {

	var filter = ["fname", "lname", "phone", "mobile", "fax", "email", "address"] ;	// the column to be shown, in given order
	var options = {'select': false, 'add': true, 'edit': true, 'delete' : true,} ;	// interactivity options

	// callback functions for different events
	var callback = {
		'onAddAccept' : function (data) {
			//TODO : the two lines bellow are dummy code, put your own stuffs here
			console.log(data);
			return muTable.XMLHTTP_STATUS_OK ;
		},
		'onEditAccept' : function (data) {
			//TODO : the two lines bellow are dummy code, put your own stuffs here
			console.log(data);
			return muTable.XMLHTTP_STATUS_OK ;
		},
		'onDelete' : function(data) {
			//TODO : the line bellow is dummy code, put your own stuffs here
			return muTable.XMLHTTP_STATUS_OK ;
		}
	} ;

	// the url for fetching data from the DB
	var data_source = "mutable_data.php" ;

	// the HTML DOM element where the table should be shown
	var data_destination = $("#table_div") ;

	//populate the table
	muTable.getNewMuTable(data_source, data_destination, filter, options, callback) ;
});
```<commit_msg>Updated the readme file<commit_after>muTable
=======

A javascript library for interactive table UI


Dependency
==========
jQuery


How to Use
==========
Include the muTable.js in your page source
```
<script src='muTable/muTable.js'></script>
```
Optinal: you can also include the muTable stylesheet, or customize it
```
<link rel=StyleSheet href='muTable/style.css' type='text/css'>
```

Create a div in your HTML for showing the table
```
<div class='mutable' id='table_div'></div>
```

Write appropriate JavaScript code to fetch and display data as a table
```javascript
$( document ).ready(function() {

	var filter = ['fname', 'lname', 'phone', 'mobile', 'fax', 'email', 'address'] ;	// the column to be shown, in given order
	var label = ['Name', '', 'Telephone', 'Cell', 'Fax', 'email', 'Address'] ;	// the column labels, overrides the name from the DB	
	var options = {
		'select': false, 
		'add': true, 
		'edit': true, 
		'delete' : true,
		'pageln' : 10,
		'currentpage' : 1
		} ;	// interactivity options

	// callback functions for different events
	var callback = {
		'onAddAccept' : function (data) {
			console.log(data);
			//TODO : put your own stuffs here
		},
		'onEditAccept' : function (data) {
			console.log(data);
			//TODO : put your own stuffs here
		},
		'onDelete' : function(data) {
			console.log(data);
			//TODO : put your own stuffs here
			//when you are satisfied with deletion in the back end, tell muTable working in the front to remove the row
			if(confirmedDeletion)
				muTable.removeRow(row) ;
		}
	} ;

	// the url for fetching data from the DB
	var data_source = 'mutable_data.php' ;

	// the HTML DOM element where the table should be shown
	var data_destination = $('#table_div') ;

	//populate the table
	muTable.getNewMuTable(data_source, data_destination, filter, options, callback) ;
});
```
{'fraction_non_alphanumeric': 0.14220963172804532, 'fraction_numerical': 0.0008498583569405099, 'mean_word_length': 4.001416430594901, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1929390', 'n_tokens_mistral': 1188, 'n_tokens_neox': 1081, 'n_words': 395}