Simple jQuery SlickGrid JSON example or documentation

后端 未结 4 645
感情败类
感情败类 2020-12-29 11:10

I\'m looking for a simple example on how to use SlickGrid when trying to retrieve the data as JSon via jQuery.Ajax. I was also unable to find any documentation of the SlickG

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-29 11:58

    The solution is simple, but they do not explicitly state how to do this on their wiki page.

    SlickGrid expects JSON to be in object form. So if for any reason it is in string form just use:

    JSON.parse(jsonString);
    

    If you're loading from ajax, just simply do this:

    $.getJSON("file.json", function(data) {
        grid = new Slick.Grid("#myGrid", data, columns, options);
    }
    

提交回复
热议问题