button logic
Last Post 11-15-2012 05:34 AM by Ryan Bakerink. 3 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
Steve KUser is Offline
going with the flow
going with the flow
Posts:49
Avatar

--
10-30-2012 10:52 AM

    I am wondering if this is possible:

    I have a DV that will list events that a user has attended or is signed up to attend. For each record returned, I have an edit button that will load the event details in a DF for editing.

    One of the values returned in the query for the DV is EndDate. Is it possible to have the edit button be visible if today’s date is less than or equal to the end date, and to be invisible if today’s date is greater than the end date?

    If so, how would I go about doing this?

    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    10-30-2012 01:36 PM
    Hi Steve - I have seen this implemented a few times. I think you would either need to write some custom JavaScript to make this happen, or... I have seen where you can build within your query or stored procedure some SELECT CASE columns where the data would be brought in as a blank or the data would be brought in as the real edit link. Ryan might be able to explain this to you on your call with him on Thursday. Basically it is some IF/ELSE logic that would exist within your query directly. If you needed us to directly assist or help in writing the query too we can handle that via Premium Service hours which can be picked up at http://www.datasprings.com/hours.


    Thanks,

    Chad
    Steve KUser is Offline
    going with the flow
    going with the flow
    Posts:49
    Avatar

    --
    11-13-2012 12:41 PM
    I did get this to work, and I want to thank Ryan for the assistance and the SQL syntax needed to accomplish this.

    It is accomplished by adding a column to your table/view/sp to return a url for the image of your delete button, as well as the parameters that are need to be passed to your dynamic form.

    Here is a modified version of the sql statement that adds a column named DeleteButton to my SQL view which I use to populate my DV View. 

    SELECT Any_Needed_Field_Names,
    CASE WHEN EndDate > GETDATE() THEN
    '<a href="http://www.your_domain_name.com/directory_path/
    Dnamic_Form_Name.aspx?DSParam1=' + CAST(FieldName* AS nvarchar(200)) + 'amp;DSParam2=Delete"></a>
    <img alt="">width="16" height="16" src="Path_to_Image_Folder/
    action_delete.gif">' END AS DeleteButton,
    Any_Additionly_Needed_Field_Names
    FROM TableName

    NOTE: The closing anchor tag should follow the close of the image tag! No matter what I tried, the forum software kept moving it to just behind the open anchor tag.

    *FieldName is the name of the field that contains the value you want to pass to your DSParam#
    EndDate is an existing field in my table
    Replace field names, table names as needed.

    Once this is completed you will have a new token called [deletebutton] that you can place in your list view or detail view templates. Now the delete button is only visible when the conditions are met.

    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    11-15-2012 05:34 AM
    Thank you for sharing your solution.

    Please let us know if you ever have any questions.

    -Ryan


    ---
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi