Login Register
Tuesday, February 07, 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/30/2010 6:59 PM
 

Hey,

the "file_content" is set to store to the filesystem and ofcourse also includes the "file_name" column, whereas the "file_icon" is just a varchar column which is either NULL or has a value. The "file_icon" is set to "show data from more columns 2-editor" where I simply inserted an image from the filesystem without actually adding anything to the database, it simply works as a link on the HTML level. Doing so, my "file_icon" functions as a trigger for either showing the link/image or leavin the cell blank in indoo :-)

Having this trigger, I can use the CASE statement to check my "file_content" (null or not) and thereby set "file_icon" value accordingly, to NULL or 1 (not 0 or 1 since 0 would also constitute a value and thereby trigger the grid to show the icon)

Hope it explains - otherwise Ill finish it off tomorrow and post some pics of the result :-P

I have already checked out a number of your cheats ;-) and this could maybe also be considered as one you could add ... ill update tomorow,

Dave

New Post
 8/30/2010 8:11 PM
 
cutts wrote:

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.

Yeah that's probably why I can't get it to work :) Gonna stop banging my head against that wall then and do something productive :)

New Post
 8/31/2010 7:11 PM
Accepted Answer 

So I just finished and I think I achieved what I needed :-)

Here is how the end result looks like if ya interested:

  • The Icons are automatically shown if the related content exists (no matter where the content is, same or other tables)
  • Each Icon is a link that includes the necessary parameter / row IDs which is used in the grids on the pages the icons are linked to
  • The icons are in the wwwroot filesystem but could be from anywhere since...
  • They are referenced on HTML level by using the "2-editor" option for the column
  • The column itself only keeps two values: NULL (hidden) or 1 (visible)
  • An on-load SQL statement has been added to the module which checks existence of "content" values in the respected table(s) and sets the icon column value to either NULL or 1
  • The SQL statement I have uses CASE which is further LOOPED until all records on list have been updated. Looks like this:

(this is only for 1 icon where the content is in an external table, but I made one major loop for all three icons consisting of three unique case statements)

Declare @n int
Set @n = 0
WHILE (@n < 100)
Begin
Update "table"
SET "icon_column" =
(SELECT
CASE
WHEN (Select "content_column" FROM "content_table" WHERE "icon_row_ID" = @n) IS NULL THEN NULL
WHEN (Select "content_column" FROM "content_table" WHERE "icon_row_ID" = @n) IS NOT NULL THEN 1
ELSE NULL
END
)
Where "icon_row_ID" = @n
SET @n = (@n + 1)
END

So all in all I am happy with this result in terms of what I need. I think it is a quite effecient way of doing this database and operationally wise ;-) Ive tested the SQL statement where it does the update procedure on about 70 content records spread in three different tables (all in one loop), where it each time checks the content value and updates the related icon_value for the three icons (RA, 3D, MB) - resulted in maybe +1 sec module load time and no issues at all.

Hey maybe this is a pretty shitty way of achieving what I wanted since I still consider myself as noob in all of this, so gimmi some feedback :-P

Dave

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.