Skip to main content

Yahoo Datatable Datasource

1 reply [Last post]
kashour
Offline
Joined: 2008-03-30
Points: 0

Hello,

I used Yahoo data table without jMaki I used the following definition, I would like to setup my datasource but don't know how to accomplish the same thing using jMaki Yahoo widget, can some one help.

Thanks.

var myDataSource = new YAHOO.util.DataSource("Grid?");
myDataSource.responseType = YAHOO.util.DataSource.TYPE_TEXT;
myDataSource.responseSchema = {
recordDelim: "\n", // Record delimiter
fieldDelim: ",", // Field delimiter
fields: [{key:"Code", parser:YAHOO.util.DataSource.parseNumber},
{key:"Name"}
] // Field names
};

var myColumnDefs = [
{key:"Code", sortable:true, resizeable:true},
{key:"Name", sortable:true, resizeable:true}
];

var myDataTable = new YAHOO.widget.DataTable("myMarkedUpContainer", myColumnDefs, myDataSource, {scrollable:true, height:"10em", caption:"DataTable Caption", selectionMode:"single"});

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gmurray71
Offline
Joined: 2003-07-31
Points: 0

Hi,

May I suggest using the jMaki table / grid data model?

We have described with examples at:

http://wiki.java.net/bin/view/Projects/jMakiTableDataModel

You can also load things from a service using the same data model if you use the the service argument instead of the value.

Let us know if this doesn't work for you.

-Greg