FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



Feb 16, 2016, 12:39 PM
1 Posts

Looking for help populating a dojo data grid based on the select document

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags: XPages,dojo grid
  • Replies: 2

I have two REST controls that populate two enhanced dojo data grids.  One is populated with companies, the other I would like populated with the contacts of the selected company.  I am able to select a company and display the UNID of that document in a field on the xpage.  I am having difficulty filtering the contact grid based on that UNID.  What is the best way to do that?  Below is what I have tried

Populate the ParentID field with the selected doc UNID using (CSJS):

       var grid = arguments[0].grid;

       var index = arguments[0].rowIndex;

       var item = grid.getItem(index).attributes;

       XSP.getElementById("#{id:ParentID}").innerHTML = item.companyLink;

       XSP.partialRefreshGet("#{id:contactListPanel}")

Retrieve the UNID from Parent ID and use in the keys parameter of the contact REST control using (SSJS):

       getComponent("ParentID").getValue()

 

It looks like the contact grid is refreshing when a company doc is selected, however all the contacts for all companies appear in the contact grid no matter what company is selected.

 

Feb 23, 2016, 12:09 AM
453 Posts
An Idea

I have not used the dojodatagrid but if I understand your problem I think you could do it pretty easily with a couple nested repeat controls. 

Mar 5, 2016, 5:35 AM
38 Posts
category Filter

If you are using the viewItemFileService in the REST control of the Ext Lib, you may set the category Filter with the ParenUNID

If empty it will return everything


FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.