Opened 11 years ago

Closed 10 years ago

#8186 closed defect (wontfix)

DataGrid - pass serverQuery for QueryReadStore

Reported by: fl0 Owned by: Nathan Toone
Priority: high Milestone: future
Component: DojoX Grid Version: 1.2.1
Keywords: Cc:
Blocked By: Blocking:

Description

DataGrid? offers no reasonable place to set the request.serverQuery object needed by the QueryReadStore? to perform advanced server queries. It was always painful in the past to set the serverQuery via DojoData?. But with the new DataGrid? there is practically no reasonable place left at all. Why not simply make it a property of DataGrid? and pass it within the store.fetch call? Or to add callback extension points in order to manipulate the request before the fetch actually gets executed?

Change History (5)

comment:1 Changed 11 years ago by fl0

Following extensions would be very handy:
onBeforeFetch: a method where 1) the request can be manipulated (e.g. serverQuery be added) and 2) the request can even be suppressed under some circumstances
onComplete: callback handler for custom processing the results

  ...
  onComplete: function(items, req) {},
  onBeforeFetch: function(req) { return true; },
  ...
  _fetch: function(start, isRender){
    ...
    }else{
      var req = { start: start,
        count: this.rowsPerPage,
	query: this.query,
	sort: this.getSortProps(),
	queryOptions: this.queryOptions,
	isRender: isRender,
	onBegin: dojo.hitch(this, "_onFetchBegin"),
	onComplete: dojo.hitch(this, "_onFetchComplete"),
	onError: dojo.hitch(this, "_onFetchError")
      };
      if (this.onBeforeFetch(req))
        this.store.fetch(req);
    }
    ...
  },
  ...
  _onFetchComplete: function(items, req){
    onComplete(items, req);
    if (items && items.length > 0){
      ...


just a draft, might or might not work, but you get the idea...

comment:2 Changed 11 years ago by Nathan Toone

Owner: changed from Bryan Forbes to Nathan Toone

Reassigning to me

comment:3 Changed 11 years ago by Nathan Toone

Milestone: tbd1.3

comment:4 Changed 10 years ago by Nathan Toone

Milestone: 1.3future

comment:5 Changed 10 years ago by Nathan Toone

Resolution: wontfix
Status: newclosed

serverQuery is a specific extension to QueryReadStore? - and as such, would require a customized grid widget to support it. No other widget in all of dojo, dijit, or dojox supports serverQuery directly that I can see.

However, you should be able to extend dojox.grid.DataGrid? and replace or override the _fetch function.

Note: See TracTickets for help on using tickets.