I'm trying to figure out if this is possible in Oracle APEX interactive grids. I'm wanting to insert a string of text like "Y" into a cell simply by clicking the cell. I'm trying to avoid using a checkbox.
2
votes
2 Answers
0
votes
Blockquote
Please follow the below steps to achieve the desired result
Paste the below JavaScript code in Function and Global Variable Decleration:
function fSwitch(ptext) {
if(ptext == 'Y') {
return ("");
}
else {
return 'Y'
}
}
Make the Interactive Grid Editable
Change Column Type of the column that you want to insert a string to "Text Field".
Paste the below code in the Advanced -> Custom Attributes of the column that you want to insert a string
onclick="javascript:this.value=fSwitch(this.value)"; onkeypress="return false;"
How this works:
On focus of the column cell,
- If the cell is empty 'Y' will be entered,
- If the cell contains 'Y' then the cell value becomes NULL;