Opening a form from custom button

Opening a form from custom button

vsekvsek Posts: 30Questions: 17Answers: 0
edited March 2021 in Free community support

Hi all, I can get all my buttons to work below but I am at a loss here. I want the "alert" to be replaced with the "standard_edit_dialog" form(bottom) if possible or something comparable. Can I do this with custom buttons or is there some newer way to do this?

$(function() {            
        // Data Table
        var table =$('#standard_datatable').DataTable({     
            sortTableByCol : 1, 
            dom: 'QBfrtip',
            buttons: [{ 
                    text: 'Add Restricted Entity Group' ,
                     action: function ( e, dt, node, config ) {
                            alert( node); 
                        }
                         },
                         'copy', 'excel', 'pdf'
                   ], 
            ajaxSource : "/cma/contents/screening/restrictedEntityGroup_data",          
            "columnDefs": [ {
                    "targets": 0,
                    "data": null,
                    "defaultContent": 
                    "<div align=center ><button onclick=openDataGroup() ><img src=../../css/images/164-glasses-2.png   width=14px height= 8px></button><button><img type=button class=btn btn-primary btn-clone src=../../css/images/edit.gif width=14px height=8px></button><button><img src=../../css/images/delete.gif width=14px height= 8px></button></div>"  
                    } ]
        }); 
         
    } );

// from html side///
<div  id="standard_edit_dialog"  title="Add Restricted Entity Group" class="cma-ui-form-dialog ui-helper-hidden">
    <form  id="new_entry_form"  method="post">
            <fieldset class="ui-widget-content">
                    
                <div class="ui-helper-clearfix">
                    <label for="groupName">Restricted Entity Group Name: </label>
                    <input required="required" type="text" name="groupName" id="field2" value=""  maxlength="35"  class="text ui-widget-content ui-corner-all novalue_clone" placeholder="Enter Name"/>
                </div>
            </fieldset>
    </form>
</div>

Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.