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

Re: JSON.parse and Datatable Filter

Expand Messages
  • y_lsmith
    ... return the ... Devin, The lang.JSON Utility is really focused on data transformation. The filter function in parse is an added nicety, but even that is
    Message 1 of 3 , Dec 21, 2007
      --- In ydn-javascript@yahoogroups.com, "Devin Singleton" <devsin@...>
      wrote:
      >
      > I would like to use JSON.parse to create a client-side filter for the
      > datatable, among other things. It would be nice if parse did not
      return the
      > object if a particular key had a particular value.

      Devin,

      The lang.JSON Utility is really focused on data transformation. The
      filter function in parse is an added nicety, but even that is
      beginning to creep into the realm of application logic.

      In the case of DataTable, you might be able to leverage the
      doBeforeLoadData method to stop stop the data processing.

      var dt = new YAHOO.widget.DataTable(...);
      dt.doBeforeLoadData = function (request, response) {
      var isTheDataOk = true;

      /* evaluate response */

      return isTheDataOk;
      };

      This function is called from the various DataSource callbacks in
      DataTable, such as onDataReturnInitializeTable. If doBeforeLoadData
      returns false, the action is canceled.

      Hope this helps,
      Luke
    Your message has been successfully submitted and would be delivered to recipients shortly.