View Full Version : Hiding/showing trigger of date field dynamically

21 Aug 2012, 3:01 AM
Hi guys,

I'm facing a problem with hiding and showing the trigger of the date field which shows up when I edit a row.When rendering the date field , trigger of the datefield is hidden by 'hideTrigger:true' config.

When the focus is on the base text field then, the trigger should appear (date picker).I handled this in the 'focus' event handler of the date field in which I have made 'this.hideTrigger=false'.This doesn't seem to work when the focus is on the date field.
But the trigger appears when I start to delete the existing text of the base text field.Now, the focus event is not fired (alerts in event handler don't show up when the text is deleted).But,when I comment out the code for showing the trigger in event handler of focus event, the trigger doesn't show up when the text is deleted.

Very confused by this behavior.

Can't I change the config dynamically ?Please help!

21 Aug 2012, 3:07 AM
try using the setReadOnly() method. When you pass true, the picker shouldn't appear and you can pass false to make it non-readonly again.

21 Aug 2012, 5:20 AM
Thanks a lot! it worked like charm!