Hello,
Can anyone explain how these events should be used and when they are supposed to fire, please?
Thank you
Meryem
Hi Meryk,
I got a script for you to get list of selected records on the selector list when user clicks on attach button, let me know if this works. We are not firing rbs_recordSelected in Selector List since this selection are meant only for client side , when you close and reopen you lose the selection and switch between pages also won't persist your selection. We are planning to improve this in upcoming release. We will take it into account all these when we work on them, here is the script add this to selector list page of object .
<script>
if(rbf_isNewUI() && rb.newui.page.PageContext.isDialogPage() && rb.newui.page.PageContext.getPageType() === rb.newui.PAGE_TYPES.SELECTOR){
var attachBtn = $('.rbs-selector-attach-selected');
attachBtn.on('click',function(){
console.log("Attach record button is clicked");
if(attachBtn && !attachBtn.hasClass('k-state-disabled')){
var pageComponent = rbf_getPageComponent('UJd1Oi-CRW6rRuJ_9sXdHw'); //Cell OrginalID of the Selector list
if(pageComponent){
var kendoGrid = pageComponent.getKendoConfig();
if(kendoGrid){
var actualSelRecords =[];
var allCheckedCheckBox = $('input.rbs-selector-rec-check:checked');
if(allCheckedCheckBox.length > 0){
$(allCheckedCheckBox).each(function(i){
var objId = $(this).attr('data-rec-id');
var record = kendoGrid.dataSource.get(objId);
if(record){
actualSelRecords.push(record);
}
});
console.log("All selected records");
console.log(actualSelRecords);
}
}
}
}
});
}
</script>
Hello,
Any help with this please?
Cheers,
Meryem
Hi Meryk,
rbs_objectSelectedOnSelectorView - we trigger this event after successful attach of single record to lookup field from selector list.
rbs_multiObjectSelectedOnSelectorView - We trigger this event after successful attach of multiple records to lookup field from selector list.
Thanks,
Vimal.
Ok makes sense.
I was trying to use "rbs_multiObjectSelectedOnSelectorView" event to get the selected records in a selector page, but looks like this is triggering only after the successful attach as you said, and at this point the selector page is already closed, so can't get to the grid. Is that correct ?
Do you have any suggestion how I can achieve that please?
Thank you
Meryem
Hi Meryk,
Selector list multi selections are done at client side so as soon as you select checkbox it get selected so there is no need for us to trigger event. Could you explain us what is your use case so that we can help you out?.
Thanks,
Vimal.
Hi Vimal,
On a selector page where we have the multiple attach, I am trying to get all the records selected and perform another action on them instead of "Attach selected".
So I want to get the list of selected records on click on attach basically. Also rbs_recordsSelected is not firing on these new selector pages with multiple attach.
Thanks
Meryem
Hi Meryk,
I got a script for you to get list of selected records on the selector list when user clicks on attach button, let me know if this works. We are not firing rbs_recordSelected in Selector List since this selection are meant only for client side , when you close and reopen you lose the selection and switch between pages also won't persist your selection. We are planning to improve this in upcoming release. We will take it into account all these when we work on them, here is the script add this to selector list page of object .
<script>
if(rbf_isNewUI() && rb.newui.page.PageContext.isDialogPage() && rb.newui.page.PageContext.getPageType() === rb.newui.PAGE_TYPES.SELECTOR){
var attachBtn = $('.rbs-selector-attach-selected');
attachBtn.on('click',function(){
console.log("Attach record button is clicked");
if(attachBtn && !attachBtn.hasClass('k-state-disabled')){
var pageComponent = rbf_getPageComponent('UJd1Oi-CRW6rRuJ_9sXdHw'); //Cell OrginalID of the Selector list
if(pageComponent){
var kendoGrid = pageComponent.getKendoConfig();
if(kendoGrid){
var actualSelRecords =[];
var allCheckedCheckBox = $('input.rbs-selector-rec-check:checked');
if(allCheckedCheckBox.length > 0){
$(allCheckedCheckBox).each(function(i){
var objId = $(this).attr('data-rec-id');
var record = kendoGrid.dataSource.get(objId);
if(record){
actualSelRecords.push(record);
}
});
console.log("All selected records");
console.log(actualSelRecords);
}
}
}
}
});
}
</script>
Hi Vimal,
Thanks for this it is working fine!
Cheers,
Meryem