diff --git a/README.txt b/README.txt
index 09a72d8..def96ba 100644
--- a/README.txt
+++ b/README.txt
@@ -1,3 +1,4 @@
+// $Id: README.txt,v 1.1.2.1 2010/07/28 01:06:23 duellj Exp $
 
 This module provides views integration for the DataTables jQuery plugin, which 
 provides advanced interaction controls to HTML tables such as dynamic
diff --git a/datatables.info b/datatables.info
index 9f799a3..aadc38b 100644
--- a/datatables.info
+++ b/datatables.info
@@ -3,3 +3,10 @@ description = Provides integration of the jquery DataTables plugin into views.
 version = 6.x-0.1
 core = 6.x
 dependencies[] = views
+
+; Information added by drupal.org packaging script on 2010-07-28
+version = "6.x-1.0"
+core = "6.x"
+project = "datatables"
+datestamp = "1280280313"
+
diff --git a/datatables.install b/datatables.install
index 8534fa0..d67d057 100644
--- a/datatables.install
+++ b/datatables.install
@@ -1,4 +1,5 @@
 <?php
+// $Id: datatables.install,v 1.1 2009/12/15 07:21:47 duellj Exp $
 
 /**
  * @file
diff --git a/datatables.module b/datatables.module
index 981d03a..14fe4d6 100644
--- a/datatables.module
+++ b/datatables.module
@@ -1,9 +1,32 @@
 <?php
+// $Id: datatables.module,v 1.3.2.1 2010/07/28 01:06:23 duellj Exp $
 
 /**
  * @file
  * Provides integration of the jQuery DataTables plugin
  */
+module_load_include('inc', 'datatables', 'datatables.serverside');
+
+/**
+ * Implementation of hook_perm().
+ */
+function datatables_perm(){
+ return array('ajax datatables');
+}
+
+/**
+ * Implementation of hook_menu().
+ */
+function datatables_menu(){
+  $items['datatables-server-processing/%/%/%'] = array(
+    'page callback' => 'datatables_serverside',
+    'page arguments' => array(1,2,3),
+    'access callback' => user_access('ajax datatables'),
+  );
+  
+  return $items;
+}
+
 
 /**
  * Implementation of hook_theme().
@@ -21,7 +44,7 @@ function datatables_theme() {
  */
 function datatables_views_api() {
   return array(
-    'api' => 2.0,
+    'api' => 3.0,
     'path' => drupal_get_path('module', 'datatables') .'/views',
   );
 }
