Question

I am trying to implement the DOJO data gird in my application. On load of the xPages I am getting the current user id in a session scope variable and filtering the REST services that supplies the data grid the data from a view, based on the user id. I have used the "keys" property to filter the values so that the current user should be able to see the values only relevant to him in the grid. This is working fine, but when I try to sort the results once the page is loaded it starts displaying blank values and sort does not work. I have made sure that the columns I require to sort are also made sorted for the back-end view by checking the "Click on column header to sort" option in the view. Still I am unable to get the sorting working for columns. Please let me know if there is a work-around for this problem or am I doing or not doing something for the default sort not to work as expected.

Was it helpful?

Solution

Nash, I have had similar issues with the blank rows as you describe. I think the blanks lines are rows that don't match the keys. Here are my tips for fixing this. The issue I think is not with your grid but your Rest service.

  • Use a viewJsonService type of rest service
  • Use a category filter instead of keys
  • Make your category filter code similar to mine below. This will ensure that you don't show documents to someone who shouldn't see them. When the category is null, the Rest service will show all documents. This isn't causing the blank lines, but is a best practice IMO.

     var category:String = lineItemBean.getThisUNID(); 
     //wherever your category comes from, maybe session.getUserName() in your case
     if(category == null){
         return "show nothing"
     } else {
        return lineItemBean.getThisUNID();
     }
    

I hope this helps. My guess is that this will fix your sorting issues as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top