[CLOSED] [1.0] GridCommand

  1. #1

    [CLOSED] [1.0] GridCommand

    Hello,

    Would it be possible to implement some of the features of Button for the GridCommand?

    We are using the GridCommand in a GridPanel to download a document from a list of available documents. We are changing the document.location.href to the location of the file on the web server, but this causes the notorious file download pop-up blocker in Internet Explorer.

    Would it be possible to implement a NavigateUrl property on the GridCommand to redirect the user similar to how the Button control handles this?

    Suggestions?

    Cheers,
    Timothy
    Last edited by Daniil; Apr 09, 2011 at 10:13 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Buttons NavigateUrl uses simple 'window.location = this.navigateUrl;' code.
    You can use the same in Command event handler.

    To prevent popup blocker try the following code but i am not sure that it will help because it was tested for postback urls only
    window.location = String.format('javascript:{0}', requiredUrl);
  3. #3
    Thanks vladsch,

    I've taken your suggestions and tried a few things. I tried your example above about changing to window.location and using the javascript: format, that did not work.

    I've also tried creating a hidden button and changing the NavigateUrl and firing a click event against the button; same result.

    If I remove the fire event and make the button visible and click on it manually, it works.

    Internet Explorer ugh.

    Any other suggestions?

    Cheers,
    Timothy
  4. #4
    Hi,

    I am affraid only if deactivate that blocker. The destination of blocker to block javascript activity (which shows window, file and etc)
    In your case IE doens't detect that it is user action.
    Another suggestion, do not use command to download the file but use anchor link
  5. #5
    Thanks vladsch, you can mark this one closed. I will look for an alternative to handling this.

    Cheers,
    Timothy

Similar Threads

  1. [CLOSED] GridCommand Add Handler ?
    By sisa in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 11, 2011, 12:16 PM
  2. [CLOSED] GridCommand with DataIndex
    By xeo4.it in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Mar 18, 2011, 2:02 PM
  3. Help GridCommand
    By hbbazan in forum 1.x Help
    Replies: 11
    Last Post: Mar 05, 2010, 2:30 PM
  4. How to get the GridCommand name
    By wkcode in forum 1.x Help
    Replies: 2
    Last Post: Mar 03, 2010, 4:40 AM
  5. [CLOSED] Gridpanel Gridcommand example?
    By Dave Ko in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 30, 2009, 8:22 PM

Tags for this Thread

Posting Permissions