1

I have a problem with a pagination plugin in my Ehancedgrid on my XPages application using JSONRest, at pageload my grid display few data in between 5 and 10 of which my defaultPageSize is 25, but when i click on pageSizes on the pager control it then display the actuall number of data. Below is my code i am not sure what am doing wrong

<xe:restService id="demoRestService" pathInfo="gridData_View">
    <xe:this.service>
        <xe:customRestService contentType="application/json" requestVar="rowData" requestContentType="application/json">
    <xe:this.doGet><![CDATA[#{javascript:importPackage(com.ibm.office);
var inBox = new Mail(userProfile);  
inBox.convertToJSONString(sessionScope.inbox) }]]>
</xe:this.doGet>
        </xe:customRestService>
    </xe:this.service>
</xe:restService>   



<script>
    var jsonStore = new dojo.store.Cache(new dojo.store.JsonRest({target:"Mail.xsp/gridData_View",idProperty    : "id" }), dojo.store.Memory({idProperty : "id"}));
    var dataStore = dojo.data.ObjectStore({objectStore:jsonStore});
</script>   


<xe:djxDataGrid id="grid" store="dataStore" jsId="dataGrid" dojoType="dojox.grid.EnhancedGrid" query="{start: 0,  count: 25}" style="width: 70em;height: 80em;">
    <xe:this.dojoAttributes>
            <xp:dojoAttribute name="plugins">
                <xp:this.value><![CDATA[{selector: { cell: false, col: false},
                indirectSelection: {headerSelector:true, width:"20px", styles:"text-align: center;"},
                pagination: { description: true,position: "bottom", sizeSwitch: true, pageStepper: true, gotoButton: true,pageSizes: ["25", "50", "100","200", "All"],maxPageStep: 1, 
            defaultPageSize:"25" } }]]>
            </xp:this.value>
            </xp:dojoAttribute>

    </xe:this.dojoAttributes>
            <xe:this.onClick><![CDATA[
    var grid = dijit.byId('#{id:grid}');
    var items = grid.selection.getSelected();
    var v = []
            if(items.length){
                dojo.forEach(items, function(selectedItem){
                    if(selectedItem !== null){
                        var store = dataGrid.store;
                        var id=store.getValue(selectedItem, "Id")
                                v.push(id)
                    }
                });

            } 
    myRPC.setSelection(v)]]></xe:this.onClick>
    <xe:djxDataGridRow id="djxDataGridRow1">
        <xe:djxDataGridColumn id="djxDataGridColumn6" width="20em" label="Sender" field="Sender"></xe:djxDataGridColumn>
        <xe:djxDataGridColumn id="djxDataGridColumn7" width="50em" label="Subject" field="Subject"></xe:djxDataGridColumn>
        <xe:djxDataGridColumn id="djxDataGridColumn8" width="50em" label="ReceivedDate" field="ReceivedDate"></xe:djxDataGridColumn>
   </xe:djxDataGridRow>
</xe:djxDataGrid>
K.john
  • 21
  • 1
  • Does your service actually understand [the Range header that JsonRest is sending to it](http://dojotoolkit.org/reference-guide/1.10/quickstart/rest.html#ranges)? – Ken Franqueiro Nov 12 '15 at 15:21

0 Answers0