[ 3 posts ]

Tu Mae

  • Username: the_seeker_who
  • Joined: Wed May 23, 2012 11:17 pm
  • Posts: 6
  • Offline
  • Profile

Client-Side DataTable Filtering without multiple XHRs

Post Posted: Wed May 23, 2012 11:43 pm
+0-
I have a DataTable that uses an XHRDataSource I have configured everything so that the data in the table gets filtered based on the value specified in a textbox. My issue is that on every keystroke within the aforementioned text box results in another XHR (to get the filtered results), is there anyway to avoid this?

I have noticed this article http://developer.yahoo.com/yui/examples/datatable/dt_localfilter.html that provides an implementation to filter on the client side but this requires a JSARRAY data source. Is there anyway that I can perhaps store the result of my XHR in an array and use the implementation found in the article above?

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 2016
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • IRC: DevaSatyam
  • YUI Developer
  • Offline
  • Profile

Re: Client-Side DataTable Filtering without multiple XHRs

Post Posted: Thu May 24, 2012 6:27 am
+0-
You can use an XHR Datasource independently to fetch data into an array and then use that array to feed the DataTable via another LocalDataSource.

This example: http://developer.yahoo.com/yui/examples ... array.html

shows how to use DataSource to read an HTML table and return an array from its contents. You could do the same using an XHR DataSource and fetch data from a remote source.

Tu Mae

  • Username: the_seeker_who
  • Joined: Wed May 23, 2012 11:17 pm
  • Posts: 6
  • Offline
  • Profile

Re: Client-Side DataTable Filtering without multiple XHRs

Post Posted: Tue May 29, 2012 12:11 am
+0-
Thanks for the reply Satyam. I assumed I'd have to go down that route. Works a treat!
  [ 3 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum