需要将JQGrid中的所有数据导出到CSV [英] Need to Export to CSV all of the data that is in JQGrid

查看:250
本文介绍了需要将JQGrid中的所有数据导出到CSV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在JQGrid中创建了一个自定义按钮以导出到CSV,这是一些代码

I have created a custom button to Export to CSV inside of JQGrid, here is a bit of the code

content.AppendFormat(@"pager: $(""#{2}"") {1}).navGrid(""#{2}"", {0} edit: false, add: false, del: false {1})
            .navButtonAdd(""#{2}"", 
             {0} caption:""Export to CSV file "", 
             position:""first"",
             buttonicon:""none"",
             onClickButton: function () {0}
                 alert('Made it to Export to CSV ...');
             {1}
             {1});
            {3}.filterToolbar();
            {1});
        </script>", "{", "}", pagerID, tableID);
        return content.ToString().ToControl("div");

问题是,我需要所有数据,而不仅是在ui中呈现的页面,因此我想将搜索的内置函数与与其相关的所有参数一起使用,但是我还想附加' & oper = csv',我只是不知道该怎么做.我应该使用自定义按钮还是其他方式?

Problem is, I need all the data, not just the page that is render in the ui, so I want to use the built in funcationally of the search with all the parameters associated with it, but I also want to append '&oper=csv', I just don't know how to go about it. Should I do it using a custom button, or something else.

推荐答案

您可以尝试从grid.import.js使用jqGrid的excelExport方法.在 http://www.trirand.net/documentation/php/_2v212tis2.htm 和 http://www.trirand.net/Forum/default.aspx?g = posts& t = 183 .可能是您要寻找的东西.

You can try to use excelExport method of jqGrid from grid.import.js. Loot at http://www.trirand.net/documentation/php/_2v212tis2.htm and http://www.trirand.net/forum/default.aspx?g=posts&t=183. Probably it is whhat you are looking for.

这篇关于需要将JQGrid中的所有数据导出到CSV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