MWAN001

Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Author
    Replies
  • in reply to: Can JQGrid work with SharePoint result source REST API #127489
    MWAN001
    Participant

    Thanks, Will.

    Notice another issue that the jqgrid column width not responsive to the window resizing. The columns look best at 80% Chrome window size. If I zoom to 100%, the last two columns disappeared and there is no horizontal scroll bar to scroll to the right.

    I did some search, some people suggested to use this function. It doesn’t work, actually even at 80%, last two columns are truncated.

     

     

    in reply to: Can JQGrid work with SharePoint result source REST API #127487
    MWAN001
    Participant

    Thanks a lot, Will.

    Use addRowData method to add 2nd array, can I add a few hundred rows?

    2 arrays I limit the total search result to 500 rows.

     

    in reply to: Can JQGrid work with SharePoint result source REST API #127485
    MWAN001
    Participant

    I have two arrays to display in jqgrid, one is folders and the other is attachments. I concatenate them into one array.

    Is it possible to add the folder array to the grid first, then add attachment array? now they are mixed together.

    in reply to: Can JQGrid work with SharePoint result source REST API #127484
    MWAN001
    Participant

    I got it fixed now: A function was called to do another filtering of  data array. That is why it works for the api call that returns all data, then this function filters the data by search term. Another api that failed returns already filtered data so calling this function will remove the data from jqgrid.

    The only issue now is I have to do F5 to have a hard refresh to start a new search.

    in reply to: Can JQGrid work with SharePoint result source REST API #127480
    MWAN001
    Participant

    The code failed to populate jqgrid:

    • This reply was modified 3 weeks, 2 days ago by admin.
    in reply to: Can JQGrid work with SharePoint result source REST API #127479
    MWAN001
    Participant

    The code jqgrid successfully populated:

    • This reply was modified 3 weeks, 2 days ago by admin.
    in reply to: Can JQGrid work with SharePoint result source REST API #127478
    MWAN001
    Participant

    Thanks for following up!  We have two versions of api code to populate the jqgrid. We are building search results with jqgrid then allow users to select to download.

    The 1st approach is to use this api call to get back items

    var apiUrl = _spPageContextInfo.webAbsoluteUrl + “/_api/web/GetFolderByServerRelativeUrl(‘documentrequest’)/Folders?$expand=ListItemAllFields,AuthorID/id&$select=Name,ItemCount,ListItemAllFields/AuthorId,ListItemAllFields/ExaminiationName,ListItemAllFields/PublishedDate1,ListItemAllFields/MRAName,ListItemAllFields/RecommendationName&$filter=Name ne ‘Forms’ and ItemCount gt 0”;

    This version of code loads the result successfully to jqgrid.  Please see the attached working jqgrid txt file and array for the jqgrid loaded successfully screenshot for the array items that are pushed to the array that feeds the jqgrid.  Notice the items loaded successfully in jqgrid automatically have an id.

    This approach doesn’t meet the requirement to return all the search results, all the fields and  attachments.

    The 2nd approach uses a SharePoint search api

    var apiUrl = _spPageContextInfo.webAbsoluteUrl + “/_api/search/query?querytext='” + txtSearch + “*’&sourceId=’d90c1997-7b33-42be-8fb3-d1dc2543ffa7’&rowlimit=100&selectproperties=’Filename, Path, ContentTypeId'”;

    this api doesn’t return meta data fields so we have to use the Filename to run another api call to get back the meta data, then push the meta data to the array that feeds the jqgrid.  Jqgrid failed to load the data most of the time, even though the array is populated. I even trimmed down the properties to be the same as the 1st approach. still jqgrid doesn’t display data.

    Please see attached jqgrid not loading code in txt file and array for the jqgrid failed to load screen shot.

     

    in reply to: Can JQGrid work with SharePoint result source REST API #127476
    MWAN001
    Participant

    RequestNameOWSTEXT, SubmittedByOWSUSER,ExaminiationNameOWSTEXT,PublishedDate1OWSDATE are managed properties that are queryable but no value returned from the search api call. search api call returns system columns, like contenttypeId, filename, path but not the custom column values.

    in reply to: Can JQGrid work with SharePoint result source REST API #127475
    MWAN001
    Participant

    Found out need to use results = data.d.query.PrimaryQueryResult.RelevantResults.Table.Rows.results to retrieve data from the search results

    https://siteurl/_api/search/query?querytext=’cash flow*’&sourceId=’d90c19*****************a7’&rowlimit=100&selectproperties=’Filename, RequestNameOWSTEXT,SubmittedByOWSUSER,ExaminiationNameOWSTEXT,PublishedDate1OWSDATE’

    Two issues:

    1.  RequestNameOWSTEXT,SubmittedByOWSUSER,ExaminiationNameOWSTEXT,PublishedDate1OWSDATE are searchable managed properties but results are null

    2. document set filename are displayed in the JGGrid just fine but the attachments are not displayed in jqgrid. Filename returns both document sets and attachments.

    requestArr.push({
    Name: getValueByKey(“Filename”, itemResults),
    RequestName: getValueByKey(“Filename”, itemResults),…..

    })

Viewing 9 replies - 1 through 9 (of 9 total)

Stay connected with us in your favorite flavor!