Login Register
Saturday, May 19, 2012
You are here : Forum
 
Forums Minimize
 
ForumForumForumForumIndoo Grid DNN ...Indoo Grid DNN ...Link an image to redirect with a parameterLink an image to redirect with a parameter
Previous Previous
 
Next Next
New Post
 8/27/2010 2:04 PM
 

Hey from Denmark!

I am aware that you can use the "column contents are URL links" and then specify the parameter to include in the link so that another grid can catch it with the [numericQueryString:XXX]. However I see that the mentioned option only exists if the content is text.

My question is how can I do the same thing with an image/binary data? In other words: I would like to click an image and be redirected to another page WITH e.g. the ID parameter for that row.

Could I maybe use the HTML attributes option and if so how would it look like?

Thanks,

David
- A proud IndooGrid owner and everyday user, SUPER job developers!

New Post
 8/30/2010 1:14 PM
 
 Modified By artfuldodger  on 8/30/2010 7:11:59 PM

There's probably an easier way but setting a column up using "Show data from more columns (custom HTML):" to 2: editor.
Then when in the editor just show the imagelink as a link and make that picture a link using the ID of that row.

Should fix your problem I guess.. but as I said there might be an easier way.

New Post
 8/30/2010 2:32 PM
 

Hey art,

I am not sure I understand you correctly, can you explain it further what you mean by "1) just show the imagelink as a link and 2) make that picture a link using the ID of that row"

The column you refer to is the image content column which has the binary data, right? In this case what should I set the "show binary as" as? As I understand I then select the 2-editor, and do what?

Remember I need to only show the full Image or thumb in the cell (without any text/link) but where the image itself is a link that includes the ID of the row in which it is clicked.

What is the right token to retrieve row ID in view mode, is it at all possible? I have tried setting the ... .aspx?&parameterID=[indoogrid:idValue] in the link both in 2-editor and by using the "html attribute" option with onclick java linking, but these approaches have not worked for me :(

Thanks for reply,

Dave

New Post
 8/30/2010 3:18 PM
 

FINALLY!

I figured it out - not sure if it was the same procedure as you tried to explain but here is how I did it:

1) Select Edit for the column (which should NOT be binary!) in the gridview settings, next
2) Select the "Column contents are URL links" option
3) Select the "2 - Editor" in the "Show data from more columns (custom HTML)", next
4) Fill out your URL, parameter name and select the column for parameter value, e.g. ID in my case, next
5) Insert the Image into the Editor
Done!

BUT this means that the same image will be used for each row but where the ID value will vary according to the row. I will use this as an icon in my list, e.g. a PDF icon which on click will open a page with a grid and a querystring on the related ID and which will force download of the correct PDF file for that ID.

HOWEVER what if we want to have two different images?? If we e.g. have a row where no related PDF file exists I would like to hide the PDF icon image/or show other image in the specific column. You could imagine two images where one represents "available" and the other "unavailable". Any ideas??? I imagine you would need to use the database rather than a static image link we set in the custom editor? or?

Dave

New Post
 8/30/2010 3:59 PM
 
 Modified By artfuldodger  on 8/30/2010 7:12:09 PM

You could create a new row in the db with a bit, and in the editor do a check to see if the link should be shown or not.

New Post
 8/30/2010 4:02 PM
 

Hey art,

Yeah I thought about that, but what language should I use? Could you provide me with an example please?

Thanks,
Dave

New Post
 8/30/2010 4:12 PM
 

I've also been struggling with how to have the binary image point to a differnt link... no success yet (I need it dynamic). For your needs it sounds like you've gotten very close. You should be able to use "Show data from more columns..." and select option "1-configurable". You would need to put the correct html to accomplish the same thing as you did with option 2, but now you could use the condition column to cause it to return a different image based on the mime type... if you used that field otherwise you would need some indicator for the scenario you are describing, like no file should have null in the binary field.

New Post
 8/30/2010 4:25 PM
 

shouldn't something like this work in the editor?

<img alt="" src="[Compute:IIF([ID] = '1', '[indooGrid:Picture]', 'Blabla.gif']">

New Post
 8/30/2010 5:12 PM
 

Hey cutts,

First of all Im a big fan, read a lot of your posts, I can see that youre a big contributer to the community...

Thanks for the idea, I actually remembered something similar in one of your other posts and I will try it out soon.

However, I just tried my approach and found an interesting situation which I would like to share if anybody are interested...

Just to make it clear I now have a "file_content" column, binary, (holding the file I need) and "file_icon" column, varchar(10), (which should show the availability status as well as the available link to another grid that is set to catch the row ID in which the icon was clicked and force the related file to download).

The funny thing is that if the value of "file_icon" IS NULL then no icon/link is shown for the specific row, it is just blank in the grid. That provides me with the two situations I need; if AVAILABLE then "file_icon" value is not null and the grid shows the icon I set in the 2-configuratior, if UNAVAILABLE then no icon is shown since the value for "file_icon" IS NULL.

Given this, I figured that the only thing I need to do is create a short and simple "CASE WHEN THEN" sql statement whenever "file_content" is manipulated, putting this code as part of "on update" or "on insert" actions :-)

Ill update if any interest,

Cheers, Dave

New Post
 8/30/2010 5:30 PM
 

Dave,

Thanks alot, I appreciate it... glad they've been helpful. I keep my own cheat sheet at golocalweb.com if you want to use those too.

I'm not sure I understand what "code" the sql statement is going to put in? Also, was wondering if you are having the file stored to the file system or database?

Artfuldodger, I seem to recall that you can't use the [compute: iif....] token in gridView which is why you need to use the configurable option. I think it had something to do with the overhead it caused, but not sure.

Previous Previous
 
Next Next
ForumForumForumForumIndoo Grid DNN ...Indoo Grid DNN ...Link an image to redirect with a parameterLink an image to redirect with a parameter

  
Buy it Minimize

 

 

  
Home | Demo | Custom Solutions | Downloads | Forum | Company
 
Privacy Statement | Terms Of Use
 
Copyright 2008-2009 IndooLab d.o.o.