3

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.

Justin Ethier
  • 131,333
  • 52
  • 229
  • 284
Michael
  • 31
  • 1
  • 1
  • 2

1 Answers1

2

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.

Oleg
  • 220,925
  • 34
  • 403
  • 798
  • jqGrid for PHP is a 30-days trial solutions (its code it's encrypted). You have to use jqGrid exportExcel function like you said but you have to specify an url which build up the CSV/Excel by your own. –  Feb 08 '11 at 17:23
  • There exists a good tutorial: http://www.codeproject.com/Tips/784342/Export-Data-from-jqGrid-into-a-real-Excel-File – StefanG Nov 04 '14 at 13:18