Replies
Hello Kumar,
Thank you for posting in our forum.
Unfortunately it seems that there’s no such option out of the box. The igPivotGrid doesn’t allow for much modification on the columns collection as it always auto generates them from the Olap DataSource.
What I suggest is to manually calculate the result you want to display and add it to the original data source, before it gets passed to the OlapFlatDataSource.
For example if the data source looks like this before it’s set to the olap data source:
var balancesheet = [
{ "id": "1153", "value": 12.814 },
{ "id": "1153", "value": 49.579 },
{ "id": "1153", "value": 3.565 },
{ "id": "1153", "value": 85.581 },
{ "id": "1153", "value": 18.137 },
{ "id": "1153", "value": 68.330 },
{ "id": "1154", "value": 16.056 },
{ "id": "1154", "value": 35.235 },
{ "id": "1154", "value": 73.215 },
{ "id": "1154", "value": 73.614 },
{ "id": "Subtraction", "value": 39.88599999999997 }
];
The pivot will add that value as a unique column in the same level as the other columns (1153 and 1154) and you'll get the result you've described.
You can manually calculate that value for example using the following method( where the passed data is the balancesheet json ):
function processData(data){
//calculate sums for unique ids
var sums=[];
for(var i=0; i < data.length; i++){
var indexInSums=$(sums).index($(sums).filter(function( index ) {
return this["groupName"] === data[i]["id"];
}));
if( indexInSums !== -1)
{
sums[indexInSums]["value"]+= data[i]["value"];
}else{
var name= data[i]["id"];
sums.push({ groupName: name, value: data[i]["value"]});
}
}
//substract the sums of the two unique "id" groups and add it to the original data source with unique id = "Substraction"
data.push({ "id": "Subtraction", "value": sums[0].value – sums[1].value });
}
I’ve attached a sample for your reference. Hope it helps.
Let me know if you have any questions or concerns regarding this.
Best Regards,
Maya Kirova
Infragistics, Inc.
http://es.infragistics.com/support
Hello Al,
Thank you for posting in our forum!
It seems that the json data you’re trying to bind to is wrapped in two additional objects: “response” and “result”.
In this case the responseDataKey option of the grid should be set in order to specify the property in the response that stores the actual data records.
In this case it should be:
responseDataKey: "response.result"
For more details you can refer to our Api documentation:
http://www.igniteui.com/help/api/2015.1/ui.iggrid#options:responseDataKey
Let me know if you have any additional questions or concerns.
Best Regards,
Maya Kirova
Hello zep lin,
The EnableUTCDates option only formats the date it received from the server to UTC.
Basically the date values go through a formatter method that depending on the EnableUTCDates option either builds the value with the standard date object methods in local time (getFullYear(), getMonth(), getDate(),getHours() etc.) or via the methods UTC equivalents in UTC time ( getUTCFullYear(), getUTCMonth(), getUTCDate(), getUTCHours() etc.). The formatted value is what you’ll see in the cells of the grid once it's rendered.
This is also true for the igDatePicker and igDateEditor.
In your case most probably the dates you send from the backend are not in UTC (DateTime.Kind is not UTC but Local) which means that they have their own offset from UTC which will not be taken into consideration in cases where the Json data is manually retuned from an action result.
If you’re using also any of the editor controls (igDatePicker and igDateEditor) you should also set EnableUTCDates to true for them as well in order to have consistent dates from the same time zone.
Best Regards,
Maya Kirova
Product Developer
Infragistics, Inc.
http://es.infragistics.com/support
Hello Kishore ,
Thank you for posting in our forum.
The value can be set via the igEditor widget using the “value” method. For example:
$(".selector").igEditor("value", new Date(1403712299050));
For more details refer to our API documentation:
http://help.infragistics.com/jQuery/2014.1/ui.igeditor#methods
All editors inherit from the igEditor widget and their values need to be set through it.
Let me know if you have any questions.
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://es.infragistics.com/support
Hello ekolluri,
I’m glad to hear you have resolved the issue.
If you have any additional questions or concerns don’t hesitate to let me know.
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://es.infragistics.com/support
Hello ekolluri ,
Thank you for the additional information.
The issue you’re getting is due to using the MVC4 assembly instead of the MVC 5 one. This issue has previously been discussed here:
http://es.infragistics.com/community/forums/t/84498.aspx
I’ve tested how the MVC 5 assembly of version 14.1.20141.2031(latest version at the moment) behaves in an MVC 5 application with the following versions of jquery and jquery ui:
<script src=”http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.1.js”></script>
<script src=”http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.20/jquery-ui.js”></script>
When a remote data source url is set. However it works as expected when testing this on my side.
I’ve attached the MVC 5 application for your reference. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.
If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using. My test was performed using version version 14.1 service release version: 14.1.20141.2031.
If the project does show the product feature working correctly, this indicates a possible problem in the code of your application. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.
Or, if this sample project is not an accurate demonstration of what you’re trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.
Please let me know if I can provide any further assistance.
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://es.infragistics.com/support
Attachments:
Hello ekolluri ,
I’ve tested this on my side in a similar scenario however I was not able to reproduce the issue you’re describing.
Please refer to the sample I’ve previously attached and test it on your side.
Whether or not it works correctly may help indicate the nature of this problem.
If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using.
If the project does show the product feature working correctly, this indicates a possible problem in the code of your application. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.
Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.
Also please note that our product ships with project templates which you can use to get started with the controls.
In order to use one of the project templates you need to:
-
From VS select File-> New-> Project
-
In the Templates select the language you prefer and expand it. For example “Visual C#”.
-
Select “Infragistics”
-
Select the Ignite UI Started template. There are options for the different MVC versions you have installed and an option to choose Razor or Aspx syntax.
I’ve attached a screenshot for your reference.
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://es.infragistics.com/support