Residual Document Service

I have the following code in which I want to display data from a DOS service for a service in a Dojo Data Grid. The output of the Rest service is fine, but the Datagrid siplay displays the column names and nothing more. Here is my code:

<xp:panel>
        <xe:restService id="restService1" pathInfo="docAccReq1"
            rendered="true" state="true">
            <xe:this.service>
                <xe:documentJsonService
                    contentType="application/json" systemItems="63" var="docAcc"
                    documentUnid="80EFAE936EA978A480257CE4002DBC67">
                    <xe:this.items>
                        <xe:restDocumentItem itemName="Name"
                            name="Name">
                        </xe:restDocumentItem>
                        <xe:restDocumentItem
                            itemName="ACCESSREQUESTER" name="ACCESSREQUESTER">
                        </xe:restDocumentItem>
                        <xe:restDocumentItem
                            itemName="ACCESSREQUESTEDDATE" name="ACCESSREQUESTEDDATE">
                        </xe:restDocumentItem>
                    </xe:this.items>
                </xe:documentJsonService>
            </xe:this.service>
        </xe:restService>

        <xe:djxDataGrid id="djxDataGrid1"
            storeComponentId="restService1" store="docStore">
            <xe:this.dojoAttributes>
                <xp:dojoAttribute name="autoWidth" value="true"></xp:dojoAttribute>
            </xe:this.dojoAttributes>
            <xe:djxDataGridColumn id="djxDataGridColumn1"
                field="Name">
            </xe:djxDataGridColumn>
            <xe:djxDataGridColumn id="djxDataGridColumn2"
                field="ACCESSREQUESTER">
            </xe:djxDataGridColumn>
            <xe:djxDataGridColumn id="djxDataGridColumn3"
                field="ACCESSREQUESTEDDATE">
            </xe:djxDataGridColumn>
        </xe:djxDataGrid>

        <xe:firebugLite id="firebugLite1"></xe:firebugLite>
</xp:panel>
<xp:panel>
    <xc:ccDebugToolbar defaultCollapsed="true"
        collapseTo="left"></xc:ccDebugToolbar>
</xp:panel>

+4
source share
1 answer

The REST service must provide an array of data. This is what it expects xe:djxDataGrid, as it is a data grid control that displays data in multiple rows in a table.

REST viewJsonService. , . REST "viewName", defaultColumns="true" , .

REST :

<xe:restService
    id="restService1"
    pathInfo="docAccReq1">
    <xe:this.service>
        <xe:viewJsonService
            viewName="AccessRequests"
            defaultColumns="true" />
    </xe:this.service>
</xe:restService>

REST JSON :

[
  {
      "@entryid":"1-80EFAE936EA978A480257CE4002DBC67",
      "@unid":"80EFAE936EA978A480257CE4002DBC67",
      "@noteid":"12C7A",
      "@position":"1",
      "@read":true,
      "@siblings":200,
      "@form":"access",
      "Name":"Arun",
      "ACCESSREQUESTER":"Arun Agnihotri",
      "ACCESSREQUESTEDDATE":"2014-05-26T08:19:31Z"
  },
  {
      ...
  },
  ...
] 

"@position" "@siblings" Dojo Data Grid. , , . .

Rest documentJsonService, , JSON ( ) .

+3

Source: https://habr.com/ru/post/1542331/


All Articles