Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cellRenderer with ng-click not firing #85

Closed
vincentvanderwalt opened this issue Apr 21, 2015 · 9 comments
Closed

cellRenderer with ng-click not firing #85

vincentvanderwalt opened this issue Apr 21, 2015 · 9 comments

Comments

@vincentvanderwalt
Copy link

Hi.

I'm wondering if you can help me. I've got a cellRenderer function that creates a hyperlink. I need to fire a ng-click action on the hyperlink. The function for my click is in my controller.

ng-click="groupClick('test')" or ng-click="search.groupClick('test')" ---- doesn't fire

Any help appreciated.

Vinny

@ceolter
Copy link
Contributor

ceolter commented Apr 22, 2015

do you have 'angularCompileRows=true' set in the gridOptions?

@vincentvanderwalt
Copy link
Author

Yes I did.
However I forgot to add the function to the scope of the cell.
Like this
params.$scope.groupClick = vm.groupClick;

So in the end it was user error :-)

Thanks for the reply.

@ceolter
Copy link
Contributor

ceolter commented Apr 22, 2015

Great you got it sorted!! To be honest, I had very little to go on with the above!

@greglockwood
Copy link

I wonder if it is worth adding in detection for when a user returns markup that uses obvious Angular directives (e.g. ng-click, ng-repeat and so on) without having the correct option enabled.

If you do detect it, you could log something to the console to warn the developer of their likely mistake.

You'd probably need a way to disable that warning via code, though, in case you did it deliberately. Perhaps a provider method or property?

It might make it more user friendly for new developers and cause you to spend less time dealing with GitHub issues like this one. :-)

On 22 Apr 2015, at 6:12 pm, Niall Crosby notifications@github.com wrote:

Great you got it sorted!! To be honest, I had very little to go on with the above!


Reply to this email directly or view it on GitHub.

@ceolter
Copy link
Contributor

ceolter commented Apr 22, 2015

interesting idea. as more people use, am sure more people will be asking the same newbie questions. i was thinking of having the angularCompile the other way around - have it on by default, and property to turn it off. or just provide a FAQ section, that would be the top question in the FAQ!!

@vincentvanderwalt
Copy link
Author

Personally I like the fact that it's off by default. It's stops unnecessary bloat being loaded. Specially if like me some of the grids are preloaded with data and don't need any interaction.In short if I want to use angular I'll switch the flag on.

The unclear bit was not realizing how important the params.$scope was. Because from the grid cell you don't have access to the controller scope unless you inject it into the params.$scope part.

Again what's nice is that I'm only injecting what I need. No unnecessary bloat.

I'm really impressed by how you're approaching the development of this module.Well done and I look forward to all the features coming.

@ceolter
Copy link
Contributor

ceolter commented Apr 22, 2015

Hadn't really thought about the impact of the grid using an isolated scope.
I can appreciate people would want it non-isolated. Or maybe have that as
an option. Especially given Angular Grid doesn't put anything into the
scope, so won't dirty it.

What does ng-grid do?

On 22 April 2015 at 12:50, vinnytheviking notifications@github.com wrote:

Personally I like the fact that it's off by default. It's stops
unnecessary bloat being loaded. Specially if like me some of the grids are
preloaded with data and don't need any interaction.In short if I want to
use angular I'll switch the flag on.

The unclear bit was not realizing how important the params.$scope was.
Because from the grid cell you don't have access to the controller scope
unless you inject it into the params.$scope part.

Again what's nice is that I'm only injecting what I need. No unnecessary
bloat.

I'm really impressed by how you're approaching the development of this
module.Well done and I look forward to all the features coming.


Reply to this email directly or view it on GitHub
#85 (comment).

The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Statements and opinions expressed in this e-mail may not
represent those of the sender. Any review, retransmission, dissemination or
other use of, or taking of any action in reliance upon, this information by
persons or entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender immediately and delete
the material from any computer.

@rajgopalk
Copy link

ng-click is working fine.i need to pass another field value in one column.my code is
{
headerName: "Claim No.", field: "claimNumber", width: 100,enableRowGroup: true,filter: 'number',
cellRenderer: function (params) {
if (params.value != undefined) {
return '<span title="Claim No" class="dummylink " ng-click="ClaimIdClickEvent(' + params.data.ClaimID. + ')">' + params.value + '';
}
else {
return "";
}
}
},

initially it is working fine. suppose if iam doing grouping, it shows error like ClaimID is undefined or null reference. i dont know why it is coming.

@Bhawna14
Copy link

Hi All,
Can anyone help here, this click on callrenderer is not working for me... I am using ag-agrid. please help

this.myImageCellRenderer = function(rowEntity) {
return '<a style="cursor:pointer" (click)="alert("im working");" href="#modalArcMsg">✉';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants