This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getUserById: function (id) { | |
| var self = this; | |
| return new Promise( function( resolve, reject ){ | |
| if ( id ){ | |
| var context = new SP.ClientContext.get_current(); | |
| var userInfoList = context.get_web().get_siteUserInfoList(); | |
| var query = new SP.CamlQuery(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var refiner = $getClientControl(document.getElementById($('div[refinername="' + refinerName + '"]').attr('id'))); | |
| /* | |
| Where "refinerName" is the refiner - you now have the SP Refiner control from which you can invoke any refiner methods | |
| Apply a refinement | |
| refiner.addRefinementFilter(refinerName,'\"Refinement Value\"'); | |
| Apply a refinement with Or | |
| refiner.addRefinementFiltersJSONWithOr('{\u0022' + refinerName + '\u0022:Refinement Value}'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for (var i in listData) { | |
| ... | |
| //underneath these lines in the Display Template | |
| if (ctx.RefinementControl.propertyName == "MediaDuration") { | |
| Srch.U.modifyMediaDurationRefinementName(listData[i]); | |
| } | |
| /* | |
| an alternative to the approach below would be to store the array indexes of the refinements you want to remove in a | |
| seperate array and then reverse this array before doing the deletions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Commenting out the FileType overrides for the sort. | |
| if (ctx.RefinementControl.propertyName == "FileType") { | |
| unselectedFilters = unselectedFilters.sort(SortAlphabetically); | |
| } | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| this.Options = { ShowClientPeoplePicker: false, ShowCounts: true }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <property name="SelectedRefinementControlsJson" type="string"> | |
| {"refinerConfigurations":[ | |
| { | |
| "propertyName":"SPContentType", | |
| ... | |
| "maxNumberRefinementOptions":15, | |
| ... | |
| "displayName":"Result Type" | |
| ... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ( function ( workspace, $ ) { | |
| var matches = []; | |
| //this is where we keep track of our refinement items for the Workspace refiner | |
| var workspaceItems; | |
| workspace.Mapping = { | |
| //straight site collection one to one mapping on SPSiteURL. This is detailed in the first part of the scenario. | |
| Simple: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ( function ( workspace, $ ) { | |
| ... | |
| workspace.Mapping = { | |
| ... | |
| }; | |
| /* | |
| Now we need to include the private internal and public methods for our custom refiner |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ( function ( workspace, $ ) { | |
| ... | |
| workspace.Mapping = { | |
| ... | |
| /* | |
| Meanwhile - underneath the community mapping |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ( function ( workspace, $ ) { | |
| //we keep track of previous refinement item matches in this array | |
| var matches = []; | |
| //this is where we keep track of our refinement items for the Workspace refiner | |
| var workspaceItems; | |
| workspace.Mapping = { | |
| //straight site collection one to one mapping on SPSiteURL. This is detailed in the first part of the scenario. | |
| Simple: { |