Servicio de Resto de Documentos

I have following code where in I want to display data from a Rest Doc Service into Dojo Data Grid. Output of Rest service is fine but Datagrid siplay displays the column titles and nothing else. Here is my code:

        <xe:restService id="restService1" pathInfo="docAccReq1"
            rendered="true" state="true">
                    contentType="application/json" systemItems="63" var="docAcc"
                        <xe:restDocumentItem itemName="Name"
                            itemName="ACCESSREQUESTER" name="ACCESSREQUESTER">
                            itemName="ACCESSREQUESTEDDATE" name="ACCESSREQUESTEDDATE">

        <xe:djxDataGrid id="djxDataGrid1"
            storeComponentId="restService1" store="docStore">
                <xp:dojoAttribute name="autoWidth" value="true"></xp:dojoAttribute>
            <xe:djxDataGridColumn id="djxDataGridColumn1"
            <xe:djxDataGridColumn id="djxDataGridColumn2"
            <xe:djxDataGridColumn id="djxDataGridColumn3"

        <xe:firebugLite id="firebugLite1"></xe:firebugLite>
    <xc:ccDebugToolbar defaultCollapsed="true"

preguntado el 28 de mayo de 14 a las 13:05

here is the output of rest service:{"@unid":"80EFAE936EA978A480257CE4002DBC67","@noteid":"12C7A","@created":{"data":"2014-05-26T08:19:33Z","type":"datetime"},"@modified":{"data":"2014-05-26T11:13:39Z","type":"datetime"},"@authors":["CN=Arun Agnihotri\/O=XYZ"],"Name":"Arun","ACCESSREQUESTER":"Arun Agnihotri","ACCESSREQUESTEDDATE":{"data":"2014-05-26T08:19:31Z","type":"datetime"}} -

Shouldn't you use "viewJsonService" instead to get documents from a view and not just one certain document? -

1 Respuestas

The REST service should deliver a data matriz. Esto es lo que xe:djxDataGrid expects as it is a data grid control which shows data in multiple rows in a table.

The common way is to use the REST service viewJsonService. Define all columns you want to see in data grid in a view. You connect the view to REST service with parameter "viewName" and with defaultColumns="true" you make sure that todos columns get delivered.

Your REST service definition would look like this then:

            defaultColumns="true" />

The REST service delivers JSON data as an array:

      "ACCESSREQUESTER":"Arun Agnihotri",

The values "@position" and "@siblings" are important for Dojo Data Grid. They tell how many entries are in view and which position is the current data entry on. This allows to show a right sized vertical scroll bar at the right vertical position.

The Rest service documentJsonService you used delivers only one single JSON object (not an array) and doesn't provide those additional information.

contestado el 28 de mayo de 14 a las 17:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.