CGridView with lots of columns - URL exceeds 2083 characters

Hi

I have a table with lots of columns (30+). I display the data in a CGridView and display a form to filter the table and to select which columns to display.

I end up with roughly 60 fields in my form, which causes an error when I submit the form in Internet Explorer because the path exceeds 2083 characters.

The ‘GET’ part of the url when I filter the grid view looks like this:


ServiceLogMaster[LogNum]=&ServiceLogMaster[LoggedFrom]=&ServiceLogMaster[LoggedTo]=&ServiceLogMaster[callerName]=&ServiceLogMaster[contract]=&ServiceLogMaster[buildingNumber]=&ServiceLogMaster[site]=&ServiceLogMaster[address]=&ServiceLogMaster[postcode]=&ServiceLogMaster[NatureOfCall]=&ServiceLogMaster[AssignType]=&ServiceLogMaster[assignedTo]=&ServiceLogMaster[AssignedFilter]=-1&ServiceLogMaster[ContractNumber]=&ServiceLogMaster[DCDJobNo]=&ServiceLogMaster[LinkedToCAOrP6]=&ServiceLogMaster[ClosedFilter]=-1&ServiceLogMaster[ChargedFrom]=&ServiceLogMaster[ServiceDateFrom]=&ServiceLogMaster[ServiceDateTo]=&ServiceLogMaster[CompletedFrom]=&ServiceLogMaster[CompletedTo]=&ServiceLogMaster[ReportReceivedFrom]=&ServiceLogMaster[ReportReceivedTo]=&ServiceLogMaster[ReportSentFrom]=&ServiceLogMaster[ReportSentTo]=&ServiceLogMaster[ApprovalReceivedFrom]=&ServiceLogMaster[ApprovalReceivedTo]=&ServiceLogMaster[QuoteOnReportFilter]=-1&ServiceLogMaster[QuoteAcceptedFilter]=-1&ServiceLogMaster[QuoteValue]=&ServiceLogMaster[SiteReportReceivedFilter]=-1&ServiceLogMaster[SiteReportSentFilter]=-1&ServiceLogMaster[ReportDelayFilter]=&ServiceLogMaster[ViewLogNum]=1&ServiceLogMaster[ViewTime]=1&ServiceLogMaster[ViewCallLoggedBy]=0&ServiceLogMaster[ViewCaller]=0&ServiceLogMaster[ViewContract]=1&ServiceLogMaster[ViewBuildingNumber]=1&ServiceLogMaster[ViewSiteLocation]=1&ServiceLogMaster[ViewAddress]=0&ServiceLogMaster[ViewPostcode]=1&ServiceLogMaster[ViewRegion]=0&ServiceLogMaster[ViewContractNumber]=0&ServiceLogMaster[ViewDCDJobNo]=0&ServiceLogMaster[ViewCharged]=0&ServiceLogMaster[ViewNatureOfCall]=1&ServiceLogMaster[ViewAssignedTo]=0&ServiceLogMaster[ViewResponse]=0&ServiceLogMaster[ViewArrangedServiceDate]=0&ServiceLogMaster[ViewCompleted]=0&ServiceLogMaster[ViewCostingNotes]=0&ServiceLogMaster[ViewQuoteOnReport]=0&ServiceLogMaster[ViewQuoteAccepted]=0&ServiceLogMaster[ViewLinkedToCAOrP6]=0&ServiceLogMaster[ViewRisksIdentified]=0&ServiceLogMaster[ViewClosed]=0&ServiceLogMaster[ViewSiteReportReceived]=0&ServiceLogMaster[ViewSiteReportSent]=0&ServiceLogMaster[ViewApprovalFormReceived]=0&ServiceLogMaster[ViewAssignType]=0&ServiceLogMaster[ViewQuoteValue]=0&ServiceLogMaster[ViewReportDueDate]=0&ServiceLogMaster[ViewReportLateBy]=0&ServiceLogMaster[export]=&ajax=service-log-master-grid&ServiceLogMaster_page=2&sort=LogNum

What would be the best way to work around this problem? (except renaming my table and fields to have shorter names…)

Is it possible to submit the CGridView using POST method rather than GET?

yes, it is possible, and advisable, to use POST for whatever you are trying to accomplish

Are you passing all the filters, or just the subset which is not the default?

Try and filter your filters and your URL will probably get shorter.

That of course depends on your implementation. :)