Hello to everyone!
My Pivot Grid is something like the picture attached..I have some question related to the grid:
Thanks and kind regards,
Faber
Hello,
Thank you for posting in our forum.
I order to check which cell is clicked you can use the CellClick event of the grid.
You can get the igGrid instance from the pivot using the following method:
$("#pivotGrid").igPivotGrid("grid");
And attach an event handler for it:
$(document).delegate("#"+grid.id(), "iggridcellclick", function (evt, ui) {
alert("Cell Clicked. Cell at row index:"+ ui.rowIndex+" and column index: "+ ui.colIndex);
});
Regarding freezing the left headers. There’s no option out of the box to fix in place the headers position, however you could achieve this by getting the header elements using jQuery and setting the position to fixed inside the pivot grid’s Rendered event. For example:
//Set fixed position for the left headers
$(document).delegate("#pivotGrid", "igpivotgridpivotgridrendered", function (evt, ui) {
var width=$("#pivotGrid_rows").width();
$("#pivotGrid_table").find(".ui-iggrid-header").css("width",width);
$("#pivotGrid_table").find(".ui-iggrid-header").css("position", "fixed");
I’ve attached a sample with both suggestions for your reference. Let me know if you have any questions.
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://www.infragistics.com/support
Hello Maya,
Thanks for your response!!
Best regards,
Hello Faber,
Let me know if you happen to have any additional questions or concerns regarding this.
I have some questions regarding the answers:
Thanks and best regards,
Please find the answers to your questions below:
Regarding the answers:
1.The column indexes, only in the first row, start from the number 2 (This is an issue easily solvable, but I would like to know why, if it is possible..)
If you mean in a scenario where there are multiple columns headers on the left side of the grid similar to your example here: http://jsfiddle.net/b34pM/4/
Then once you expand “All Periods”, there are now 2 sections of column headers
All Periods and 2007,2008, 2009 etc. So “All Periods” would be with column index 1, 2007 would be with column index 2, 2008 would be with column index 3 etc.
The first cell belongs to the “2007” column, which has index 2, so if you get the column index related to that cell it should return 2 in this scenario.
2.The answers regarding my second question works good on a compact layout, but it’s not the same on a standard layout...This is how it appears http://jsfiddle.net/b34pM/4/
I’ve noticed that the layout of the sub items on the left columns is not preserved.
Please note that this is a custom approach that manually fixed Dom elements on the page. When there’s a hierarchical structure involved this approach will not persist it.
By design the pivot does not have a fixing functionality out of the box. If you would like to see this implemented in future versions please log it as a new product idea.
You can suggest new product ideas for future versions (or vote for existing ones) at <http://ideas.infragistics.com>.
Additional Questions:
1.Is there an upper bound to the number of records that you can put in the grid? I have a number of dimensions limited to 2-3 for each header..
No. There are no specific bounds that can be set for the grid’s records. The grid will render records based on what’s passed as its data source.
2.Is it possible to execute on server-side operations like drag-and-drop or sorting, that are client-side operation by default? how is it possible?
The Pivot grid is a client side widget so all of its functionalities are done on the client side only. There’s currently no option to delegate them to the server side in any way.
Let me know if you have any questions.