change gnuplot with using select element
[MojoFacets.git] / templates / data / items.html.ep
index 0a25c75..340461e 100644 (file)
@@ -46,6 +46,20 @@ items
 
 <input type=submit value="refresh">
 
+% my $export = param('export');
+% session('export', $export );
+<input type=checkbox name=export value=1 title="export" <%= $export ? 'checked' : '' %> >
+% my $timefmt = param('timefmt');
+% session('timefmt', $timefmt );
+timefmt: <input name=timefmt value="<%= $timefmt %>">
+
+
+% if ( $export ) {
+with:
+%= select_field with => [qw( points dots lines steps )]
+<img id=gnuplot src="/gnuplot?timefmt=<%= $timefmt %>&with=<%= param('with') %>">
+% }
+
 </form>
 
 <%= include 'data/items/' . session('show') %>
@@ -68,12 +82,22 @@ items
 <li>columns: <%= join(',',@$columns) %>
 <li>numeric: <%= dumper $numeric %>
 <li>order: <%= session('order') %> sort: <%= session('sort') %>
+%#<li>filters: <%= dumper $filters %>
 </ul>
 
 <script type="text/javascript">
 $(document).ready( function(){
        $('select[name=limit]').change( function(){
-               console.debug( 'limit changed', this );
+               console.debug( 'limit', this );
+               $(this).closest('form').submit();
+       });
+       $('input[name=export]').change( function(){
+               console.debug( 'export', this );
+               if ( this.checked )
+                       $(this).closest('form').submit();
+       });
+       $('select[name=with]').change( function(){
+               console.debug( 'with', this );
                $(this).closest('form').submit();
        });
 });