disable datepicker on date fields that are readonly

Questionsdisable datepicker on date fields that are readonly
Richard Kooijman asked 12 years ago

Hi, how can I disable datepicker on date fields that are readonly?

6 Answers
Abu Ghufran answered 12 years ago

Hello,

If you set field readonly by the following setting, it does not show datepicker.

$col["editrules"] = array("readonly"=>true);

If you have used any other way to make readonly, you can goto jqgrid_dist.php and search

jQuery(el).datepicker

and apply some IF condition for readonly field.

kim answered 10 years ago

can the datpicker popup be:
1)deactivated on clicking the field
2)activated on clicking icon

🙂

Abu Ghufran answered 10 years ago

Edit jqgrid_dist.php in lib/inc and remove .click() binding.

Search and remove following.

.click(function(e){jQuery(el).datepicker('show')
.click(function(e){jQuery(el).datetimepicker('show')

kim answered 10 years ago

i tried but i need the opposite.
I need to HIDE calendar when clicking FIELD.
KEEP calendar when clicking ICON.

Abu Ghufran answered 10 years ago

Revert last advice, add following:

$col["formatoptions"] = array("srcformat"=>'Y-m-d',"newformat"=>'Y-m-d', "opts" => array("changeYear" => false,"showOn"=>"none"));

"showOn"=>"none"

kim answered 10 years ago

perfect!
Thank U!

Your Answer

8 + 5 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?