jqGrid没有显示任何数据

时间:2016-09-28 09:48:49

标签: jquery html mysql json jqgrid

我无法让jqGrid显示我的数据。当我点击标题时,它显示没有记录来查看表格的底部,但我知道情况并非如此。我试图显示的Json是来自url,来自该url的Json是使用golang从mysql数据库中提取的。我使用的是Jquery jqGrid版本4.4.3。

这是我的HTML页面,其中包含显示表格和功能的代码

      var results = from p in tablename
      group p by p.cas into g
      select g.OrderByDescending(e=>e.pref.Length).First()

这是从mysql数据库中提取并显示在我正在调用的URL上的JSON

#lang racket

(require (for-syntax syntax/parse racket/list))

(begin-for-syntax
  (define (expression->subexpressions stx)
    (define expansion (local-expand stx 'expression '()))
    (syntax-parse expansion
      #:datum-literals (#%app quote)
      [x:id      (list #'x)]
      [b:boolean (list #'b)]
      [n:number  (list #'n)]
      ; insert other atoms here
      [(quote literal) (list #'literal)]
      [(#%app e ...)
       (cons stx
             (append-map expression->subexpressions (syntax->list #'(e ...))))]
      ; other forms in fully expanded syntax goes here
      [else
       (raise-syntax-error 'expression->subexpressions
                           "implement this construct"
                           stx)])))

(define-syntax (echo-and-eval stx)
  (syntax-parse stx
    [(_ expr)
     #'(begin
         (display "] ") (displayln (syntax->datum #'expr))
         (displayln expr))]))

(define-syntax (echo-and-eval-subexpressions stx)
  (syntax-parse stx
    [(_ expr)
     (define subs (expression->subexpressions #'expr))
     (with-syntax ([(sub ...) subs])
       #'(begin
           ; sub expressions
           (echo-and-eval sub)
           ...
           ; original expression
           (echo-and-eval expr)))]))


(echo-and-eval-subexpressions (+ 1 2 (* 4 5)))

1 个答案:

答案 0 :(得分:0)

您需要设置

 mtype: "GET",
 datatype: "jsonp",
在你的jqgrid配置中

工作演示:

http://jsfiddle.net/dipakthoke07/vwb1c0mk/76/