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
285
memberProvider Function
posted

hi guys i am trying to create a dynamic data source  this the way i doing this

var rowJason = [];
var columnJason = [];

if (columns.length > 0) {


for (var i = 0; i < columns.length; i++) {
columnJason[i] = {
"name": "" + columns[i],
"caption": "" + columns[i],
"memberProvider": function (item) {
return item["" + columns[i - 1]];
}
}
}
}
if (rows.length > 0) {


for (var k = 0; k < rows.length; k++) {
rowJason[k] = {
"name": "" + rows[k],
"caption": "" + rows[k],
"memberProvider": function (item) {
return item["" + rows[k - 1]];
}

}

}


}

if (columnJason.length > 0 && rowJason.length > 0) {
var jsonArray = [
{
caption: "Columns", name: "Columns", hierarchies: [{
caption: "Columns", name: "Columns", levels: columnJason
}]
},
{
caption: "Rows", name: "Rows", hierarchies: [{
caption: "Rows", name: "Rows", levels: rowJason
}]
}
];
}
else if (columnJason.length > 0 && rowJason.length <= 0) {
var jsonArray = [
{
caption: "Columns", name: "Columns", hierarchies: [{
caption: "Columns", name: "Columns", levels: columnJason
}]
}];
}
else if (columnJason.length <= 0 && rowJason.length > 0) {
var jsonArray = [
{
caption: "Rows", name: "Rows", hierarchies: [{
caption: "Rows", name: "Rows", levels: rowJason
}]
}
];
}

but i am facing the problem with the member provider function i should get like this

-25-29

    25

    26

    27

    28

    29

but i am getting 

-25

   25

-26

   26

Since memberProvider function is returning the i-1 suppose i=2 then it is returning 1 that means i will get only age data.

so please help me  Thanks in advance it very urgent

Parents Reply Children
No Data