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
80
iggrid The input data doesn't match the schema, the following field couldn't be mapped: undefined
posted

When I clicked button, it initialize grid with multiheader columns and groupby features and then populate data to the grid by using web services. They looked so fine. I just clicked button again to do the same thing to get an error below

Uncaught Error: There was an error parsing the JSON data and applying the defined data schema: The input data doesn't match the schema, the following field couldn't be mapped: undefined

Below is Code

<script type="text/javascript" src="../../Components/IgniteUI/js/infragistics.lob.js"></script>

<script type="text/javascript">
$.ig.loader({
scriptPath: "../../Components/IgniteUI/js/",
cssPath: "../../Components/IgniteUI/css/",
resources: "igGrid.MultiColumnHeaders"
});
</script>

<script type="text/javascript">

var portfolioA = '';
var portfolioB = '';
var GetPortfolioCompareGrid = null;

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);

function EndRequestHandler(sender, args) {
DataGrid();
};


$("[id$='btnCompare']").click(function (e) {
DataGrid();
e.preventDefault();
});


function DataGrid() {

var portfolioA = $find('<%=ddlportfolio.ClientID %>').get_selectedItem().get_value();
var portfolioB = $find('<%=ddlportfoliocompare.ClientID %>').get_selectedItem().get_value();

if (portfolioA != '' && portfolioB != '') {

$.ajax({
type: "POST",
url: "Modules/Portfolios/PortfolioWebService.asmx/GetPortfolioComparisonJSON",
data: "{portfolioA: '" + portfolioA + "',portfolioB:'" + portfolioB + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
beforeSend: function () {
//$("#overlay").fadeIn();
},
success: function (response) {

var GetPortfolioCompareGrid = response.d;
debugger;
$("#ComparePortfolioTable").igGrid({
autoGenerateColumns: false,
columns:
[
{ headerText: "INVESTMENT NAME", key: "InvestmentTitle", dataType: "string", hidden: true },
{ headerText: "INVESTMENT ID", key: "InvestmentID", dataType: "string", hidden: true },
{ headerText: "UII", key: "UII", dataType: "string", hidden: true },
{ headerText: "Portfolio", key: "PortfolioName", dataType: "string" },
{ headerText: "Portfolio ID", key: "PortfolioID", dataType: "string", hidden: true },
{ headerText: "Template", key: "TemplateYear", dataType: "string" },
{ headerText: "PY-1 2013",
group: [
{ headerText: "DME", key: "PY2013DME", dataType: "number" },
{ headerText: "SS", key: "PY2013SS", dataType: "number" },
{ headerText: "Total", key: "PY2013Total", dataType: "number"}]
},
{ headerText: "PY 2014",
group: [
{ headerText: "DME", key: "PY2014DME", dataType: "number" },
{ headerText: "SS", key: "PY2014SS", dataType: "number" },
{ headerText: "Total", key: "PY2014Total", dataType: "number"}]
},
{ headerText: "CY 2015",
group: [
{ headerText: "DME", key: "CY2015DME", dataType: "number" },
{ headerText: "SS", key: "CY2015SS", dataType: "number" },
{ headerText: "Total", key: "CY2015Total", dataType: "number" }
]
},
{ headerText: "BY 2016",
group: [
{ headerText: "DME", key: "BY2016DME", dataType: "number" },
{ headerText: "SS", key: "BY2016SS", dataType: "number" },
{ headerText: "Total", key: "BY2016Total", dataType: "number" }
]
},
{ headerText: "BY+1 2017",
group: [
{ headerText: "DME", key: "BY2017DME", dataType: "number" },
{ headerText: "SS", key: "BY2017SS", dataType: "number" },
{ headerText: "Total", key: "BY2017Total", dataType: "number" }
]
}
],
width: "100%",
height: "500px",
dataSource: GetPortfolioCompareGrid,
dataSourceType: "json",
features:
[
{
name: 'GroupBy',
groupByAreaVisibility: 'hidden',
type: 'local',
columnSettings:
[
{ columnKey: "InvestmentTitle", isGroupBy: true }
]
},
{
name: 'MultiColumnHeaders'
}
]
//localSchemaTransform: true


}); //End igGrid Function
}, //end success
error: function (response) {
console.log(response);
},
complete: function () {
//$("#overlay").fadeOut();
}
}); //end ajax function

}


}


</script>

Parents
No Data
Reply
  • 17590
    Offline posted

    Hello bruskowski,

    Thank you for posting in our community.

    After investigating the provided code snippet  I noticed that you are using loader as well as the combined files (Infragistics.lob.js). Since the data seems fine and also the grid settings seems to be correct I assume that there might be two possible causes of the issue. Either the script are not referenced correctly or the remote request is not returning the correct data.

    In order to determine what is causing the issue what I can suggest is trying to remove the loader and use the CDN references for Infragistics scripts:

     <!-- Ignite UI Required Combined CSS Files -->
        <link href="http://cdn-na.infragistics.com/igniteui/2014.2/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
        <link href="http://cdn-na.infragistics.com/igniteui/2014.2/latest/css/structure/infragistics.css" rel="stylesheet" />

        <script src="http://modernizr.com/downloads/modernizr-latest.js"></script>
        <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
        <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>

        <!-- Ignite UI Required Combined JavaScript Files -->
        <script src="http://cdn-na.infragistics.com/igniteui/2014.2/latest/js/infragistics.core.js"></script>
        <script src="http://cdn-na.infragistics.com/igniteui/2014.2/latest/js/infragistics.lob.js"></script>

    If you are still experiencing the issue with these references please inspect the response from the request in order to determine is it in the correct format.

    I hope you will find my suggestion helpful.

    If you are still experiencing any issues please send me an isolated working sample where the issue is reproducible. This is going to be highly appreciated and will help me investigate this matter  further

Children