jQuery UI Widgets Forums Grid TypeError: this.columns.records is undefined

This topic contains 5 replies, has 2 voices, and was last updated by  Peter Stoev 10 years, 5 months ago.

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

  • Akshar AK
    Participant

    Hi,
    Am using JQWidgets version 3.3.0 and below is the code for my Grid. Onload am getting a javascript error saying
    in IE9: SCRIPT5007: Unable to get value of the property ‘length’: object is null or undefined
    jqxgrid.js, line 7 character 161341

    in Firefox :detailed error: TypeError: this.columns.records is undefined
    Please suggest what to do..

    Thanks in advance

         var pd4ZLockUnlockDatasource =
              {
              	datatype: "json",
                  datafields: [
                              { name: 'lockedBy', type: 'string'},//To display Locked By
                              { name: 'lockedDate', type: 'date'},// To display Locked Date
                              { name: 'action', type: 'string'}, //To display Locking Reason
                              { name: 'status', type: 'string'}, //To display Status
                              { name: 'slno', type: 'number'}, //To display Status
                              { name: 'releasedBy', type: 'string'},//To display Locked By
                              { name: 'releasedDate', type: 'date'}// To display Locked Date
                  ],
                  cache: false,
                  url: 'displayLockedReleasedDetails.htm'      
              };
    	var dataAdapter = new $.jqx.dataAdapter(pd4ZLockUnlockDatasource); 
              
    	$("#pD4ZLockedDataGrid").jqxGrid({keyboardnavigation: false});
    	$("#pD4ZLockedDataGrid").jqxGrid({
    		autowidth : true,
    		height : 200,
    		source : dataAdapter,
    		theme : 'theme',
    		editable : true,
    
    		columnsresize:true, 
    		columns : [ {
    			text : 'Sl.No',datafield : 'slno', columntype: 'number', width : 40, align : 'center',cellsalign : 'left', editable : false, classname: 'pd4LockingGridHeader'
    		},
    		{
    			text : 'Action',datafield : 'action', width : 85, align : 'center', cellsalign : 'left', editable : false, classname: 'pd4LockingGridHeader'
    		},
    		
    		{
    			text : 'Status', datafield : 'status', width : 85, align : 'center', cellsalign : 'left', editable : false, classname: 'pd4LockingGridHeader'
    		},
    		{
    			text : 'Locked By',datafield : 'lockedBy', width : 150, align : 'center',cellsalign : 'left', editable : false, classname: 'pd4LockingGridHeader'
    		}, {
    			text : 'Locked Date',cellsformat : 'dd, MMM dd, yyyy hh:mm:ss tt' ,datafield : 'lockedDate', width : 150, align : 'center',cellsalign : 'right',  editable : false, classname: 'pd4LockingGridHeader',
    			cellsrenderer : function(row, column,
    												value, data) {
    											
    											//Start:This snippet is added to rectify the milestone empty date issue for end date. If a date is selected, there was no way to unselect a date or make the date empty
    											
    											//Start: This code for end date is to display the date in Month & year format else by default it comes in timestamp format
    											if (value != null
    													&& value.length > 0) {
    												var strMonths = new Array(
    														"Jan", "Feb", "Mar",
    														"Apr", "May", "Jun",
    														"Jul", "Aug", "Sep",
    														"Oct", "Nov", "Dec");
    												var strEditDate = value.toString();
    												return '<div style="position: relative; margin: 4px;text-align:right;width:95%;height:100%;overflow: hidden;font-family: Arial;font-size: 12px;">'
    															+ strEditDate.substring(8,10)
    															+ "-"
    															+ strMonths[parseInt(strEditDate.substring(5,7)-1)]
    															+ "-"
    															+ strEditDate.substring(0,4)
    															+" "+ strEditDate.substring(11);
    													+'</div>';//position:absolute;left:20px;top:6px;
    												
    											}
    											
    											}
    		},{
    			text : 'Released By',datafield : 'releasedBy', width : 150, align : 'center',cellsalign : 'left', editable : false, classname: 'pd4LockingGridHeader'
    		}, {
    			text : 'Released Date',cellsformat : 'dd, MMM dd, yyyy hh:mm:ss tt' ,datafield : 'releasedDate', width : 150, align : 'center',cellsalign : 'right',  editable : false, classname: 'pd4LockingGridHeader',
    			cellsrenderer : function(row, column,
    												value, data) {
    											
    											//Start:This snippet is added to rectify the milestone empty date issue for end date. If a date is selected, there was no way to unselect a date or make the date empty
    											
    											//Start: This code for end date is to display the date in Month & year format else by default it comes in timestamp format
    											if (value != null
    													&& value.length > 0) {
    												var strMonths = new Array(
    														"Jan", "Feb", "Mar",
    														"Apr", "May", "Jun",
    														"Jul", "Aug", "Sep",
    														"Oct", "Nov", "Dec");
    												var strEditDate = value.toString();
    												
    												return '<div style="position: relative; margin: 4px;text-align:right;width:95%;height:100%;overflow: hidden;font-family: Arial;font-size: 12px;">'
    															+ strEditDate.substring(8,10)
    															+ "-"
    															+ strMonths[parseInt(strEditDate.substring(5,7)-1)]
    															+ "-"
    															+ strEditDate.substring(0,4)
    															+" "+ strEditDate.substring(11);
    													+'</div>';//position:absolute;left:20px;top:6px;
    												
    											}
    											
    											}
    		} ],
    		
    
    		
    	});

    Peter Stoev
    Keymaster

    Hi Akshar AK,

    The problem in this code is: $(“#pD4ZLockedDataGrid”).jqxGrid({keyboardnavigation: false}); – you set a property of jqxGrid before initializing the Grid on the next line.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    Akshar AK
    Participant

    Even if i remove that line still am getting the same error. Even tried removing cache. 🙁


    Peter Stoev
    Keymaster

    Hi Akshar,

    Another thing is the syntax error here: } ], – After last item of array or JSON object, you should not add ‘,’.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    Akshar AK
    Participant

    even now no success!!


    Peter Stoev
    Keymaster

    Hi Akshar,

    Ok, try with jQWidgets 3.5. Check whether you have or have not missing JavaScript files required for your initialization and if you have no success after that provide jsfiddle.net demo with your problem.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.