Hi All,
I have a requirement to Dynamically add/remove "Select-All" button in the interactive Grid based on page item value. Below works and shows custom button "Select-All"
function(config) {
var $ = apex.jQuery,
toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),
toolbarGroup = toolbarData[toolbarData.length - 1]; // this is the last group with reset button
// add our own button
toolbarGroup.controls.push(
{
type: "BUTTON",
action: "Select-All",
hot:true
}
);
config.toolbarData = toolbarData;
config.initActions = function( actions ) {
actions.add( {
name: "Select-All",
label: "Select All",
action: function(event, focusElement)
{
view=apex.region("IGId").widget().interactiveGrid("getCurrentView");
model=view.model;
model.forEach(function(r)
{
var record = r;
model.setValue(record,"SELECTED",'Y');
})
}
} );
}
return config;
When I add if condition in the actions function like
if ($v("P100_SELECT_FLAG") ="N")
{ actions.hide("Select-All");}
else { actions.show("Select-All");}
interactive grid does not render (interactive grid does not show).
If enter show or hide without if clause it works.
Please help me whats wrong here..
Regards