--- views_datasource/theme/views_views_json_style.theme.inc	2010-06-15 15:53:08.000000000 -0500
+++ views_datasource/theme/views_views_json_style.theme.inc	2010-06-15 15:52:31.000000000 -0500
@@ -18,6 +18,7 @@ function theme_views_views_json_style($v
 	//_views_json_debug_stop($options, "theme");
 if ($options['format'] == 'simple') return theme('views_views_json_style_simple', $view, $rows, $attachment, $options);
 if ($options['format'] == 'exhibit') return theme('views_views_json_style_exhibit', $view, $rows, $attachment, $options);
+if ($options['format'] == 'callback') return theme('views_views_json_style_callback', $view, $rows, $attachment, $options);
 }
 
 function template_preprocess_views_views_json_style_simple($vars) {	
@@ -107,3 +108,45 @@ function template_preprocess_views_views
   $vars["rows"] = array($root_object => $objects); 
 }
 
+function template_preprocess_views_views_json_style_callback($vars) {	
+  $view = $vars["view"];
+  $rows = $vars["rows"];
+  $options = $vars["options"];
+  $base = $view->base_table;
+  $root_object = $options["root_object"];
+  $top_child_object = $options["top_child_object"];
+  $plaintext_output = $options["plaintext_output"];	
+	$objects = array();
+  foreach($rows as $row) {
+  	$object = array($top_child_object => array());
+  	/*Convert the $rows into a hierachial key=>value array*/
+  	foreach ($row as $field) {
+  	  if ($options["field_output"] == "normal") {
+  	  	if ($field->label)
+  	  	  $label = $plaintext_output ? strip_tags($field->label) : $field->label;
+  	  	else $label = $plaintext_output ? strip_tags($field->id) : $field->id;  
+        if (!$field->is_multiple) {   	  	
+  	  	  $content = $plaintext_output ? strip_tags($field->content) : $field->content;
+        }
+        else {
+        	$content = array();
+        	foreach($field->content as $n=>$oc) $content[$n] = ($plaintext_output ? strip_tags($oc) : $oc);
+        }
+  	  }
+  	  elseif ($options["field_output"] == "raw") {
+  	  	$label = $plaintext_output ? strip_tags($field->id) : $field->id;
+  	    if (!$field->is_multiple) {   	  	
+  	  	  $content = $plaintext_output ? strip_tags($field->raw) : $field->raw;
+        }
+        else {
+        	$content = array();
+        	foreach($field->raw as $n=>$oc) $content[$n] = $plaintext_output ? strip_tags($oc) : $oc;
+        }
+  	  }	
+  	  $object[$top_child_object][$label] = $content;
+  	}
+  	$objects[] = $object;
+  }	 
+  
+  $vars["rows"] = array($root_object => $objects);
+}
--- views_datasource/views_json.module	2010-06-15 15:51:06.000000000 -0500
+++ views_datasource/views_json.module	2010-06-15 15:51:53.000000000 -0500
@@ -36,6 +36,12 @@ function views_json_theme() {
      'file' => 'views_views_json_style.theme.inc',
      'template' => 'views-views-json-style-exhibit'
    ),
+   'views_views_json_style_callback' => array(
+     'arguments' => array('view' => NULL, 'rows' => array(), 'attachment' => NULL, 'options'=>array()),  
+     'path' => $path,
+     'file' => 'views_views_json_style.theme.inc',
+     'template' => 'views-views-json-style-callback'
+   ),
  );
 }
 
--- views_datasource/views_plugin_style_json.inc	2010-06-15 15:50:57.000000000 -0500
+++ views_datasource/views_plugin_style_json.inc	2010-06-15 15:51:43.000000000 -0500
@@ -64,8 +64,9 @@ class views_plugin_style_json extends vi
       '#type'           => 'radios',
       '#title'          => ('JSON data format'),
       '#options'        => array(
-        'simple'  => ('Simple'),
-        'exhibit' => ('MIT Simile/Exhibit'),
+        'simple'   => ('Simple'),
+        'exhibit'  => ('MIT Simile/Exhibit'),
+        'callback' => ('Simple JSONP Callback'),		
       ),
       '#default_value'  => $this->options['format'],
       '#description'    => ('What object format will be used for JSON output.')
