def to_javascript(options={})
      options = {:script => true, :ready => true}.merge(options)

      s = ''
      if options[:script]
        s << %Q^
        <script type="text/javascript">
        var lastsel_#{dom_id};
        ^
      end

      s << js_helpers

      if options[:ready]
        s << %Q^
        $(document).ready(function(){
        ^
      end

      s << jqgrid_javascript(options)

      if options[:ready]
        s << %Q^
        });
        ^
      end
      if options[:script]
        s << %Q^
        </script>
        ^
      end
      s
    end
def to_javascript(options={})
      options = {:script => true, :ready => true}.merge(options)

      s = ''
      if options[:script]
        s << %Q^
        <script type="text/javascript">
        var lastsel_#{dom_id};
        ^
      end

      s << js_helpers

      if options[:ready]
        s << %Q^
        $(document).ready(function(){
        ^
      end

      s << jqgrid_javascript(options)

      if options[:ready]
        s << %Q^
        });
        ^
      end
      if options[:script]
        s << %Q^
        </script>
        ^
      end
      s
    end
----------------------
 generate the grid javascript for a view
 options:
     :script => true generates <script> tag (true)
     :ready  => true generates jquery ready function (true)