This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Sep 29, 2011, 2:19 PM
31 Posts
topic has been resolvedResolved

Dojo Grid w/Rest Service - how do I get the document / universalID ?

  • Category: Other
  • Platform: Windows
  • Release: 8.5.2
  • Role:
  • Tags: Dojo
  • Replies: 2
Hi !
 
How can I get the document associated with the row in the grid ? It's the universal ID I need...
 
I have tried to set the var attribute on the REST Service control and then create a column using this var.getDocument().UniversalID() or var.getUniversalID()
 
I then have a function in the dblclick event to open the document, but I'm missing the universalID ...
 
If I have a column for the universalIID in the grid assiciated with the REST Service it's easy, but the problem is when I don't have this column (or the possibility to add one...)
 
 
Any ideas  would be greatly appreciated :-) Thanks !
 
Best regards,
Petter
Sep 29, 2011, 6:38 PM
25 Posts
Re: Dojo Grid w/Rest Service - how do I get the document / universalID ?
 Petter,
 
This should get what you're looking for (things in bold you'll need to change to match your implementation):
 
var dataGridDij = dijit.byId(dojo.query("[id$='GridServerSideId']\")[0].id);
/* 
 * Using Firebug or Chrome's developer tools: 
 * The console log statements below will allow you to see all the currently selected documents 
 * and their properties that you can access via client side javascript.
 * 
 * The 2nd console log statement should show you all the properties of the data grid dijit itself 
 */ 
console.log(dataGridDij.selection.getSelected());
console.log(dataGridDij); 
var unid = dataGridDij.selection.getSelected()[0].attributes['@unid'];
window.open("http://yourserver.com/path/to/db.nsf/yourXpage.xsp?documentId=" + unid + "&action=editDocument");
 
I highly recommend that you check out the Dojo API for the data grid. I'm sure you'll find many interesting nuggets of information there that should help you find the properties that control or publish whatever you may be looking for. You can find that documentation at : http://dojotoolkit.org/api/1.4/dojox/grid/DataGrid. In order to set any properties that are part of the data grid but not exposed via the Extension Library component you can just add them as a dojo attribute to the extension library component.
 
You might also take a look at this blog post: http://xprentice.gbs.com/A55BAC/keithstric.nsf/d6plinks/KSTD-8GJNJW. While you probably don't want to create your own component it may reveal some of the settings you may want to control and how to get to those properties via client side javascript.
HTH 
Sep 29, 2011, 7:40 PM
31 Posts
Re: Dojo Grid w/Rest Service - how do I get the document / universalID ?
HI Keith,
 
Thanks a lot for your helpful information ! Works perfectly.
I must really start using firebug for all it's worth.
 
Learning new stuff every day :-)
 
Best regards,
Petter

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal