How to get the Ids of selected record in a grid view?

Posted by ithrees on 04-Jan-2016 23:21

Hi All,

Is there any client-side API or any other work around available to get the list of selected records IDs in grid view? and to get the other field values of the selected records in view?

Thanks in advance,
Ithrees

All Replies

Posted by Sri Harsha on 05-Jan-2016 08:56

Hi,

There is no such client side api to fetch the selected records ids. The selection info is persisted on server side and there is

server-side api available to fetch the info. Please have a look at documentation.progress.com/.../

Once the selction info is available, the field values can be retrieved using the rbf_getFields() client side api.

(documentation.progress.com/.../

Does that help you ?

Regards,

Harsha.

Posted by ithrees on 06-Jan-2016 22:01

Thank you Harsha,

Since I want this in the client side I add the script below to bind with the click event for the checkboxes

var slcd = [ ];

$('input[name^="sel_"]').on('click', function() {
   var id = (this.name).substring(4);
   if (this.checked == true){
      slcd.push(id);
   }else{
      slcd.splice( slcd.indexOf(id), 1);
   }
});

Additionally I add the following to the onload in order to get the selected Ids when the page is refreshed,

$('input[name^="sel_"]').each(function(){
    if (this.checked == true){
      slcd.push((this.name).substring(4));
   }
});

Note that the above work around will work only for the current view page.

Thanks and Regards,
Ithrees

This thread is closed