Skip to main content

Reload a dojo.table

3 replies [Last post]
cronico
Offline
Joined: 2008-02-18
Points: 0

Hi,
I create a RSS reader with a dojo.table. If there is a new RSS i have to reload the page. I want to reload the table without reloading the page. How can i do this?
Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
cronico
Offline
Joined: 2008-02-18
Points: 0

up please.
The problem is that i don't know how to pass the value from the xhp to the rssData when i click the button. If i pass a constant value it works but i have to reload the xhp (rss) value.

cronico
Offline
Joined: 2008-02-18
Points: 0

I have a problem with:
[i]var tableData = jmaki.filter(rssData, jmaki.filters.tableModelFilter);[/i]
the error is: 'rssData is not defined'.
how can I modify you code? How can I pass the rssData? in the xhp I have the rss site but i don't know how to pass this value to the code in the jmaki.filter.

in system.glue.js I have this code for the filters:
[i]// sytem level filters
jmaki.namespace("jmaki.filters");

jmaki.filters.tableFilter = function(input) {
...
}

jmaki.filters.tableModelFilter = function(input) {
...
}

jmaki.filters.accordionFilter = function(input) {
...
}

Message was edited by: cronico

gmurray71
Offline
Joined: 2003-07-31
Points: 0

Hi,

Suppose you have a table in your page:

You are going to need some glue to do the reloading. I'm assuming you have a yahoo button to start the event to reload the feed. You can also have a timer drive this.

In your glue.js you can do the following:

jmaki.subscribe("/yahoo/button/onClick", function(args) {

// load new data and refresh
jmaki.doAjax( {
url: jmaki.xhp + "?id=rss",
callback: function(req) {
if (req.responseText != '') {
// apply the table filter to change format to table format
// this filter is defined in the sytem-glue.js
var tableData = jmaki.filter(rssData, jmaki.filters.tableModelFilter);
// clear the table
jmaki.publish("/dojo/table/clear", {});
// add the new table data
jmaki.publish("/dojo/table/addRows", { value : tableData.rows});
}
}
});
});

The most important part you have to worry about is applying the table filter. These are loaded by default.

Please let us know if you have problems with this code.

I did test it with the 1.0.x version of jMaki.

-Greg