`
dellsoft
  • 浏览: 110648 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

grails + jquery grid plugin

阅读更多

Jquery Grid Json 格式方法

http://trirand.com/blog/jqgrid/jqgrid.html

 

def listJson = {

    def nparams = [:]

    if (params) {

      nparams['sort'] = params.sidx

      nparams['order'] = params.sord

 

    }

    def msztzd = Msztzd.list(nparams)

    def idCell = []

    def rowsR = msztzd.collect { dit ->

      [id: dit.fbh,cell:[dit.fbh,dit.fmc,dit.fvision]]

    }

    response.setHeader("Cache-Control", "no-store")

    render(contentType:"text/json") {

      total ="1"

      page = "1"

      rows = array{

        for (zt in rowsR) {

           row id : zt.id ,cell : zt.cell

        }

      }

    }

  }

0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics