In Oracle APEX, how do I remove different actions in the interactive grid row actions?
I'd like to remove the ability to delete or add rows from both the row actions and selection actions menu.
Region Settings, Advanced, Static ID: emp
Page Settings, JavaScript, Execute when Page Loads
$(window).on("load", function() {
var actions = apex.region("emp").widget().interactiveGrid("getActions");
actions.remove("selection-add-row");
actions.remove("selection-duplicate");
actions.remove("selection-fill");
actions.remove("selection-clear");
actions.remove("selection-delete");
actions.remove("selection-copy-down");
actions.remove("selection-copy");
actions.remove("selection-refresh");
actions.remove("selection-revert");
actions.remove("single-row-view");
actions.remove("row-add-row");
actions.remove("row-duplicate");
actions.remove("row-delete");
actions.remove("row-refresh");
actions.remove("row-revert");
});
You can change "emp" to anything you'd like, change in both the static ID and javascript. Delete the lines you'd like to keep.
You can use actions.hide("{action_id}") and actions.show("{action_id}") to hide and show the row actions.
Related
I have a couple of classic report columns that are links and a region display selector with a couple of regions under it. How can I switch between RDS regions dynamically when a corresponding column link is clicked?
I tried setting link type to URL and set it to
apex.region("RDS").widget().aTabs("getTabs")["#MY_TAB_STATIC_ID"].makeActive();
But that did not work - APEX tried to go to a different page.
Here is one option. I didn't use page items but you'll probably be able to reuse the logic:
Create 2 regions, give them static id rdsregion-1 and rdsregion-2
Create a display selector
Create a static report with the following sql:
select EMPNO,
ENAME,
JOB,
MGR,
HIREDATE,
SAL,
COMM,
DEPTNO ,
CASE WHEN SAL > 2500 THEN '<div class="setrds1">set rds 1</div>' ELSE '<div class="setrds2">set rds 2</div>' END as rds
from EMP
Create a dynamic action named "Set RDS1"
Event: Click
Selection Type: jQuery Selector
jQuery Selector: .setrds1
add a true action to DA "Set RDS1" o
Action "Execute Javascript Code"
Javascript code:
$('#rdsregion-1_tab a').trigger("click");
Create a similar dynamic action for RDS2.
Note that both snippets work:
$('a[href="#rdsregion-1"]').trigger("click");
and
$('#rdsregion-1_tab a').trigger("click");
I'm using Acumatica customization Acumatica-LotSerialNbrAttribute
This customization adds a new screen for look for InventoryID and LotSerialNbr and visualize its attributes.
I'm trying to add this window to the acumatica mobile app.
Here my code:
add screen IN202501 {
add container "InventoryLotSerialContainers" {
add field "InventoryID"
add field "LotSerialNbr"
add group "Attributes" {
displayName = "Attributes"
collapsable = True
add attributes "AttributesAttributes"
}
add recordAction "Save" {
behavior = Save
}
add recordAction "Cancel" {
behavior = Cancel
}
attachments {
}
}
}
And the screen is visible on the mobile app with the 2 selectors
Then I select Inventory and when I select Lot Serial Nbr, the first selector is in blank, causing that I can't review the attributtes neither save the information.
Here the InventoryID selector in blank.
Hope you can help me to successfully publish this screen on acumatica mobile app.
Thanks.
Attributes are a grid style representation in Acumatica. That means you need a container that will show multiple records. I'm getting rusty on mobile pretty quickly, but I believe your definition is set to display a single value value only.
Try adding a separate container for attributes:
add container "AttributesAttributes" {
add field "Attribute"
add field "Value"
}
This should open into a view of multiple records, showing all of your attributes. By specifying the Attribute and Value fields, you should see both data elements in the container.
I have a SPEAK UI dialog with a ListControl bound to a custom JSON datasource. This works and the ListControl is correctly populated. My JSON data looks something like this:
[
{
"itemId":"{BA26159A-194D-4A3C-9D1A-DA9472F11BE0}",
"selected":true
},
{
"itemId":"{E651D0CD-0E7E-4903-8E26-0D1D5A168E69}",
"selected":false
},
{
"itemId":"{E651D0CD-0E7E-4903-8E26-0D1D5A168E70}",
"selected":false
}
]
Is there a way to ensure the relevant row of the ListControl is selected ("selected":true) when the dialog loads?
You can set the ListControl's selected item ID like this: this.MediaResultsListControl.viewModel.set({selectedItemId:"ITEMID"})
(Sitecore.Speak.app instead of this during dubuging in the console)
If you call this.MediaResultsListControl.viewModel.selectedItemId() you can see the selected item has been set by the above method.
Wondering on page load, if you can set the ListControls selected item id, from the page code manually using this method?
Looking at the JS for the list control. It calls this on click of a row. Wonder if you can replace this to trigger selected row?
selectRow: function (row, rowModel) {
this.$el.find(".active").removeClass("active");
row.addClass("active");
this.model.set("selectedItem", rowModel);
this.model.set("selectedItemId", rowModel.get("itemId"));
},
I have a tabular form attribute which is a select list with static values Yes/no and another 2 attributes of Date and display.
My requirement is when i select "No" from the Select List, Date attribute should be enabled and Display attribute should be Disabled and If "Yes" From select list Display attribute should be enabled and Date attribute should be Disabled.
Dynamic Action:
Created a Dynamic action:
event = Change
Selection Type = Jquery selector
Jquery selector = `select[name='f06']`
Action = Execute javascript Code
var el = this.triggeringElement.id;
var row = el.split("_")[1];
if ($v(el) == "N") {
// disable the field
$x_disableItem("f04_" + row, true);
}
else {
// enable the field
$x_disableItem("f04_" + row, false);
}
Dynamic action Working perfectly for already created Rows, But not while i am trying to add new Row by selecting Add row.
https://apex.oracle.com/pls/apex/f?p=38210:LOGIN_DESKTOP:115699939041356
App 38210. Apex 4.2.6
Workspace/username/password : nani4850
Kindly help me out experts!!
Adding a blank row involves a partial page refresh, so the Event Scope of your dynamic action needs to be changed from Static to Dynamic in order for the change event handler to remain bound to the triggering elements.
You'll now find you have problems submitting new records, but if you're having difficulty, that's for another question!
I want to store the configuration of multiple GoogleCharts in a database and use them to create a dashboard of charts.
I currently store the options I supply for each chart in the database and have my dashboard working, displaying multiple charts.
I want to use the ChartEditor class to allow a user to amend a chart and then save the changes back to my database, so that the next time the dashboard is created, the changes are persisted.
Hence, when a user clicks on the OK button on the ChartEditor dialog, is there a way of accessing the changes to these options?
After crawling around, inspecting the ChartEditor object....
$.parseJSON(chartEditor.getChartSpecification())['options']
...returns what I'm looking for.
Just to add to Flippsie's answer, you can recreate the saved chart from the json returned from chartEditor.getChartSpecification()
var json = chartEditor.getChartSpecification(); // Or saved JSON value
var spec = JSON.parse(json);
// Get the chart details from the saved spec
var data = new google.visualization.DataTable(spec.dataTable);
var options = spec.options;
var chartType = spec.chartType || "BarChart";
// Instantiate and draw our chart, passing in some options.
window.chart = new google.visualization[chartType](document.getElementById('chart_div'));
chart.draw(data, options);