Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
125
igedit_getById(controlId) is getting Null or Undefined when a page is loaded
posted

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

 

Parents
  • 24497
    Verified Answer
    posted

    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);

Reply Children
No Data