This page is part of a static HTML representation of the TiddlyWiki at
https://tiddlywiki.com/dev/
Widget refresh demo I
29th October 2022 at 7:48pm
[ { "title": "$:/DefaultTiddlers", "text": "[[tiddler field widget]]" } ] [ { "title": "test", "text": "type new text here" } ] [ { "title": "tiddlerfield-norefresh.js", "text": "/*\\\n\nHello, World widget\n\n\\*/\n(function() {\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar MyWidget = function(parseTreeNode, options) {\n\tthis.initialise(parseTreeNode, options);\n};\n\n/*\nInherit from the base widget class\n*/\nMyWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nMyWidget.prototype.render = function(parent, nextSibling) {\n\tthis.parentDomNode = parent;\n\tvar text = this.wiki.getTiddlerText(\"test\", \"<empty>\")\n\tvar textNode = this.document.createTextNode(text);\n\tparent.insertBefore(textNode, nextSibling);\n\tthis.domNodes.push(textNode);\n};\n\nexports.tiddlerfield = MyWidget;\n\n})();\n", "created": "20190201233714872", "modified": "20190202030615781", "module-type": "widget", "tags": "", "type": "application/javascript" } ] [ { "title": "tiddler field widget", "text": "\n<$edit-text focus=yes tiddler=test tag=input/>\n<$button set=\"!!refresh\" setTo={{test}}>Force refresh</$button>\n<$list filter=\"[{!!refresh}]\">\n\n<div>\n<div style=\"display:inline-block;width: 49%;vertical-align: text-top;word-wrap: break-word;}\">\n\n```\n<$tiddlerfield/>\n```\n\nRenders as:\n\n<$tiddlerfield/>\n</div>\n<div style=\"display:inline-block;width: 49%;vertical-align: text-top;word-wrap: break-word;}\">\n\n```\n<$view tiddler=\"test\"/>\n```\n\nRenders as:\n\n<$view tiddler=\"test\"/>\n</div>\n</div>\n</$list>\n" } ]