This project has moved and is read-only. For the latest updates, please go here.

Dynamic SPDisplayRelatedInfo

Feb 1, 2011 at 6:07 PM


I'm trying to change the list and columns that are displayed in SPDisplayRelatedInfo based on which radio button is selected by the user. What I'm finding is that whatever the second selection is, the columns and information are not displaying.  Using $('#SPDisplayRelatedInfo_').hide(); worked as far as removing the columns and information from the first selection (radio button) but the columns and information from the second selection (radio button) never displayed. Can you point me in the right direction as to how to ensure that the SPDisplayRelatedInfo area is refreshed based on the selection?

I am using SPAutocomplete along with SPDisplayRelatedInfo but it is working as expected.

   var listName, relListColumn;
     if( $('#MasterNameRadio:checked').val() !== undefined){
   var relListColumns  =["Name","Address","Date_x0020_of_x0020_Birth","Officer_x0020_Safety"];
   relListColumn   ='Name';
   listName  ='MasterName';

  if( $('#CaseRadio:checked').val() !== undefined){
   var relListColumns =["Case_x0020_Number","Offense_x0020_Classification","Date","Case_x0020_Status"];
   relListColumn   ='Case_x0020_Number';
   listName  ='Cases';

    columnName: "Case Number",
    relatedWebURL: "",
    relatedList: listName,
    relatedListColumn: relListColumn,
    relatedColumns: relListColumns,
    displayFormat: "table",
    headerCSSClass: "ms-vh2",
    rowCSSClass: "ms-vb",
    numChars: 1,
    matchType: "Eq",
    CAMLQuery: "",
    debug: true,
    completefunc: null
 });// End SPAutoComplete




Feb 1, 2011 at 7:29 PM
Marcus: I wrote SPDisplayRelatedInfo to work with dropdowns, not radio buttons, so I'm surprised it works for you at all! Obviously you can clone the code and customize it to work with radio buttons as well, but that's a task you'll need to undertake. M.
Feb 1, 2011 at 10:47 PM


My apologies for the confusion. The field that SPDisplayRelatedInfo is based off of is a normal input field. The value that is displayed in the input field change according to what is selected by the radio button. Hence SPDisplayRelatedInfo needs to change. Does that clarify?

Feb 2, 2011 at 3:01 AM


I'm still not getting what you're up to. Can you post a screenshot somewhere?