Special Buttons
- Delete Item
- Edit Item
- View Item
- Inline Edit
- Inline Details
Popups
Use the Open in Popup option in the Add or Edit actions to have the forms open in popups. Note that if you use the Action Form data source, the form will open without the surrounding page elements. This is not true if you use any other data source unless you take special steps.
What we did to achieve this is we used the print functionality that ships with DNN. Say that we have a form on page domain.com/form.aspx , which is an Action Form. When using popups, we change this URL to be domain.com/form.aspx?mid=123&dnnprintmode=true&SkinSrc=[G]Skins/_default/No+Skin&ContainerSrc=[G]Containers/_default/No+Container&afcallparentonsubmit=angridEditDone.
A bit long, but the whole idea is that when printing a DNN module, DNN takes care of rendering only that particular module without any container. The idea is that you can apply this trick to any module. Note also the presence of the afcallparentonsubmit=angridEditDone parameter, which tells Action Form to call this JavaScript function when done editing. This way, Action Grid knows to refresh the grid to reflect the changes. Should you use other module than Action Form to add and edit entries, make sure that this function is called.
Of course, you can always just create a blank page for your form (using No Skin and No Container), which will achieve the same.
Create a Grid button that when clicked will search data from another table
One way to do it is create another page with the grid that you want to open in popup. This grid will accept ID as a query string parameter. On the main grid add a button and in the javascript for that button add the following.
dnnModal.show('/Popupurl.aspx?ID=' + row.IDcolumnfrommaingrid + '&popUp=true',false,800,800,false);
Be sure to replace the Popupurl.aspx with the URL of the popup page and IDcolumnfrommaingrid with the name of the ID column on the main grid that you want to send to the popup.
Other parameters specify the size of the popup.
Alternatively, use
dnnModal.show('/popup.aspx?ID=' + row.ID + '&popUp=true',false,800,800,false);
And sql query in popup Action Grid:
Select *
FROM Table
WHERE ID='[$ID]'
Add to the popup
<a class="dnnPrimaryAction" onclick="dnnModal.closePopUp(true)">Close this window</a>
to close.