apex-plugin-ig_simple_checkbox
apex-plugin-ig_simple_checkbox copied to clipboard
Double-Click Issue
The check box gets checked or unchecked only on double-click of it
You have to double-click to put the record in edit mode. On the page properties "execute when page loads", you can put in the following command to have your IG start in edit mode. You shouldn't then need to double-click to activate it.
apex.region("Put IG ID here").widget().interactiveGrid("getActions").set("edit", true);
Hey @NivethaRamanth, I hope @sonic0boom's comment has helped you.
I'm closing here for now but feel free to re-open if you still have issues.
After adding the above given CSS " After Page Load first time not cheked" issue has been resolved. But still only on double click of the checkbox I can check/uncheck it. Hence Iam reopening this issue.
Hey @NivethaRamanth, having to click "twice" is somewhat intentional... the first click is to focus on the cell, second and forward clicks are meant to toggle the checkbox value, like asked here.
After clicking the first time (or entering in the cell), are you able to toggle checked/unchecked with just one single click?
I agree with NivethaRamanth - speaking purely from an ordinary user's point of view, the checkboxes look like any other checkbox in the application, but they don't behave like other checkboxes - i.e. it takes a double-click to change their state.
Users will have to remember to click once in some places, and double-click in other places in the same application (if both IG and ordinary single-record forms are used). Oh, unless the focus is already on the checkbox in which case the double-click actually returns the checkbox to its original state! This is a poor user experience.
If there's any way to have them focus+change state in one click that would be a great improvement.
Yes, User was asking me the same , why in all other pages its single click but only here in this report its double click for checkbox. It would be great if this can be resolved! Thanks.
All right, I'll take a look at this when I get some free time here 😉
Hi, I am eagerly waiting for your reply. Could you please provide an update.
There's a kind of workaround for that - create a dynamic action - Event: Click - Selection Type: jQuery Select - jQuery Selector: .a-GV-row - Client-side Condition : ($(this.triggeringElement.childNodes[1]).prop("tagName") != 'TH') - Severside Condition - Type: Rows Returned - SQL Query: SELECT distinct 1 FROM apex_application_page_regions WHERE application_id = :APP_ID AND page_id = :APP_PAGE_ID AND source_type = 'Interactive Grid';
True-Action: Execute JavaScript Code
var vAffectedElement;
if ($(this).get(0).affectedElements[0].classList.contains("a-GV-cell")) { vAffectedElement = $(this).get(0).affectedElements[0]; } else { vAffectedElement = $(this).get(0).affectedElements[0].parentElement; }
if ($(vAffectedElement).find("input[type='checkbox']").length > 0) { var vInput = $(vAffectedElement).find("input[type='checkbox']"); if (vInput.val() == vInput.attr("data-checked-value")) { vInput.val(vInput.attr("data-unchecked-value")); vInput.prop("checked", false); } else { vInput.val(vInput.attr("data-checked-value")); vInput.prop("checked", true); }
var rowId = vInput.closest('tr').data('id'); var regionId = $(vInput.parents('.a-IG')).attr('id').slice(0, -3); var ig$ = apex.region(regionId).widget().interactiveGrid('getViews','grid');
-- do here whatever you usually do to update the Model
}
Hi, I have another workaround (apart from the proposed by MarkusId):
It consists in enable edit mode by default (putting this code on page load):
apex.region("grid_seguridad").widget().interactiveGrid("getActions").set("edit", true);
Then, you may put a CSS class in the IG column for the checkbox.
Then you can create a Dynamic Action, that "onmouseenter" that class, a focus is forced: $(this.triggeringElement).focus().
With this, when user put the mouse pointer over the checkbox cell, he only have to click once (because it would be already activated).
Then, with some CSS you may be able to make it look like as if it was not activated (same height).
Regards, Gerard.