Hi,
For the groupBy feature of the grid, i'd like to have the groupedRowTextTemplate based on values from multiple columns, but i can figure it out how to do it.
for example : i have in my grid a bunch of columns : Id, Name, SecurityNum, EventDate, etc...
how can i have in the groupeRowTextTemplate of the grid, if i group by Name , something like this :
'<input type="checkbox" value="${Id}" /> ${val} , ${SecurityNum}, (${count}) '
I have access only to ${key}, ${val} and ${count} of the grouped column. How can i have access to the others ?
Moreover, it seems that i can only use ${key|val|count} only once . If i wanted to have something like :
groupeRowTextTemplate : '<input type="checkbox" value="${val}" /> ${val}, (${count})' . The second time i'm using ${val}, it's not displayed the actual value !.Is there a way to handle this ?
Thank you in advance for your help.
Best regards
Sofiane
Hello Sofiane,
Thank you for posting in our forums!
What are you trying to accomplish with having other column values in the groupedRow? An issue I see with this is that multiple rows can be in a single group in the grid. There is no way to specify which row you want to pull the ${Id}/{SecurityNum} from. If you need this functionality, please submit a new Product Idea. You can suggest new product ideas for future versions (or vote for existing ones) at <http://ideas.infragistics.com>.
There are many benefits to submitting a product idea:
- Direct communication with our product management team regarding your product idea.
- Notifications whenever new information regarding your idea becomes available.
- Ability to vote on your favorite product ideas to let us know which ones are the most important to you. You will have ten votes for this and can change which ideas you are voting for at any time.
- Allow you to shape the future of our products by requesting new controls and products altogether.
- You and other developers can discuss existing product ideas with members of our Product Management team.
Steps to create your idea:
1. Log into the Infragistics Product Idea site at http://ideas.infragistics.com (creating a new login if needed).
2. Navigate to the product / platform channel of your choice (e.g. WPF, Windows Forms, ASP.NET, HTML5 / Ignite UI, iOS / NucliOS, etc.)
3. Add your product idea and be sure to be specific and provide as much detail as possible.
• Explain the context in which a feature would be used, why it is needed, why it can’t be accomplished today, and who would benefit from it. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. Be convincing!
• Please include a link to this thread in your idea so product management will be able to look back at this case.
The Product Idea site puts you in the driver’s seat and allows you to track the progress of your ideas at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
As for the issue where you can only use the ${key|val|count} tokens once, I am able to reproduce this and I have created a support case for you with an ID of CAS-151970-B7R6F0. The matter has been determined to be a development issue and has been logged in our tracking system with ID: 189752.
I will leave this case open and update you with any new information. You can view the status of the development issue connected to this case by going to the “Account” tab on our website, selecting "My Support Activity" and then this support case will be listed there. Then, you may select the "Development Issues" tab to view details of this development issue.
Please let me know if you have any questions.
Hi Michael,
Thank you for your answer.
What i'm try to achieve is to display in the grouping row multiple common values for a specific group.
For example : let's say that i have a datasource like that :
datasource = [
{ id : 1, result : 6, description : 'result 1 ' , relatedTo : 'John Doe', documentID : 12 , eventDate : new Date(2015,12,26)},
{ id : 3, result : 7, description : 'result 2 ' , relatedTo : 'Paul Smith', documentID : 2 , eventDate : new Date(2015,01,10)},
{ id : 9, result : 15, description : 'another one ' , relatedTo : 'John Doe', documentID : 12 , eventDate : new Date(2014,06,05)},
{ id : 12, result : 2, description : 'description result id 12 ' , relatedTo : 'Jane Manson', documentID : 32 , eventDate : new Date(2011,12,01)},
{ id : 26, result : 26, description : 'blablabla ' , relatedTo : 'Steeve Thomas', documentID : 24 , eventDate : new Date(2015,12,01)},
{ id : 33, result : 15, description : 'no comment ' , relatedTo : 'John Doe', documentID : 12 , eventDate : new Date(2015,12,01)},
];
If i group my grid by name ("relatedTo" column), i'd like to display in the grouping row all common values of the data :
* relatedTo : John Doe, DocID : 12 (3 elements) => id : 1, result : 6, eventDate : 26/12/2015, description : ... => id : 9, result : 9, eventDate : 05/06/2014, description : ... => id : 33, result : 15 , eventDate : 01/12/2015, description : ...
* relatedTo : Jane Manson, DocID : 32 (1 element) => id : 12, result : 2, eventDate : 26/12/2015, description : ...
etc....
If i know that some columns values are common to all data of a specific group, how can i use them ?
Is there a possiblity to delegate the groupedRowTextTemplate generation to an external function by passing a key maybe to access the datasource ?
I need to find a way to display in this groupedRowTemplate more than just one value .
Thank you in advance
In fact, the property "groupedRowTextTemplate" could call a function, i can pass to it a parameter ( the ${val} of the column ), and maybe i can request the datasource to retrieve extra informations in order to build a complex template row.
I'll will try this option if there is no other option from the grid itself.
thank you
So i found a way to get my headers how i wanted to be , ie : display more values from the datasource than only the $key, $val and $count. But i'm facing something weird.
I'm using the "groupedColumnsChanged" event to replace my headers, and it works fine , but i'm also hiding the grouped column from there, ie if i group by name i want to hide the name column, but i'm doing that ( calling ui.grid.hideColumn method ), my headers are rewritten using the groupedRowTextTemplace ( if its has some value , otherwise it returns empty string ).
is there an event that occurs i can use after calling ui.grid.hideColumn method ?
Thank you in advance ?
Regards
actually i've just found it ! :) i'm using the RowRendered event and i can have the behavior that i want so far.!