Loading ...
Sorry, an error occurred while loading the content.

24910Re: Datatable server side sorting problem

Expand Messages
  • karla.valencia
    Feb 1, 2008
    • 0 Attachment
      If you have a "server-side pagination / server - side sorting"
      functional example I can see, I would aprecciate it.

      Thanks

      Karla V.

      --- In ydn-javascript@yahoogroups.com, "karla.valencia"
      <karla.valencia@...> wrote:
      >
      > Hi everybody, I have a question. I'm using a datatable with server
      > side pagination and I'd like to add server side sorting.
      >
      > I already added this:
      >
      > this.myDataTable.sortColumn = function(oColumn) {
      > // Which direction
      > var sDir = "asc";
      > // Already sorted?
      > if(oColumn.key === this.get("sortedBy").key) {
      > sDir = (this.get("sortedBy").dir === "asc") ?
      > "desc" : "asc";
      > }
      >
      > var newRequest = "sort=" + oColumn.key + "&dir=" + sDir +
      > "&results=100&startIndex=0";
      > this.getDataSource().sendRequest(newRequest,
      > this.onDataReturnInitializeTable, this);
      > };
      >
      > as shown in this example:
      > http://developer.yahoo.com/yui/examples/datatable/dt_serversorting.html
      >
      > and this:
      >
      > // Update the config sortedBy with new values
      > var newSortedBy = {
      > key: sortCol,
      > dir: sortDir
      > }
      > oDataTable.set("sortedBy", newSortedBy);
      >
      >
      > return oParsedResponse;
      > in the "this.myDataSource.doBeforeCallback" function.
      >
      > My problem is when clicking the header of any column I get this error
      > message:
      > 'this.get("sortedBy") has no properties'
      >
      > I have no idea why this happens.
      >
      > Any help is greatly appreciated.
      >
      > Thanks
      >
      > Karla V
      >
    • Show all 3 messages in this topic