@@ -118,15 +141,59 @@ function datatables_views_api() {
  */
 function theme_datatable($header, $rows, $attributes = array(), $caption = NULL) {
   $datatable_options = $attributes['datatable_options'];
-  
+
+    
   // Column settings can either be set with the global options
   // or in each header definition.
   if (!$datatable_options['aoColumns']) {
     foreach ($header as $key => $cell) {
       $datatable_options['aoColumns'][] = $cell['datatable_options'];
-      unset($header[$key]['datatable_options']);
+      #unset($header[$key]['datatable_options']);
     }
   }
+  /*
+  foreach ($rows as $num => $row) {
+    $rows['row_classes'][$num][] = ($num % 2 == 0) ? 'odd' : 'even';
+  }
+  */
+  // Pagination Full Numbers
+  $datatable_options['sPaginationType'] = "full_numbers";
+
+  // Enable Jquery Theme Roller
+  $datatable_options['bJQueryUI'] = TRUE ;
+  
+  // Enable table info display, if necessary.
+  $datatable_options['bInfo'] = TRUE;
+
+  // Disable search filter box, if necessary.
+  $datatable_options['bFilter'] = TRUE;
+
+  // bStateSave.
+  $datatable_options['bStateSave'] = TRUE;
+  
+  // Enable AutoWidth
+  $datatable_options['bAutoWidth'] = FALSE;
+  
+  // Processing
+  $datatable_options['bProcessing'] = TRUE; 
+
+  // Language translations
+  $datatable_options['oLanguage'] = array('oPaginate' => array('sFirst' => t('First page'), 
+                                                               'sLast' => t('Last page'),
+                                                               'sNext' => t('Next page'),
+                                                               'sPrevious' => t('Previous page'),
+                                                              ),
+                                          'sInfo' => t('Got a total of _TOTAL_ entries to show (_START_ to _END_)'),
+                                          'sInfoFiltered' => t('- filtering from _MAX_ records'),
+                                          'sLengthMenu' => t('Display _MENU_ records'),
+                                          'sLoadingRecords' => t('Please wait - loading...'),
+                                          'sInfoThousands' => "'",
+                                          'sInfoPostFix' => t('All records shown are derived from real information.'),
+                                          'sInfoEmpty' => t('No entries to show'),
+                                          'sProcessing' => t('Processing...'),
+                                          'sSearch' => t('Search').':',
+                                          'sZeroRecords' => t('No records to display'),
+                                         );
   
   // Set unique id
   if (!$attributes['id']) {
@@ -160,14 +227,72 @@ function template_preprocess_datatables_view(&$vars) {
 
   $fields   = &$view->field;
   $columns  = $handler->sanitize_columns($options['columns'], $fields);
-
   $active   = !empty($handler->active) ? $handler->active : '';
   $order    = !empty($handler->order) ? $handler->order : 'asc';
 
+  // Enable sScrolly
+  #if( !empty($options['sScrollyHeight']) ){
+ #  $datatable_options['sScrollY'] = '400px';//$options['sScrollyHeight'];
+  #}
+  
+  // Pagination Full Numbers
+  $datatable_options['sPaginationType'] = $options['sPaginationType'];
+  
+  // Enable Jquery Theme Roller
+  $datatable_options['bJQueryUI'] = $options['bJQueryUI'] ;
+  
+  // Enable table info display, if necessary.
+  $datatable_options['bInfo'] = $options['table_info'];
+
+  // Disable search filter box, if necessary.
+  $datatable_options['bFilter'] = $options['search_box'];
+
+  // bStateSave.
+  $datatable_options['bStateSave'] = $options['bStateSave'];
+  
+  // Enable AutoWidth
+  $datatable_options['bAutoWidth'] = $options['auto_width'];
+  
+  // Processing
+  $datatable_options['bProcessing'] = $options['bProcessing'];
+
+  // Server Side Processing
+  $datatable_options['bServerSide'] = $options['bServerSide'];
+  
+  // Pagination
+  $datatable_options['bPaginate'] = $options['bPaginate'];
+  
+  // Language translations
+  $datatable_options['oLanguage'] = array('oPaginate' => array('sFirst' => t('First page'), 
+                                                               'sLast' => t('Last page'),
+                                                               'sNext' => t('Next page'),
+                                                               'sPrevious' => t('Previous page'),
+                                                              ),
+                                          'sInfo' => t('Got a total of _TOTAL_ entries to show (_START_ to _END_)'),
+                                          'sInfoFiltered' => t('- filtering from _MAX_ records'),
+                                          'sLengthMenu' => t('Display _MENU_ records'),
+                                          'sLoadingRecords' => t('Please wait - loading...'),
+                                          'sInfoThousands' => "'",
+                                          'sInfoPostFix' => t('All records shown are derived from real information.'),
+                                          'sInfoEmpty' => t('No entries to show'),
+                                          'sProcessing' => t('Processing...'),
+                                          'sSearch' => t('Search').':',
+                                          'sZeroRecords' => t('No records to display'),
+                                         );
+      
+  // If ServerSide processing is active we add the sAjaxSource for the datatables
+  // We submit the view name and the current display for the processing 
+  if($datatable_options['bServerSide'] == TRUE){
+    $datatable_options['sAjaxSource'] = '/datatables-server-processing/'.$view->name.'/'.$view->current_display.'/'.base64_encode(implode('|',$view->args));
+    #$datatable_options['iDeferLoading'] = 13;
+    $datatable_options['fnDrawCallback'] = "  Drupal.attachBehaviors(document) ";
+  }
+
   // Fields must be rendered in order as of Views 2.3, so we will pre-render
   // everything.
   $renders = array();
   $keys = array_keys($view->field);
+  
   foreach ($result as $count => $row) {
     foreach ($keys as $id) {
       $renders[$count][$id] = $view->field[$id]->theme($row);
@@ -175,6 +300,7 @@ function template_preprocess_datatables_view(&$vars) {
   }
   
   $position = 0;
+  
   foreach ($columns as $field => $column) {
     $column_options = NULL;
     // render the header labels
@@ -190,10 +316,9 @@ function template_preprocess_datatables_view(&$vars) {
         }
         $column_options['bSortable'] = TRUE;
       }
+    
+     $datatable_options['aoColumns'][] = $column_options;
     }
-
-    $datatable_options['aoColumns'][] = $column_options;
-
     // Set default sort order
     if ($options['default'] == $field) {
       $datatable_options['aaSorting'] = array(array($position, $options['order']));
@@ -205,39 +330,36 @@ function template_preprocess_datatables_view(&$vars) {
     if ($active == $field) {
       $vars['fields'][$field] .= ' active';
     }
+   if($options['bServerSide'] == FALSE || user_access('ajax datatables') == FALSE){
+      // Render each field into its appropriate column.
+      foreach ($result as $num => $row) {
 
-    // Render each field into its appropriate column.
-    foreach ($result as $num => $row) {
-      if (!empty($fields[$field]) && empty($fields[$field]->options['exclude'])) {
-        $field_output = $renders[$num][$field];
+        if (!empty($fields[$field]) && empty($fields[$field]->options['exclude'])) {
+          $field_output = $renders[$num][$field];
 
-        // Don't bother with separators and stuff if the field does not show up.
-        if (empty($field_output) && !empty($vars['rows'][$num][$column])) {
-          continue;
-        }
+          // Don't bother with separators and stuff if the field does not show up.
+          if (empty($field_output) && !empty($vars['rows'][$num][$column])) {
+            continue;
+          }
 
-        // Place the field into the column, along with an optional separator.
-        if (!empty($vars['rows'][$num][$column])) {
-          if (!empty($options['info'][$column]['separator'])) {
-            $vars['rows'][$num][$column] .= filter_xss_admin($options['info'][$column]['separator']);
+          // Place the field into the column, along with an optional separator.
+          if (!empty($vars['rows'][$num][$column])) {
+            if (!empty($options['info'][$column]['separator'])) {
+              $vars['rows'][$num][$column] .= filter_xss_admin($options['info'][$column]['separator']);
+            }
+          }
+          else {
+            $vars['rows'][$num][$column] = '';
           }
-        }
-        else {
-          $vars['rows'][$num][$column] = '';
-        }
 
-        $vars['rows'][$num][$column] .= $field_output;
+          $vars['rows'][$num][$column] .= $field_output;
+        }
       }
     }
+    
     $position++;
   }
-  
-  // Enable table info display, if necessary.
-  $datatable_options['bInfo'] = $options['table_info'];
-
-  // Disable search filter box, if necessary.
-  $datatable_options['bFilter'] = $options['search_box'];
-  
+   
   foreach ($vars['rows'] as $num => $row) {
     $vars['row_classes'][$num][] = ($num % 2 == 0) ? 'odd' : 'even';
   }
diff --git a/js/datatables.js b/js/datatables.js
index 521684f..32c9a6a 100644
--- a/js/datatables.js
+++ b/js/datatables.js
@@ -1,5 +1,25 @@
 Drupal.behaviors.datatables = function (context) {
-  $.each(Drupal.settings.datatables, function (selector) {
-    $(selector).dataTable(this);
-  });
+  $.each(Drupal.settings.datatables, function (selector) { 
+     if(isDataTable($(selector)[0]) == false ){     
+      $(selector).dataTable(this);
+     }
+  }); 
+
+}
+
+
+/*
+* Check if datatable is already initialised
+*/
+function isDataTable ( nTable )
+{
+    var settings = $.fn.dataTableSettings;
+    for ( var i=0, iLen=settings.length ; i<iLen ; i++ )
+    {
+        if ( settings[i].nTable == nTable )
+        {
+            return true;
+        }
+    }
+    return false;
 }
diff --git a/views/datatables-view.tpl.php b/views/datatables-view.tpl.php
index 3e69eca..81a7311 100644
--- a/views/datatables-view.tpl.php
+++ b/views/datatables-view.tpl.php
@@ -1,4 +1,5 @@
 <?php
+// $Id: datatables-view.tpl.php,v 1.1 2009/12/16 00:59:58 duellj Exp $
 /**
  * @file
  * Template to display a datatable.
diff --git a/views/datatables.views.inc b/views/datatables.views.inc
index 9d494d6..745ab39 100644
--- a/views/datatables.views.inc
+++ b/views/datatables.views.inc
@@ -1,4 +1,5 @@
 <?php
+// $Id: datatables.views.inc,v 1.1 2009/12/16 00:59:58 duellj Exp $
 
 /**
  * @file
diff --git a/views/datatables_style_plugin.inc b/views/datatables_style_plugin.inc
index 88e643c..885e2c2 100644
--- a/views/datatables_style_plugin.inc
+++ b/views/datatables_style_plugin.inc
@@ -1,4 +1,5 @@
 <?php
+// $Id: datatables_style_plugin.inc,v 1.1.2.1 2010/07/28 01:06:23 duellj Exp $
 /**
  * @file
  * Contains the datatables style plugin.
@@ -15,8 +16,18 @@ class datatables_style_plugin extends views_plugin_style_table {
     unset($options['sticky']);
     unset($options['override']);
     
+    $options['sScrolly'] =  '600px';
+    $options['sScrollCollapse'] = array('default' => TRUE);
     $options['search_box'] = array('default' => TRUE);
     $options['table_info'] = array('default' => TRUE);
+    $options['auto_width'] = array('default' => FALSE);
+    $options['bJQueryUI'] = array('default' => TRUE);
+    $options['bStateSave'] = array('default' => TRUE);
+    $options['bProcessing'] = array('default' => TRUE);
+    $options['bServerSide'] = array('default' => FALSE);    
+    $options['sPaginationType'] = array('default' => 'full_numbers');
+    $options['bPaginate'] = array('default' => TRUE);
+    
     return $options;
   }
 
@@ -29,6 +40,21 @@ class datatables_style_plugin extends views_plugin_style_table {
     unset($form['override']);
 
     $form['description_markup']['#value'] = t('DataTables works best if you disable views pager and configure the page to show all values, since DataTabels contains its own pager implementation.<br/><br/>Place fields into columns; you may combine multiple fields into the same column. If you do, the separator in the column specified will be used to separate the fields. Check the sortable box to make that column click sortable, and check the default sort radio to determine which column will be sorted by default, if any. You may control column order and field labels in the fields section.');
+
+    $form['sScrollCollapse'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Enable the scrolly collapse.'),
+      '#default_value' => !empty($this->options['sScrollCollapse']),
+      '#description' => 'The scrolly collapse function.',
+    );
+ 
+    $form['sScrolly'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Height of the scrolly table.'),
+      '#value' => !empty($this->options['sScrolly']),
+      '#description' => 'The scrolly height.',
+      '#size' => 6,
+    ); 
     
     $form['search_box'] = array(
       '#type' => 'checkbox',
@@ -42,5 +68,56 @@ class datatables_style_plugin extends views_plugin_style_table {
       '#default_value' => !empty($this->options['table_info']),
       '#description' => t('This shows information about the data that is currently visible on the page, including information about filtered data if that action is being performed.'),
     );
+
+    $form['auto_width'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Enable the auto width.'),
+      '#default_value' => !empty($this->options['auto_width']),
+      '#description' => t('This enables or disables the datatables auto width function.(default disabled buggy!)'),
+    );
+
+    $form['bStateSave'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Enable the save state function.'),
+      '#default_value' => !empty($this->options['bStateSave']),
+      '#description' => t('This enables or disables the save state table support.'),
+    );
+    
+    $form['bJQueryUI'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Enable the jquery ThemeRoller.'),
+      '#default_value' => !empty($this->options['bJQueryUI']),
+      '#description' => t('This enables or disables the jquery UI ThemeRoller support.'),
+    );
+
+    $form['bProcessing'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Show processing info.'),
+      '#default_value' => !empty($this->options['bProcessing']),
+      '#description' => t('This enables or disables the processing info layer of the table.'),
+    );
+
+    $form['bServerSide'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Server side processing of the datatables.'),
+      '#default_value' => !empty($this->options['bServerSide']),
+      '#description' => t('This enables or disables the server side processing of the table (ajax).'),
+    );
+
+    $form['bPaginate'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Enable or disable the pagination.'),
+      '#default_value' => !empty($this->options['bPaginate']),
+      '#description' => t('This enables or disables the pagination.'),
+    );
+
+    $pagination = array('full_numbers' => t('Full numbers'), 'two_button' => t('Two buttons'));
+    $form['sPaginationType'] = array(
+      '#type' => 'select',
+      '#title' => t('Choose the pagination of the datatable.'),
+      '#options' => $pagination,
+      '#default_value' => !empty($this->options['sPaginationType']),
+      '#description' => t('This enables or disables the jquery UI ThemeRoller support.'),
+    );
   }
 }
