I am probably missing an obvious solution but after spending a couple of days on this topic I'm a bit stuck. The scenario I have is a site page with Content Editor Web Part (CEWP) and a Document Library Web Part (DLWP). My goal is to have custom filtering controls on the CEWP that trigger a AJAX call using a CAML query constructed by the current selection of the filter controls, and to display the results in either the DLWP, or something that has the same/similar look and feel as the DLWP.
I've gotten the CAML query working no problem, verified via console logging. Where I am stuck is figuring out how to visually display the results for users. Ideally I'd like to just filter the DLWP so the standard controls (version history, edit document, etc) are still there. I could generate some basic HTML to show the file name and location but this is not the objective.
Any help is appreciated.
EDIT: In case it adds clarity, the simplified use case is a response after the user types something to search for in the text input (ignores other controls). This is a condensed version of my callback function. The camlQuery is generated based on the search parameters.
function searchLibrary(asynchState, libraryName, camlQuery){
//SOAP envelope constructed here
$.ajax({
async: asynchState,
global: false,
url: site+"/_vti_bin/lists.asmx",
type: "POST",
dataType: "xml",
data: soapEnvelope,
success: function(result){
//What to do with the result here?
},
error : callError,
contentType: "text/xml; charset=\"utf-8\""
});
}
I could use SPServices if it makes any difference. I'm fairly new to this, and it seemed that SPServices was mostly a wrapper library to make the above easier to create/maintain.