This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Getting an handle for the search results

suryakumars - Wednesday, March 17, 2010 12:42 PM:

I want to achieve the following.

1. On search results page for any itemtype. Let us take part here.

2. i select one or multiple parts.

3. Click on custom action . say "Mass update"

4.Open a custom form with all attributes on the form.

5. Mass update.

 

I am struggling with the following. Getting a handle to the selected items(parts) in my custom method.

 

Any help is greatly appreciated.



RobMcAveney - Wednesday, March 17, 2010 1:20 PM:

You need to get a handle to the grid, then use getSelectedItemIds().  The action will run for each selected item so your code should only act on the first one.  Here is some sample code:

if (top.main && top.main.work && top.main.work.gridApplet)
{
  var grid = top.main.work.gridApplet;
  var idArray = grid.getSelectedItemIds(",").split(",");
  if (idArray[0] == this.getID())
  {
    alert(idArray.join(","));
  }
}

Rob



suryakumars - Friday, March 19, 2010 6:34 AM:

Thanks rob..found your help really useful

 

Surya