Ticket #1804089 (closed enhancement)
Reportersfbugs |
Opened: 09/28/07 Last modified: 04/13/11 Status: closed Type: enhancement Resolution: fixed |
Owner Jenny Donnelly |
Target Release: 2.9.0 Priority: P3 (normal) |
|---|---|---|---|
| Summary: | add requery method | ||
| Description: | To have an easy way to refresh the DataTable with data from the server, not just a refreshView but a requery on the server: YAHOO.util.DataTable.prototype.requery = The optional newRequest argument will default to the one given in initialRequest. If you want the new request to carry no extra arguments at all, you may call it with an empty string. |
||
| Type: | enhancement | Observed in Version: | development master |
| Component: | DataTable | Severity: | S3 (normal) |
| Assigned To: | Jenny Donnelly | Target Release: | 2.9.0 |
| Location: | Library Code | Priority: | P3 (normal) |
| Tags: | Relates To: | ||
| Browsers: | N/A | ||
| URL: | |||
| Test Information: | |||
Change History
|
Posted: 10/1/07
|
|
Posted: 10/5/07
Hi Satyam, i reviewed this request with Jenny. Her thought ar that this is simply a wrapper around a send request which should be implemented by the developer and that this in not generic enough to add to the library. Thoughts? - george |
devasatyam
|
Posted: 10/6/07
Indeed, it is just a wrapper, but being the documentation (not the API) for the DataSource almost non-existent, and that assuming the developer looks at the API for the DataSource, since he/she probably would read that of the DataTable, it cheaply produces an entry into the DataTable API right where people would look for it: refreshVew, requery, they both fit together. Also notice that most parts of the function are hard to find and put together. It was just in this release that all the config parameters became documented for all the components and even then, did you notice the get() and set() methods are not listed? (I just noticed that, it is a bug to file, you want me to do it?) Then, as I said, DataSource is poorly documented and though onDataReturnInitializeTable is well documented in the API, you would have to know what to look for in the first place. The only place where all these are put together, more or less, is the server-side pagination and/or sorting example, which might not be the obvious place to look for if you want, for example, to refresh the table periodically, a question that came up several times in the mailing list. So, I guess it is cheaper to add this few lines to the code than answering the same question over and over again for lack of better documentation. People will look for this functionality under the DataTable, few would go to the DataSource and within the DataTable API docs, as close to 're...' whatever, the best, that's where people will expect to find a clue. Either that or add a paragraph to the documentation at: http://developer.yahoo.com/yui/datatable/#using |
|
Posted: 10/19/07
added to tinernal db for tracking #1549319 |
devasatyam
|
Posted: 03/25/08
In the new long example under the heading "Server-side Sorting and Pagination" almost to the end of the DataTable there are two identical calls to sendRequest with the same setup for the callback object, all of which is quite unnecessary had there been a requery method as suggested. The code for that method now has to be modified according to the new way of passing the callback arguments which has become so long that now the method is no longer the simple one-liner above and makes even more sense that there should be a method provided for that. |
|
Posted: 01/7/09
This ticket was imported from Source Forge. Orginially submitted by: devasatyam |
|
Posted: 03/19/09
Comment by Jenny Han Donnelly 2008-06-25 16:35:29 Fleshing out the DS documentation will help. Also need to address generateRequest, SS data, and polling for DT. |
|
Posted: 03/19/09
Comment by Jenny Han Donnelly at 2008-08-19 13:36:57 Copying over Luke's description from the duplicate bug: In response to Satyam's popular requery method, perhaps it would be a good idea to encapsulate common DS->DT communication into a DT method. Suggestion: /* In initAttributes */ /* in the proto definition */ var method = methodOverride || this.get('loadMethod'); this.getDataSource().sendRequest( then either add a custom event that is fired from within DS.issueCallback and subscribe to it, or subscribe to the DT's dataReturnEvent to set('lastRequest',oRequest); |
|
Posted: 03/19/09
Comment by Lucas Smith at 2008-09-10 23:26:31 In dialog with Satyam, he suggested: var myDataTable = new DataTable(tbl,cols,dataSource,config); This would be, imo, a very intuitive interface, but this poses questions regarding data source abstraction and consistent handling of data between local and remote data sources. I wonder if you'd considered this type of API/interaction model: var dt = new DataTable('tbl',{ cols : [ {key:'foo'},{key:'bar'} ], paginator: ... }); // load would render the data rows only if the DT were already rendered where load's config would take the key parts of the DS config and cache them, so future calls to load (or sibling methods append etc) would need only specify payload info if any were needed. |
|
Posted: 03/27/09
|
|
Posted: 03/24/10
Ticket #2528710 was marked as a duplicate of this ticket. |
|
Posted: 03/30/10
created 4849629: "[fixes #1804089] Added load() as a convenience method to DS.sendRequest()." |
|
Posted: 03/30/10
|
|
Posted: 03/30/10
[fixes #1804089] Added load() as a convenience method to DS.sendRequest(). |
|
Posted: 03/30/10
[fixes #1804089] this.initialRequest -> this.get('initialRequest') |
|
Posted: 12/20/10
|
|
Posted: 04/13/11
|
Forwarding to component owner for consideration.