Get a modal view from the batch actions

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
lawrencekeru
Posts: 29
Joined: 2016-06-24 02:51

Get a modal view from the batch actions

Post by lawrencekeru » 2016-09-07 11:41

Hey Guys,

Can someone please help me do this.

I have a batch actions link that opens another window when clicked. i want this to open like a bootstrap modal window instead of a new window. An example is how change owner opens from the admin's batch actions on a table.
see below.
batchmodal.PNG
batchmodal.PNG (45.74 KiB) Viewed 3134 times
I want to view tenant balance history as a modal.

Noha Eshra
Moderator
Posts: 82
Joined: 2013-11-11 19:21

Re: Get a modal view from the batch actions

Post by Noha Eshra » 2016-10-03 11:14

This is explained in https://bigprof.com/appgini/help/advanc ... ch-actions

1-The user opens the table view of a table in your AppGini application.

2-The application calls the hook function {tablename}_batch_actions. This is where you define the extra actions users can choose.

Code: Select all

    function tablename_batch_actions(&$args){

        return array(
            array(
            'title' => 'Open Model',
            'function' => 'open_model',
            'icon' => 'th-list'
        )
        );
    }
3-This function returns an array that describes one or more actions and the name of the javascript function to call if the user selects an action. The application adds those actions to the "More" menu.
tableName-tv.js

Code: Select all

function open_model(table_name, ids){
    modal_window({
        message: '<div class="alert ">' + "do what you want"+ '</div>',
        title: "the records",

    });
}

Post Reply