jQuery UI Widgets › Forums › General Discussions › Error updating to 2.5 from 2.4.2
This topic contains 6 replies, has 2 voices, and was last updated by spirit 11 years, 10 months ago.
-
Author
-
Hello,
I just updated to jqwidgets 2.5 from 2.4.2. I have a jqxgrid which was working without any issues but not when i click on a column to order it i “sometimes” get the following error:
Uncaught TypeError: Object true has no method ‘toLowerCase’ jqxdata.js:7
Any ideas?
Hi spirit,
I would like to request for a sample because the provided information does not help you to reproduce the issue which you experience on your side. Please, provide a sample code which demonstrates the erroneous behavior.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHello,
I tried a few things to narrow it down. Here is my conclusion:
I was getting the same error in the previous version (2.4.2) as well with the only difference that the grid didn’t stuck at the loading data message.
The reason i get this error is that it doesn’t like if the boolean fields are not quoted “true” or “false” instead of true/false.I generate the json string on the server using standard classes (its python/django):
json.dumps(i, cls=DjangoJSONEncoder)
if i put the generated json string at a json validator engine: http://jsonlint.com/ i get a valid json result so i conclude that this shouldnt be happening.
Let me know what you think!
Thank you!
Hi spirit,
Do you set the type of your boolean datafield when you bind the Grid? i.e {name: ‘MyBoolFieldName’, type: ‘bool’}
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comhello Peter,
yes i do when i define the dataAdapter source
Thanx
here is a sample code, please let me know what i am doing wring because obviously i am missing something!!!
this is the HTML:
<!DOCTYPE html><html lang="en"><head> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /><script type="text/javascript" src="../../scripts/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxtabs.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxgrid.columnsresize.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxgrid.pager.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxgrid.edit.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxpanel.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxgrid.filter.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxtree.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdropdownbutton.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxwindow.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxgrid.sort.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxexpander.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxnavigationbar.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdatetimeinput.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxnumberinput.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcalendar.js"></script> <script type="text/javascript" src="../../scripts/gettheme.js"></script> <script type="text/javascript" src="../../jqwidgets/globalization/jquery.global.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script> <script type="text/javascript" src="patientwindow.js"></script> <script type="text/javascript" src="init_rnagrid.js"></script> <script type="text/javascript"> var theme = ''; $(document).ready(function () { $("#jqxButton").jqxButton({ width: '150', height: '25', roundedCorners: 'top-left' }); $("#jqxButton").bind('click', function () { patientwindow(72880); }); }); </script></head><body class='default'> <div id='testing'> <input type="button" value="Button" id='jqxButton' /> </div> <div class="extrastuff" id="extrastuff"></div></body></html>
init_rnagrid.js:
var init_rnagrid = function(pid){ var data = '[{id:"1", "totalgenotypes": "0", "categorized_diagnosis": "Control", "deceased": false}]'; // prepare the data var patientrnasource = { datatype: "json", datafields: [ { name: 'id',type:'int' }, { name: 'totalgenotypes'}, { name: 'deceased', type:'bool'} ], id: 'rnaid', localdata: data }; var rnadataAdapter = new $.jqx.dataAdapter(patientrnasource); $('#patientrnagrid').jqxGrid({ width: $('#patientwindow').width(), source: rnadataAdapter, altrows: true, filterable: false, groupable: false, autoHeight: true, editable: true, selectionmode: 'singlecell', sortable: true, columnsresize: true, columns: [{ text: 'Patient ID', datafield: 'id', width: 250 //hideable: true },{ text: 'Genotypes', datafield: 'totalgenotypes', width: 250, cellsalign: 'right' },{ text: 'Deceased', datafield: 'deceased', minwidth: 120 }] });}
patientwindow.js:
var patientwindow = function (pid) { var wintitle = '<span>Patient ' + pid + '</span>'; var windiv = '<div id="patientwindow"> \ <div id="patientwindowHeader">' + wintitle + '</div>\ <div id="jqxNavigationBar"> \ <div id="patientrnapanel"> \ <div style="margin-left: 4px; float: left;"> RNA </div> \ </div> \ <div id="patientrnacontent"> \ <div id="patientrnagrid"></div> \ </div> \ </div> \ </div>'; $('body').append(windiv); $('#patientwindow').jqxWindow({ isModal: true, modalOpacity: 0.3, resizable: false, draggable: false, autoOpen: true, width: $(window).width()-10, maxWidth: $(window).width()-10, maxHeight: $(window).width()-10, minHeight: $(window).height()-10, minWidth: $(window).width()-10, height: $(window).height()-10 }); $('#patientwindow').bind('close', function (event) { $('#patientwindow').remove(); }); $("#jqxNavigationBar").jqxNavigationBar({ width: $('#patientwindow').width, expandMode: 'multiple', expandedIndexes: [0] }); init_rnagrid(pid);}
Hello,
I dont have this issue after updating to 2.5.5
-
AuthorPosts
You must be logged in to reply to this topic.