Discussions

Expand all | Collapse all

Keep filter after JavaScript reload function

  • 1.  Keep filter after JavaScript reload function

    Posted 01-15-2019 20:54
    I am using the reload function of javascript in order to reload the page after clicking a url button.

    Is there any way to keep the filters on the report after clicking the url button?

    "<a class=\"Vibrant Success\" href=\"javascript:" & "$.get('" & $url &
        "', function(){" & "location.reload();" & "});" &
        "void(0);\">Mark As Done</a>")

    Thanks


  • 2.  RE: Keep filter after JavaScript reload function

    Posted 01-15-2019 21:17
    Can you try this as a formula URL field type labelled "Mark as Done" and see if it retains the DF?

    "javascript:" &
    "$.get('" & 
    $URL & 
    "',function(){" &
    "location.reload(true);" &
    "});" 
    & "void(0);"


  • 3.  RE: Keep filter after JavaScript reload function

    Posted 01-15-2019 21:34
    Thanks for the quick reply. I need this to be a rich text field since I am using more logic in this button. In a regular url button I can't change the text of the button based on the case.

    I only shared the javascript part but here is my full formula:

    var text editUrl =URLRoot() & "db/" & Dbid() & "?act=er&rid=" & [Record ID#];

    var text url=
    URLRoot()&"DB/"&Dbid()&"?A=API_EditRecord&apptoken=[mytoken]&RID="&[Record ID#]
    &"&_fid_23="&URLEncode("today")
    &"&_fid_19=Done";

    If([CanMarkDone]=false,"<a class=\" Vibrant Alert \"href="& $editUrl &">"&[Why Can't Mark Done]&"</a>",

    "<a class=\"Vibrant Success\" href=\"javascript:" & "$.get('" & $url &
        "', function(){" & "location.reload();" & "});" &
        "void(0);\">Mark As Done</a>")


  • 4.  RE: Keep filter after JavaScript reload function

    Posted 01-15-2019 21:40
    Sorry, I don't know the answer to that.


  • 5.  RE: Keep filter after JavaScript reload function

    Posted 01-15-2019 21:40
    .. but I would like to ...


  • 6.  RE: Keep filter after JavaScript reload function

    Posted 01-15-2019 22:02
    Thanks let's see if someone can come up with anything...