jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Apparently uniqueid is a reserved word and cannot be used as a field name
Tagged: jqxGrid ;, unique, unique words, words
This topic contains 2 replies, has 2 voices, and was last updated by Stanislav 7 years, 4 months ago.
-
Author
-
February 19, 2018 at 10:21 pm Apparently uniqueid is a reserved word and cannot be used as a field name #98798
I have a strange problem that keeps me going in circles. My output for the column uniqueid is in some type of uniqueid format but it should just be a string (found the problem as I was working on the question)
var data = JSON.stringify(roa);
var source =
{
datatype: “json”,
datafields:
[
{ name: ‘First_Name’, type: ‘string’ },
{ name: ‘Middle_name’, type: ‘string’ },
{ name: ‘Last_Name’, type: ‘string’ },
{ name: ’emailaddress’, type: ‘string’ },
{ name: ‘eRACommons’, type: ‘string’ },
{ name: ‘positionTitle’, type: ‘string’ },
{ name: ‘MyNCBILink’, type: ‘string’ },
{ name: ‘uniqueid’, type: ‘string’ },
{ name: ‘ReferenceID’, type: ‘string’ }
],
localdata: data
};var dataAdapter = new $.jqx.dataAdapter(source);
$(“#grid”).jqxGrid(
{
width: 750,
source: dataAdapter,
altrows: true,
sortable: true,
selectionmode: ‘multiplecellsextended’,
columns: [
{ text: ‘First Name’, datafield: ‘First_Name’, width: 250 },
{ text: ‘Middlename’, datafield: ‘Middle_name’, width: 150 },
{ text: ‘Last Name’, datafield: ‘Last_Name’, width: 180 },
{ text: ’emailaddress’, datafield: ’emailaddress’, width: 250 },
{ text: ‘eRACommons’, datafield: ‘eRACommons’, width: 150 },
{ text: ‘positionTitle’, datafield: ‘positionTitle’, width: 180 },
{ text: ‘MyNCBILink’, datafield: ‘MyNCBILink’, width: 250 },
{ text: ‘uniqueid’, datafield: ‘uniqueid’, width: 150 },
{ text: ‘ReferenceID’, datafield: ‘ReferenceID’, width: 180 }
]
});JSON data:
{ “PersonalInformation”: [ { “First_Name”: “Andrea”, “Middle_name”: “M.”, “Last_Name”: “Abbott”, “emailaddress”: “aaaaaa@xxx.edu”, “eRACommons”: “AMABBOTT”, “positionTitle”: “Assistant Professor”, “uniqueid”: “900949149”, “MyNCBILink”: “”, “ReferenceID”: “”, “”: “” }, { “First_Name”: “Ronald”, “Middle_name”: “E.”, “Last_Name”: “Acierno”, “emailaddress”: “bbbb@xxx.edu”, “eRACommons”: “ACIERNO”, “positionTitle”: “Professor”, “uniqueid”: “900002963”, “MyNCBILink”: “”, “ReferenceID”: “”, “”: “” }, { “First_Name”: “David”, “Middle_name”: “B.”, “Last_Name”: “Adams”, “emailaddress”: “cccc@xxx.edu”, “eRACommons”: “ADAMS01”, “positionTitle”: “Professor”, “uniqueid”: “900007152”, “MyNCBILink”: “”, “ReferenceID”: “”, “”: “” }] }
My output is if I export it to JSON and is displayed in the Grid
…,”uniqueid”:”2116-21-24-19-193119″,”ReferenceID”:”This is my test”},{“…uniqueid”:”2918-18-17-20-232322″,”ReferenceID”:””},{“…k”:””,”uniqueid”:”2418-23-21-25-171925″,”ReferenceID”:””}
As I am working out the problem I came up with a solution– It appears that uniqueid is a reserved word for the Grid. If I change the field name to uniqueidxxx everything works fine. Is this by design? Are there other words? Should the datatype override this action?
February 21, 2018 at 11:19 am Apparently uniqueid is a reserved word and cannot be used as a field name #98844Hello morgenweck,
Unfortunately no, they haven’t been specified anywhere.
You can see the default for javascript in these links:
w3schools
javascripterBest Regards,
StanislavjQWidgets Team
http://www.jqwidgets.com/February 21, 2018 at 3:48 pm Apparently uniqueid is a reserved word and cannot be used as a field name #98858Hi morgenweck,
This is an example I made using jqxDataAdapter, and more specifically it’s mapChar.
ExampleIn mapChar the first word represents the key, and the second represents the value. You call the value using the key, which is very helpful in these situations.
You can take a look at the documentation here.
Best Regards,
StanislavjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.