Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
35
Modal row template
posted

Hello.

I'm trying to make row template modal. It will work like this:

1) div element covering all the page with z-index set to rowTemplate.style.zIndex - 1

2) RowTemplate musn't close when user clicks somewhere on the page (our special div will suppress any events as it lays right below rowTemplate).

So that nothing should happen 'till user presses OK or Cancel.

The problem is with item 2. How can I remove "automatic close" mechanism there?

Parents
No Data
Reply
  • 20
    posted

    Hello jary,

    I found a simple way to make a RowTemplate modal in UltraWebGrid. The UltraWebGrid has a ClientSideEvent named BeforeRowTemplateCloseHandler. If this event returns true, the RowTemplate never closes down. Just forcing the RowTemplate stay open doesn't help anyone, indeed; to make good use of this, I need to close the RowTemplate when the user clicks on one of the two buttons that I have on my RowTemplate (OK and Cancel buttons). These two buttons are HTML buttons that make calls to igtbl_gRwoEditButtonClick event in order to close the RowTemplate and transfer the values entered on the RowTemplate to the grid. I simply added a new function named setButtonValue() to my scripts and called it when any of the buttons are clicked. In this function all I do is to set a flag which tells me one of the buttons is clicked (a variable with 0 or 1 values). Now, when I get to BeforeRowTemplateCloseHandler I know if any of the buttons are clicked by checking the value of this flag. When none of the buttons are clicked I return true from the event, which keeps the RowTemplate open, and when any of the buttons is clicked I return false, which forces the RowTemplate to close down.

    I hope that I explained it well enough to help someone, this worked great for what I was trying to do.

    Regards,

    Kambiz

Children