The CreatorCon Call for Content is officially open! Get started here.

How to get "Show related fields" on filter?

tomelk31
Kilo Explorer

I have been working on a Change Calendar which has a filter at the top of the page:

Screen Shot 2014-11-24 at 12.20.23.png

The filter at the top is based upon the following client script:

 

var sp = $('schedule_page');


// display or hide the filter
function displayScheduleFilter(record) {
       var filterDiv = getThing(record, "gcond_filters");
       var image = record + "filterdiv_image";
       if (filterDiv.style.display == 'none') {
               setImage(image, "images/filter_reveal.gifx");
               // set up filter object if not already there
               if (filterDiv.filterObject == null) {
                       var fltObj = new GlideFilter(record,"");
                       fltObj.setRunable(true);
                       fltObj.setRunCode("runScheduleFilter()"); // run our function when "run" is clicked
                       //fltObj.addRunButton();
                       addUnloadEvent(function() {
                               var filterDiv = getThing(record,"gcond_filters");
                               if (filterDiv)
                                       if (filterDiv.filterObject != null)
                                       filterDiv.filterObject.destroy();
                       });
               } else { console.log(">>>>>filter object is not null"); }
               show(filterDiv);
       } else {
               setImage(image, "images/filter_hide.gifx");
               hide(filterDiv);
       }
}


// redraw the timeline with the items that match the filter
function runScheduleFilter() {
       var filterDiv = getThing("change_request","gcond_filters");
       if (filterDiv) {
               if (filterDiv.filterObject != null) {
                       var filter = getFilter("change_request", false);
                       sp.contentWindow.schedulePage.calendar.setParameter("filter", filter);
                       sp.contentWindow.schedulePage.calendar.draw();
               }
       }
}

 

My question is how can I show "Show related fields" in the filter choice list. Currently it only shows fields from the Change Request. I want to see fields from the CI table.

1 REPLY 1

alexsheer
Kilo Contributor

Tomelk31,



I'm trying to create a dynamic calendar with filters exactly like you did above.


Can you please post or tell me the rest of the client script you used to create the snapshot of the calendar you have posted above?


What table did you use?