Need to Export to CSV all of the data that is in JQGrid

自作多情 提交于 2019-12-14 00:25:03

问题


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");

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.


回答1:


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.



来源:https://stackoverflow.com/questions/3046524/need-to-export-to-csv-all-of-the-data-that-is-in-jqgrid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!