Search code examples
xpagesdojo.gridxgridx

xpages gridx jsonREST and query/search


I have been following the excellent 'Dojo Grids in XPages' by Brad Balassaitis - https://xcellerant.net/dojo-grids-in-xpages/

I have an XPage with a jsonREST service referencing a Notes View, and the options described in Part 10 - Dojo data grid searching and filtering.

So it all works very well, I can make a choice in the ComboBox, and the Grid reloads showing the results of the jsonREST Service Search.

I now want to do the same thing with gridx; again Brad has an excellent series on this - https://xcellerant.net/gridx-in-xpages/

However, he does not cover doing a jsonREST search and reloads of the gridx.

I have been trying to replicate the techniques from the Data Grid version, but with no success. I am not even sure if I should be directly running a jsonREST Search, and then refreshing the grid, or use the grid.query method. I am finding very little good documentation, and any related articles do not seem to help me much. I am stuck now really.

Any pointers much appreciated.


Solution

  • Steven's code helped me to find an answer that worked for me. All of the filter/gridx store query/JSON Rest update/refresh gridx/gridx filterSetupQuery attempts I made failed miserably. What worked for me was to use the ?search= option in the URL when generating the store:

    var store = JsonRest({idProperty:'@entryid', target:'xpViewQBuster.xsp/jsonREST' + strSearch});