jQWidgets Forums

jQuery UI Widgets Forums Grid Grid crashes if more than 50 rows are returned

This topic contains 1 reply, has 1 voice, and was last updated by  PackerNation 10 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • PackerNation
    Participant

    I have a grid, that I thought was working fine until I tried to load some larger data sets. If I send my grid a JSON object with more than 50 rows the grid crashes and fails to display. I am using Coldfusion to populate my JSON object and as long as I prevent the Coldfusion query from returning more than 50 records, everything is fine. I have paging turned on and it splits the 49 records over 3 pages; which is fine.

    Is there a maximum number of rows that jqxgrid can handle?

    Here is my grid:

    var source = 
    			{
    				localdata:[				
    					<cfoutput>#dataForGraph#</cfoutput>,			
    				],
    				datafields: [
    					{name:'vendor', type: 'string', map: '0'},				
    					{name:'feature', type:'string', map: '1'},
    					{name:'username', type:'string', map: '2'},
    					{name:'cn', type:'string', map: '3'},
    					{name:'org', type:'string', map: '4'},
    					{name:'costcenter',type:'string', map: '5'},
    					{name:'community',type:'string', map: '6'},
    					<cfoutput>
    						<cfloop list="#listOfDatafields#" delimiters="|" index="idxDatafield">
    							<cfset j= #j# + 1>
    							#idxDatafield#
    							<cfif variables.j lt listlen(listOfDatafields)>,</cfif> 
    						</cfloop>
    					</cfoutput>								
    				],
    				datatype: "array",
    				sortcolumn: 'vendor',
    				sortdirection: 'asc'
    				
                   
    			};
    			
    			var dataAdapter = new $.jqx.dataAdapter(source);
                $("#jqxgrid").jqxGrid(
    			<cfoutput>
                {
                    width: #variables.widthTotal#,
    				source: dataAdapter,
    				sortable: true,
    				altrows: true,
    				pageable: true,
                    autoheight: true,
                    columnsresize: true,				
                    columns: [				  
    				  	#variables.baseColumns# //loads all columns that are not dynamic. See  "Set column metadata" above
    					<cfloop list="#listOfColumns#" delimiters="|" index="idxColumn">
    						<cfset k= #k# + 1>
    							#idxColumn#
    						<cfif variables.k lt listlen(listOfColumns)>,</cfif> 
    					</cfloop>                  
                    ]
                });
    			</cfoutput>
    			$("#excelExport").jqxButton({ theme: 'smoothness'});
    			$("#excelExport").click(function () {
                    $("#jqxgrid").jqxGrid('exportdata', 'xls', 'ExcelData');           
                });
            });
    

    PackerNation
    Participant

    Nevermind, I found the issue it was with the data. One of the fields that gets pulled in is a user’s full name. I found that every time the grid crashed it was when the JSON data contained a name with a single quote in it (e.g. D’ Arrabba). Since JSON uses single quotes it was messing up the formatting.

    Well, that was a pain in the butt!

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.