Hi ,
I am using Infragistic 11.1 Version . I have a control webdatetimeedit . I want to show a Default time like (from database : 12:15) when a page is Loaded 1st Time .
Scenario 1:
For this Control, I am using one javascript method populatetime() where I set the value using igedit_getById(controlId).setValue('12:15') . But I am getting exception in javascript that mean igedit_getById(controlId) returning undefined value .
Scenario 2:
I have another checkbox . if I click on the check box, , The control time to be more that one Hour . In onclick event of checkbox I used the same method populatetime() where
I used igedit_getById(controlId).setValue('13:15') . Here I am able to get the control with showing time .
In scenario 1 the webdate timeedit control value is blank and getting exception , can you please help me on this scenario 1 .
Thanks and Regards
Ganga
Hi Ganga,
I suggest you to debug by splitting final expression on one-step statements and check if each of them is valid. For example, you may use alerts:
if (typeof igedit_getById !== 'function') alert('you should wait until javascript files are loaded');
if (!igedit_getById(controlId)) alert('you should wait until WebTextEdit ' + controlId + ' is initialized');
If you will get alerts, then that means that your call to setValue is too early. You may consider to move your statements into page onload or other events. You also may try to use setTimeout, but that can be unstable.var controlId = 'WebTextEdit1';var val = '12:15';setTimeout(function () { igedit_getById(controlId).setValue(val); }, 500);
Well, I moved it to the bottom of the page, and its making a call when a key is pressed on the page, but I still get the undefined error.