We managed to bind an object to the grid. One of the properties of the object is a string that contains xml. This xml contains some detail information that the users might want to view. With templating we managed to show an icon in case the template is present, like this:
<td> {{if ${Template} !=""None""}} <input type=""image"" src=""../Resources/MagnifyingGlass.png"" align=""left"" onclick=""popUp(${Template});""/> {{/if}} </td>
In this case ${Template} is the string that contains the xml.
This does work fine in Firefox. When the image gets pressed the javascript gets executed and details are shown to the user. However in IE we get the exclamation sign stating that the page loaded with errors. While at first glance everything seems to have loaded with no problems we are unable to click the button that will show us the detail information.
When I place an imagebutton like the one on the grid directly on the page there is no problem with the execution, so my guess is that there is something up with the combination of the xml, the row templating and IE. Do you have any clue what might be up here?
PS.
The xml that we use for testing looks like this:
<Template> <Description>This is a test</Description> <Field> <Label>TestLabel</Label> <Content>This is a test</Content> </Field></Template>
Hi,Truth be told, I'm surprised that you were able get this scenario to work - it's not a simple one.First off, can you please click on the yellow exclamation mark in IE - it will bring up a popup window with the error that has occurred on the page?Second, can you please provide us with a sample where we can reproduce the scenario (HTML if possible)?Given the details you provided (the template for the Template cell and its value) - thanks for those! - I couldn't get my HTML sample to work under Firefox and under IE I got the following error when clicking on the image:
So I decided that as an alternative to XML I could use JSON, but that required a few tweaks as well.As a first step, I am using a 3rd party JavaScript library that lets me convert XML to JSON (http://code.google.com/p/x2js/).
Second, ended up putting the value of the Template object into a data-value attribute and I assigned a click handler for the image using jQuery. The cool thing is that using the browser-embedded JSON.parse() and JSON.stringify() functions I am able to switch the data from a string to an object and vice versa.Hope the sample I've attached to this reply will be of use to you.Cheers!Borislav
Since I see an error from toString I might need to clarify that the property we bind to the grid is of the type string. It is just filled with xml, so in my opinion no toString call would need to be made.
We want to pass this string into a javascript function that generates the html for the detail view we want (and this works with Firefox).
The error we get with IE is very non-descriptive (at least to me). Webpage error detailsUser Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)Timestamp: Tue, 29 May 2012 13:27:16 UTCMessage: Syntax errorLine: 1Char: 7Code: 0URI: http://localhost:2764/patient/getpatientlistI am not sure if it is any help, but the icon only appears after expanding the grid (the button to view the details is place on the level that expands).
I will look into getting a sample with this behaviour.