[4.2] - Link Lookup field gets enabled after disabling it on

Posted by IramK on 31-Aug-2016 09:26

Hello,

I have some code that checks for a checkbox value on load of the page and if the checkbox is checked, I am disabling a link lookup field. However after I disable the link lookup field, it re-enables back again. I do not have any other code that does the enabling/disabling of this field.

Here is the code:

$("document").ready(function () {
	var linklookupdropdown = rbf_getFieldContext("linklookupdropdown").getKendoConfig();
	//If checkbox is checked then disable link lookup field
	if (rbf_isChecked('checkboxfield')) {
		linklookupdropdown.enable(false);
	} else {
		linklookupdropdown.enable(true);
	}
});

Please let me know if there are any issues with this. I think this is a bug.

Cheers.

Iram

Posted by Vimalkumar Selvaraj on 07-Sep-2016 01:53

Hi Iram,

I tried this which seems to be working for me. Can you try putting your  script inside "rbs_pageRender"  custom event callback, something like below

rb.newui.util.addEventListener("rbs_pageRender",function(){});

If still doesn't work , please let us know.

Thanks,

Vimal.

All Replies

Posted by Vimalkumar Selvaraj on 07-Sep-2016 01:53

Hi Iram,

I tried this which seems to be working for me. Can you try putting your  script inside "rbs_pageRender"  custom event callback, something like below

rb.newui.util.addEventListener("rbs_pageRender",function(){});

If still doesn't work , please let us know.

Thanks,

Vimal.

Posted by Thierry Ciot on 07-Sep-2016 12:54

Since we have implemented Ajax loading you need to use the construct below and not document ready anymore

<script>

try {  

 if (!rbf_isNewUI()) {

   throw 'This Script is written for New UI';

 }

 var onLoad = function () {

   if(console){

     console.log("Execute on page load ");

   }

 };

 rb.newui.util.addEventListener(rb.newui.util.customEvents.rbs_pageRender, onLoad); //instead of document.ready(onLoad) or $(onLoad);

}

catch (err) {

 if (console) {

   console.log(err);

 }

}

</script>

Posted by IramK on 08-Sep-2016 11:31

Yes it was the issue with document.ready(). I think you are using the document.ready event to set the link lookup. Changing the load function to rbs_pageRender has fixed the issue.

Thanks.

This thread is closed