the most probably the icon doesn't have property 'disabled' so it's not found by your selector.
you will have to investigate DOM structure to find out what property controls icon's functionality.
however, I quite don't understand the approach. you first disable controls by a rule and then leverage in some javascript how to enable them.
why not to write rule's formula so that it disables control only when needed and leave them enabled in other cases?
The rules for enabling/disabling the specific panel were quite complex, that's why I opted to use JS instead of the regular form rules...
It is strange however that ALL other controls have been enabled, but the datetimepicker does not seem to trigger the popup event! Is there no way to re-attach the event handler manually?
Just FYI, here's the DOM structure:
I can easily remove the cursor and opacity styles, the only issue seems to be the event not triggering!
I can only imagine it's being added/removed by the Nintex Form using jQuery UI?
whatever are your reasons resp. however the rule is complex I wouldn't do it that way!
rules are reevaluated and reapplied automatically on various events/changes, I'm quite sure you will not be able to catch all such event's so that you can reapply you javascript code.
however, if you insist on that following worked for me for single date picker
NWF$('#'+dt).closest('div').find('img').prop('disabled','disabled')
NWF$('#'+dt).closest('div').find('img').removeProp('disabled')
so, the img/icon recognizes disabled property.
I do not know why it's not accepted with your selector. maybe it evaluates presence of disabled differently (prop need to be removed), but likely it might as well be due to reasons I mentioned above.
Hey Marian,
Thanks for your suggestions, I really hoped the removeProp command would work!
It does work if I disable the panel manually (which might also be a valid alternate solution btw), but it doesn't work if it has been disabled by the form rule...
For some reason the Nintex form changes the mimeType of the image from GIF File to Gif Image, and probably does something else to affect the event handler as well!
if you disable/unconfigure those complex rules, does this happen too?
Hey Marian,
The problem with the missing event handlers only shows up when I manually re-enable a datetime picker that was previously disabled by a form rule...
Anyway, since I couldn't find a solution for locking/unlocking from Form rules + JS, I decided to only do the locking from JS! So whenever I disable the datetime picker by setting its disabled prop to false and then re-enable it, works like it should
I'll mark your original answer as correct, thanks for your time!