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?
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
This is a nice solution. It worked for me. Instead of using a flag to identify the button which was clicked you can use event.srcElement.id in beforerowtemplateclose handler to identify which button caused this event to fire. See sample code below.
{
case "igtbl_reCancelBtn" : return false; break; case "igtbl_reOkBtn": return false;break; default: return true; break;
return false; break;
return false;
break;
return false;break;
default:
return true; break;
}