Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#828754
Hi, are you referring to a Datetime control outside a grid or inside?

For outside a grid you can use code such as this:
$("#yourdatecontrolIDname").getControl().attr('disabled', true);

For inside a grid you can try one of these examples:
https://wiki.processmaker.com/3.3/JavaScript_Functions_and_Methods/Grid#grid.hideColumn
https://www.pmusers.com/index.php/Show_or_hide_fields_in_grids

Let me know if this is helpful.

Thx.
#828755
Hi Ironguts25,

Thank you for your advice.

I need to disable datetime cells inside a grid when the rows meet some conditions. The datetime cells contain values. These values have to be shown to users but disallow them to edit it. On the other hand, if conditions of a row is satisfied, users can edit the datetime in cells of this row.
Hence the datetime cells of rows inside a grid need to be disabled / enabled instead of hide/show subject to conditions.

I tried the reference in https://www.pmusers.com/index.php/Editable_grid_fields_when_checkbox_is_marked but the method did not work with datetime control.

cheers,
Karl
#828764
Thank you for the advise by kirkwg and programerboy,

Both approaches work with datetime control.

However, I could not make
$('#form\\['+gridId+'\\]\\['+rowNo+'\\]\\['+aGridFieldsEditable+'\\]').parent().find("input,span").attr("disabled", disableState);
works with textarea and dropdown.

cheers,
Karl
#828769
Hi Karl,

As said use simple code, it also works to disable dropdown or textarea by : E.g.
$("#grid_id").getControl(1,1).attr("disabled", true); //say column 1 is dropdown
$("#grid_id").getControl(1,7).attr("disabled", true); //say column 7 is textarea

It works on my side, anyway...
#828772
Hi Kirkwg,

Thank you for your kind attention.
I'm sorry that I better replied both suggestions separately.

What I mean was I could not make the method
$('#form\\['+gridId+'\\]\\['+rowNo+'\\]\\['+col+'\\]').parent().find("input,span").attr("disabled", disableState);
works with textarea and dropdown.

Your approach
$("#grid_id").getControl(row, col).attr("disabled", disableState);
could work with textarea, dropdown and datetime.

Many thx

cheers,
karl
#828773
Hi Karl,

If you understand the code,
$("#grid_id").getControl(row, col). OR
$('#form\\['+gridId+'\\]\\['+rowNo+'\\]\\['+col+'\\]').

The two above already point to your specific field, so the rest is the same in order to set its attribute disabled to true/false!
That means it works as: //no need using find(...)
$('#form\\['+gridId+'\\]\\['+rowNo+'\\]\\['+col+'\\]').attr("disabled", true); //no matter it is dropdown or textarea..

Please try understand the code, thanks..

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]