4

Could any body let me know how to create custom widget in thingworx. I don't have any idea how to create custom widget. Please help me.

I have to build drag drop custom widget and we can use that custom widget with other widget. e.g with tree widget,... etc.

dheerendra
  • 41
  • 1
  • 4

1 Answers1

6

I would recommend reading the official Extension Package Development Guide:

However, the best way to start making a new widget is to take an existing widget that does something like you want, and modify it. Built in widgets exist at

TomcatRoot\webapps\Thingworx\Common\thingworx\widgets

Here's a very brief guide to getting started with that. If you were to want to copy Textbox:

  1. Open the metadata.xml and change the "TextBox" to "MyWidget".
  2. There are two sections in this file. The "ExtensionPackage" section holds metadata for the pacakge (version, vendor, etc.)
  3. The second section , "Widgets" defines the widget files. Change the name of all these files to use your name e.g. MyWidget.ide.js Don’t forget to change name in the “Widget” xml tag too.
  4. Rename all necessary folder and files, replacing "TextBox" with "MyWidget"
  5. Open the both .js files and change the definition in each to reflect "MyWidget"
  6. In the ide file, change the icon path "widgetIconUrl" and the "name" property.
  7. Select the "ui" folder and the metadata.xml file and package them both into a new zip file. This file should import into Thingworx.

I would suggest searching for or asking this question in the PTC IoT Community, which is much more active for Thingworx developers than StackExchange.

UPDATE: The latest documentation for ThingWorx 9 Extension Package Development Guide can be found here

abatista
  • 79
  • 9
JsG
  • 96
  • 5
  • OMG, i didn't know all these widgets codebase are accessible in my local computer lol. Thank you so much for "TomcatRoot\webapps\Thingworx\Common\thingworx\widgets" this. – Sayonara Mar 20 '18 at 07:06
  • 1
    For newcomers, the custom widget documentation is maintained in ThingWorx 8.5 here: http://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/#page/ThingWorx%2FHelp%2FBest_Practices_for_Developing_Applications%2Fvisualization_widgets_AddingCustomWidgets.html%23 – Katakana Jun 08 '20 at 09:27
  • Extension developer pack url is down – edgarmtze Feb 25 '21 at 05:18