We have a Iqueryable(of object) bound to the grid. In this grid we have a column with imagebuttons. When the button is pressed we want pass along the object of the row to our javascript function that is called popUp. The problem we are having is that right now we are only able to pass one single property to the function.
The code we use for this looks like this in VB.NET Razor syntax:
.Columns(Sub(column)coulmn.[For](Function(x) x.ViewRemarkDetailsPlaceHolder).FormatterFunction("function(val) {return '<input type=""image"" src=""../Resources/MagnifyingGlass.png"" align=""left"" onclick=""popUp()"">'; }").Width("25px").HeaderText(" ") End Sub)
Hi,
i would suggest to use templates (either rowTemplate or a column template) in order to achieve this functionality, it won't work with the formatter function. "this" will give you the current data context if you define a function and use it in the template.
Hope it helps. Thanks
Angel
Could you provide an example how to do this with a template?
Hi there,
I will open a support ticket for you. Please work with DS to isolate a sample which can be sent to us. This template should be working no problem, however I will follow up as soon as I have the sample to update you with the findings!
Thank you for using the Infragistics forums!
Thanks for the reply.
I have attached the project where this behaviour occurs.
It seems to me that the igGrid script file is 11.2 version. Is that so? The JQueryTemplating property has been deprecated in 12.1 as it is using our own templating engine and the template that you have would correctly be avaluated with the appropriate script files in 12.1. Let me know if you are experiencing any more issues!
Thanks!
I ran the version utility against the project and assumed this would update all components. I must admit I did not check if this was done for the script files as well, but I assumed that it would get updated as well.
I will try and replace the igGrid script file tomorrow and report my findings with it.
I added the 12.1 scripts to the project and now I am getting the following error:
'Error: Object doesn't support this property or method'
I am guessing that I must be missing something still.
Could you modify the project that I attached in the previous post in such a way that the template works? That way I can compare it to the not working project I currently have and determine what I have been doing wrong.
Hi again,
This has to do with the loader. You have already included the combined minified script file so you don't actually need it. If you remove the one line that references it, it will work under all browsers.
@(Html.Infragistics().Loader().ScriptPath(Url.Content(
"~/Scripts/")).Render())
I hope this helps!
Thank you for the sample.
The sample is indeed working for me in IE. But when I try to view the grid in Firefox the grid is not rendered. I also do not get an error message. Any idea what is up with that?
Hello,
Due to attachment size restriction, I have opened a support case CAS-91630-MB0W3Y for you. I will provide a modified sample on that support case. You can log in to your account on the below link:
<https://ko.infragistics.com/Membership/MySupport.aspx>
Once you log in click on “My Support Activity” under “MY ACCOUNT” and download attachment from the support case.
I hope this helps.