jqgrid - json looping issue with colModel in JSON response

后端 未结 1 715
南方客
南方客 2021-01-22 21:39

This is in continuation of jqgrid - json looping issue with the difference that I have moved the colNames and colModel to JSON.

相关标签:
1条回答
  • 2021-01-22 22:13

    If you don't need unformatter you can extend the list of predefined formatters with your formatter:

    $.fn.fmatter.myLinkFormatter = function (val, options, rawObject) {
        ....
    };
    

    and then use "formatter": "myLinkFormatter" in the column definition

    {
        "colModel": [
            {
                "name": "linkimg",
                "index": "linkimg",
                "width": 60,
                "align": "left",
                "formatter": "myLinkFormatter",
                "jsonmap": "cells.0.links"
            }
        ],
        "colNames": [
            "linkimg"
        ],
        "mypage": {
            "outerwrapper": {
            ...
        }
    }
    

    See the demo.

    One more remark: you should move $("#myjqgrid").jqGrid('navGrid','#Pager'); inside of success handler like I done in the demo.

    0 讨论(0)
提交回复
热议问题