Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
160
How to keep extra metadata in the igDatasource
posted

Hi,

We are trying to use the igDatasource with the igGrid which works fine however if we have extra metadata in the json being passed down from the server, the igDatasource and igGrid seem to remove it. Not from the orginal data being used to create the datasource but just in the igDatasource or igGrid. For instance we have a grid with 14 columns and then three hidden values not in columns. These three values are used to contact the database for deletion, updates, or used in a double click events to display a record represented by a row. We could use the selectedrow to get the currently selected row index and use the intial results to pull up those values but this is not ideal when we have sorting enabled because the grid’s row indexes no longer match the orginal datasource’s indexes used to create the igDatasource. Based on the issues we had with columns being hidden and the grid’s width set to a percentage we would rather not use hidden columns to achieve this at this point in time (http://forums.infragistics.com/forums/t/68397.aspx). I have attached a sample of the JSON being passed from the server to the page using an ajax request. The values we are refering to are prefixed with an underscore (_deleteID, _objectID, and _classID)

Thanks,
Joshua

{
"d": {
"columns": [
{
"key": "1234",
"headerText": "ID",
"width": "100px",
"dataType": "number",
"format": "int"
},
{
"key": "1235",
"headerText": "Alpha25",
"width": "200px",
"dataType": "string",
"format": ""
},
{
"key": "1236",
"headerText": "UniqueKey",
"width": "200px",
"dataType": "string",
"format": ""
},
{
"key": "1237",
"headerText": "Bool",
"width": "100px",
"dataType": "bool",
"format": ""
},
{
"key": "1238",
"headerText": "FormattedText",
"width": "250px",
"dataType": "string",
"format": ""
},
{
"key": "1239",
"headerText": "Currency",
"width": "100px",
"dataType": "number",
"format": "currency"
},
{
"key": "1240",
"headerText": "objectID",
"width": "100px",
"dataType": "number",
"format": "int"
},
{
"key": "1241",
"headerText": "objectName",
"width": "250px",
"dataType": "string",
"format": ""
},
{
"key": "1242",
"headerText": "createdBy",
"width": "240px",
"dataType": "string",
"format": ""
},
{
"key": "1243",
"headerText": "createdDate",
"width": "180px",
"dataType": "date",
"format": "dateTime"
},
{
"key": "1244",
"headerText": "revisionDate",
"width": "180px",
"dataType": "date",
"format": "dateTime"
},
{
"key": "1245",
"headerText": "revisionBy",
"width": "240px",
"dataType": "string",
"format": ""
},
{
"key": "1246",
"headerText": "className",
"width": "250px",
"dataType": "string",
"format": ""
},
{
"key": "1248",
"headerText": "Null",
"width": "100px",
"dataType": "number",
"format": "currency"
}
],
"schema": {
"fields": [
{
"name": "1234",
"type": "number"
},
{
"name": "1235",
"type": "string"
},
{
"name": "1236",
"type": "string"
},
{
"name": "1237",
"type": "bool"
},
{
"name": "1238",
"type": "string"
},
{
"name": "1239",
"type": "number"
},
{
"name": "1240",
"type": "number"
},
{
"name": "1241",
"type": "string"
},
{
"name": "1242",
"type": "string"
},
{
"name": "1243",
"type": "date"
},
{
"name": "1244",
"type": "date"
},
{
"name": "1245",
"type": "string"
},
{
"name": "1246",
"type": "string"
},
{
"name": "1248",
"type": "number"
}
],
"searchField": "d"
},
"results": [
{
"1234": 354,
"1235": "CHRYSANTHEMUM",
"1236": "355",
"1237": false,
"1238": "",
"1239": null,
"1240": 1117,
"1241": "",
"1242": "MANAGER",
"1243": "/Date(1331847285000)/",
"1244": "/Date(1336427698000)/",
"1245": "MANAGER",
"1246": "ExtendedClassExt",
"1248": null,
"_deleteID": "1117",
"_objectID": "1117",
"_classID": 1001
},
{
"1234": 355,
"1235": "CHRYSANTHEMUM",
"1236": "356",
"1237": false,
"1238": "",
"1239": null,
"1240": 1118,
"1241": "",
"1242": "MANAGER",
"1243": "/Date(1331847518000)/",
"1244": "/Date(1336427725000)/",
"1245": "MANAGER",
"1246": "ExtendedClassExt",
"1248": null,
"_deleteID": "1118",
"_objectID": "1118",
"_classID": 1001
}
]
}
}

Parents
No Data
Reply Children
No Data