Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double-Click Issue #4

Open
NivethaRamanth opened this issue Mar 2, 2018 · 10 comments
Open

Double-Click Issue #4

NivethaRamanth opened this issue Mar 2, 2018 · 10 comments

Comments

@NivethaRamanth
Copy link

The check box gets checked or unchecked only on double-click of it

@sonic0boom
Copy link

sonic0boom commented Mar 2, 2018

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);

@rafael-trevisan
Copy link
Owner

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.

@NivethaRamanth
Copy link
Author

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.

@rafael-trevisan
Copy link
Owner

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?

@jeffreykemp
Copy link

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.

@NivethaRamanth
Copy link
Author

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.

@rafael-trevisan
Copy link
Owner

All right, I'll take a look at this when I get some free time here 😉

@venkat2121
Copy link

venkat2121 commented Jun 6, 2018

Hi, I am eagerly waiting for your reply. Could you please provide an update.

@MarkusId
Copy link

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

}

@Geri1590
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants