Skip to main content

help yahho datatable

2 replies [Last post]
yohendry
Offline
Joined: 2008-03-05
Points: 0

I'm new in jmaki and i want know this

[1] how i get the selected rowId in a yahoo.datatable
[2] how i get al table data for save in a database

thanks for your help!!!!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
carlavmott
Offline
Joined: 2005-02-10
Points: 0

Hi yohendry,

When you select a row the table publishes to a topic the contents of that row and some other info. I wrote a simple app and selected a row and then copied and pasted what is published to the topic below.
Publish : Topic: /yahoo/dataTable/onSelect message {widgetId : 'yahoo_dataTable5' , topic : '/yahoo/dataTable' , type : 'onSelect' , targetId : 'bar' , value : {id : bar , title : Book Title 2 , author : Author 2 , isbn : 4412 , description : A Some long description}}

In this case, you will need to subscribe to the topic /yahoo/dataTable/onSelect you will get an object passed to you and you can look up the contents of the row which is in the value property.
Look at glue.js file which subscribes to all topics ending in 'onSelect' . It prints out the widgetId.

You can see what is published and if there are any subscribers to topics by using the jMaki logger. to enable logging set jmaki.debug and jmaki.debugGlue to true. You will find those variables in glue.js but then can be set in any javascript file.

We don't have a way of getting all the data items in one call. You will have to iterate through the rows to get that. Write an RFE to get them all at once and we can add that functionality.

carla

yohendry
Offline
Joined: 2008-03-05
Points: 0

thanks for your reply