4.2 - Events "rbs_multiObjectSelectedOnSelectorView&quo

Posted by Meryk on 01-Jul-2016 06:43

Hello,

Can anyone explain how these events should be used and when they are supposed to fire, please?

Thank you

Meryem

Posted by Vimalkumar Selvaraj on 08-Jul-2016 04:45

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>

All Replies

Posted by Meryk on 04-Jul-2016 05:41

Hello,

Any help with this please?

Cheers,

Meryem

Posted by Vimalkumar Selvaraj on 04-Jul-2016 06:23

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.

Posted by Meryk on 04-Jul-2016 07:10

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

Posted by Vimalkumar Selvaraj on 04-Jul-2016 07:14

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.

Posted by Meryk on 04-Jul-2016 07:22

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

Posted by Vimalkumar Selvaraj on 08-Jul-2016 04:45

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>

Posted by Meryk on 22-Jul-2016 08:26

Hi Vimal,

Thanks for this it is working fine!

Cheers,

Meryem

This thread is closed