<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rachel's Blog &#187; Dojo</title>
	<atom:link href="http://www.willmer.com/kb/tag/dojo/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.willmer.com/kb</link>
	<description></description>
	<lastBuildDate>Wed, 01 Feb 2012 14:27:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Dojo Custom Widget namespaces in V0.4</title>
		<link>http://www.willmer.com/kb/2007/01/dojo-custom-widget-namespaces-in-v04/</link>
		<comments>http://www.willmer.com/kb/2007/01/dojo-custom-widget-namespaces-in-v04/#comments</comments>
		<pubDate>Tue, 30 Jan 2007 16:19:04 +0000</pubDate>
		<dc:creator>Rachel</dc:creator>
				<category><![CDATA[Dojo]]></category>

		<guid isPermaLink="false">http://www.willmer.com/kb/2007/01/dojo-custom-widget-namespaces-in-v04/</guid>
		<description><![CDATA[Been beating my head against a brick wall trying to figure this out from the dojo documentation &#8211; here&#8217;s the answer&#8230; http://blog.tijs.org/archives/2006/10/26/migrating-to-dojo-04/]]></description>
			<content:encoded><![CDATA[<p>Been beating my head against a brick wall trying to figure this out from the dojo documentation &#8211; here&#8217;s the answer&#8230;</p>
<p><a href="http://blog.tijs.org/archives/2006/10/26/migrating-to-dojo-04/">http://blog.tijs.org/archives/2006/10/26/migrating-to-dojo-04/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.willmer.com/kb/2007/01/dojo-custom-widget-namespaces-in-v04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programmatic usage of FilteringTable</title>
		<link>http://www.willmer.com/kb/2006/12/programmatic-usage-of-filteringtable/</link>
		<comments>http://www.willmer.com/kb/2006/12/programmatic-usage-of-filteringtable/#comments</comments>
		<pubDate>Fri, 15 Dec 2006 12:08:34 +0000</pubDate>
		<dc:creator>Rachel</dc:creator>
				<category><![CDATA[Dojo]]></category>

		<guid isPermaLink="false">http://www.willmer.com/kb/2006/12/programmatic-usage-of-filteringtable/</guid>
		<description><![CDATA[I&#8217;m using FilteringTable in a dynamically generated website, here&#8217;s how I got it working&#8230; Thanks to Tom Trenka for the original nudge in the direction of the Dojo nightly test for the programmatic usage of FilteringTable /* * Dynamic Filtering Table */ // Creates the FilteringTable widget and ties it to an existing HTML Table. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using FilteringTable in a dynamically generated website, here&#8217;s how I got it working&#8230;</p>
<p>Thanks to Tom Trenka for the original nudge in the direction of the <a title="Dojo nightly test for programmatic usage of FilteringTable" target="_blank" href="http://archive.dojotoolkit.org/nightly/tests/widget/test_FilteringTable_programmatic.html">Dojo nightly test for the programmatic usage of FilteringTable<br />
</a></p>
<p><code /></p>
<p>/*<br />
* Dynamic Filtering Table<br />
*/</p>
<p>// Creates the FilteringTable widget and ties it to an existing HTML Table.<br />
// Call once on load.</p>
<p>function doCreateFilteringTable(view) {<br />
//   debugger;<br />
dojo.io.bind({<br />
url: "/get_columns?view="+view,<br />
load: handleCreateFilteringTable,<br />
error: handleError,<br />
timeout: handleTimeout,<br />
mimetype: "application/json"<br />
});<br />
}</p>
<p>// Populates the FilteringTable widget with live data.<br />
// Call whenever you want.</p>
<p>function doUpdateFilteringTable(view) {<br />
//   debugger;<br />
var url;<br />
url="/get_rows?view="+view;</p>
<p>dojo.io.bind({<br />
url: url,<br />
load: handleUpdateFilteringTable,<br />
error: handleError,<br />
timeout: handleTimeout,<br />
mimetype: "application/json"<br />
});<br />
}</p>
<p>function handleCreateFilteringTable(type,data,evt) {<br />
var e;</p>
<p>//   debugger;</p>
<p>try {</p>
<p>var table_id="tbl_"+data.view;<br />
var widget_id=table_id; // they don't need to be the same</p>
<p>var table;<br />
table=dojo.widget.createWidget(<br />
"dojo:FilteringTable",<br />
{<br />
// this provides unique id for table rows<br />
valueField:"id",</p>
<p>// must provide this so that we can find it again,<br />
// otherwise random id is generated<br />
widgetId: "tbl_"+data.view,</p>
<p>},<br />
dojo.byId(table_id)<br />
);</p>
<p>// add the columns<br />
for (x in data.columns)<br />
{<br />
var col=data.columns[x];<br />
table.columns.push(table.createMetaData(col));<br />
}</p>
<p>// set the initial data set to be empty<br />
table.store.setData([]);</p>
<p>// fetch the data<br />
doUpdateFilteringTable(data.view);<br />
} catch (e) {<br />
var errstr=e.name+": "+e.message;<br />
doLog(errstr,"error");<br />
}<br />
}</p>
<p>function handleUpdateFilteringTable(type,data,evt) {<br />
//   debugger;</p>
<p>var e;</p>
<p>/* get list of tickers and build table from them */<br />
try {<br />
var view=data.view;</p>
<p>// fill in table body<br />
var tabledata=[];<br />
var table;<br />
var id;<br />
var entry;<br />
var x;<br />
var col;</p>
<p>table=dojo.widget.byId("tbl_"+view);<br />
for (id in data.list)<br />
{<br />
// construct line<br />
var line={};<br />
entry=data.list[id];</p>
<p>for (x in entry)<br />
{<br />
// add one cell<br />
// This is the format expected by dojo:filteringTable<br />
var value;<br />
col=entry[x];<br />
line["id"]=id;<br />
line[col["heading"]]=col["value"]<br />
}</p>
<p>// now add the row<br />
tabledata.push(line);<br />
}</p>
<p>table.store.setData(tabledata);<br />
} catch (e) {<br />
var errstr=e.name+": "+e.message;<br />
doLog(errstr,"error");<br />
}<br />
}</p>
<p>In this example, the server is returning this for get_columns():</p>
<p>{<br />
"columns": [<br />
  {"dataType": "String", "field": "Column1"},<br />
  {"dataType": "String", "field": "Column2"},<br />
  {"dataType": "String", "field": "Column3"},<br />
  etc...<br />
],<br />
 other stuff...<br />
}</p>
<p>and get_rows() returns this from the server:</p>
<p>{<br />
"list": {<br />
 "id1": [<br />
   {"heading": "Column1", "value": 25},<br />
  {"heading": "Column2", "value": "ABC.L"},<br />
  {"heading": "Column3", "value": 395}<br />
],<br />
 "id2": [<br />
   {"heading": "Column1", "value": 57},<br />
  {"heading": "Column2", "value": "MFXYZ.L"},<br />
  {"heading": "Column3", "value": 42}<br />
]<br />
   }<br />
}</p>
<p>(I've removed non-relevant stuff from these responses for clarity.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.willmer.com/kb/2006/12/programmatic-usage-of-filteringtable/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

