0 votes

An Efficy DataGrid generates a grid/table from a dataset. As far as I know, a DataSet can only be created by executing a query to the relational database.

In case a datasource is JSON - obtained by a web request to an external REST service - could we actually create a DataSet with ServerJS and bind it to a DataGrid?

Features like paging, sorting, filtering and grouping would be possible.

asked in Efficy Integrations by (7.4k points)

1 Answer

+1 vote

You can create a DataSet in ServerJS and fill it with data coming from a JSON, but there is currently no way to bind it persistently to a DataGrid.

It would definitely be possible to implement this.
Instead of using a <%RunQuery(id='xxxx', store='yy', mainquery='true', ...)%> in the page you would call a <%RunScript()%> that would make a REST request to obtain JSON data and then call a new method Efficy.StoreQuery('xxxx', yy, true, jsonData) to convert the JSON data to a native DataSet and store it with the appropriate ID and Store number.

Subsequently in the page you could refer to this query with its ID or use all the automatic behavior if you set the mainquery parameter.

answered by (1.2k points)
I like it very much :-)

Should I make a suggestion case referring to this post?
1,249 questions
1,519 answers
328 users