[ 4 posts ]

Todd Smith

YUI Contributor

  • Username: stlsmiths
  • Joined: Thu Nov 05, 2009 10:03 am
  • Posts: 675
  • GitHub: stlsmiths
  • Gists: stlsmiths
  • IRC: t_smith
  • Offline
  • Profile

DataTable / Model / View / syncing to RESTful server

Post Posted: Mon Jun 25, 2012 8:40 pm
+0-
I've been struggling with the Y.App examples for awhile to figure out how to leverage them to some of our normal data-processing type applications (i.e. heavily tabular DataTables, dialog editing, etc...). Also we decided to do some experimenting with NodeJS to do RESTful type access to our database store.

It looks like we may have succeeded in creating a webpage that has the following features;
1. A DataTable
2. Y.Model representation of each Record
3. Y.ModelList with "sync:read" defined (read all records from a DataSource)
4. Y.View to display a Panel for row editing
5. Uses eric_f's Gallery REST Model Sync to persist back to remote server
6. NodeJS + Express + mysql RESTful server at the back-end

Maybe some of the Y.App experts can look this over at http://blunderalong.com/yui/dta/dt_mv_sync_REST.html and let me know if we are on the correct track.

This isn't built as a Y.App yet, because we'll probably end up using several DT's and other page components within a total application. But at least it's a start.

Comments and suggestions are welcome!

Todd

Eric Ferraiuolo

YUI Developer

  • Username: ericf
  • Joined: Mon Jan 12, 2009 8:26 pm
  • Posts: 380
  • Location: Boston, MA
  • Twitter: ericf
  • GitHub: ericf
  • Gists: ericf
  • IRC: eric_f
  • YUI Developer
  • Offline
  • Profile

Re: DataTable / Model / View / syncing to RESTful server

Post Posted: Tue Jun 26, 2012 7:42 am
+0-
Cool! I think if you're open to it, we should look at turning this into an example for the yuilibrary.com site :) To do that we'd have to figure out a way to host the server and database, that has been a restricting factor for our examples.

I was curious by you used a DataSource instead of ModelSync.REST for your ModelList? Was that so it could interface easier with DataTable or something?

Todd Smith

YUI Contributor

  • Username: stlsmiths
  • Joined: Thu Nov 05, 2009 10:03 am
  • Posts: 675
  • GitHub: stlsmiths
  • Gists: stlsmiths
  • IRC: t_smith
  • Offline
  • Profile

Re: DataTable / Model / View / syncing to RESTful server

Post Posted: Tue Jun 26, 2012 11:58 am
+0-
@ericf
Thanks for your encouragement. Based on your help I was able to update this example remove DataSource completely and do all Gallery REST Model Sync requests to the server. So the ModelList was re-written to use the "sync" layer completely and take the DataSource out.

So now the example works as a DataTable served by a remote source, with editing capability, without using DataSource as an intermediary.

I'm going to check into some performance timings to see how this ModelList sync approach compares on "reads" versus a DataSource read.

Thanks Eric!

paolo nesti poggi

YUI Contributor

  • Username: paolo
  • Joined: Sat Mar 14, 2009 9:53 am
  • Posts: 77
  • Location: Roskilde DK
  • GitHub: tribis
  • Gists: tribis
  • Offline
  • Profile

Re: DataTable / Model / View / syncing to RESTful server

Post Posted: Tue Jun 26, 2012 1:26 pm
+0-
Thank you Todd!

This is going to become a reference example. I can only support Eric's wish of making it into a yuilibrary example.
/paolo
  [ 4 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