I have a main page with an Interactive Grid region in which I have added a custom toolbar button to launch a modal dialog page to “add a record”. Also, in the grid results itself, I have a link column that redirects to the same modal dialog to edit or delete a specific existing record. When I return from the modal in the latter scenario (updating or deleting), the parent main page's DialogClosed dynamic action triggers as expected, and I am able to handle items returned from the modal (basically, a page item that tells me whether they deleted or updated, so that I can display a specific message on the main page via this DA). However, for the former scenario (creating new record) by launching the modal from the custom toolbar button, when the modal closes, it clearly is not triggering the same DialogClosed DA. Here is the IG region's Initialization JS function:
function(config) {
var $ = apex.jQuery,
toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),
toolbarViews = toolbarData.toolbarFind("actions2"),
addCategory = {
"type":"BUTTON",
"action":"row-add-rowt",
"label":"Add row",
"hot": "Y",
"icon": "fa fa-plus",
"iconBeforeLabel": "BEFORE_LABEL"
};
config.initActions = function (actions) {
actions.add({
"name": "row-add-rowt",
"action": function(event, focusElement) {
apex.server.process('BuildModalURL',
{ x01:apex.item("P2_CAMPUS").getValue() },
{ dataType:'text', success:function(url) {
//console.log(url);
apex.navigation.redirect(url);
}
});
}
});
}
toolbarViews.controls.push(addCategory);
config.toolbarData = toolbarData;
return config;
}
Any idea how I would possibly directly tie a “dialog closed”-type of dynamic action to this custom button, if in fact the issue is that there is no way for the built-in DialogClosed DA to recognize a custom toolbar button? I wanted to at least lay down the background here, and based on replies, I can certainly supply whatever additional JS code or declarative settings you want to know about.
Any idea how I might config8ure