jqgrid navButtonAdd响应

时间:2018-03-30 18:24:08

标签: jqgrid

如何从jqgrid自定义按钮获取json响应。这是我的代码

 URL url = new URL("some url for downloading a file");
    BufferedInputStream bis = new BufferedInputStream(url.openStream());
    FileOutputStream fis = new FileOutputStream(file);
    int size = 65536;
    byte[] buffer = new byte[size];
    int count;
    while ((count = bis.read(buffer, 0, size)) != -1) {
        fis.write(buffer, 0, count);
    }
    fis.close();
    bis.close();

1 个答案:

答案 0 :(得分:0)

您需要更换

...
window.location.href = "/Controller/Action"; 
...

与ajax一样

$.ajax({
    url : "/Controller/Action",
    dataType : "json",
    success : function(response, status, jqXHR) {
        // response is your json data
    }
});