Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
protogrid:create-button [2017-11-09 15:22] – created sbl | protogrid:create-button [2021-10-15 14:13] (current) – old revision restored (2018-03-02 10:26) dru | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== Button |
- | You can simply create your own button | + | This article explains how to add own buttons which create new [[protogrid: |
- | First, add the necessary code. To do this, add a new [[protogrid: | + | First, add the necessary code. To do this, add a new [[protogrid: |
- | < | + | < |
+ | function guid() { | ||
function s4() { | function s4() { | ||
return Math.floor((1 + Math.random()) * 0x10000) | return Math.floor((1 + Math.random()) * 0x10000) | ||
Line 12: | Line 13: | ||
return s4() + s4() + ' | return s4() + s4() + ' | ||
s4() + ' | s4() + ' | ||
- | } </ | + | } |
+ | </ | ||
- | < | + | This code snippet generates a new Card ID. Next you need to add the code which actually creates your Card. For this, you need to know the key of the [[protogrid: |
- | function | + | Now you can add the following code snippet below the one above, replacing " |
- | window.open("/ | + | |
+ | < | ||
+ | function | ||
+ | window.open("/ | ||
} | } | ||
</ | </ | ||
- | create a new [[protogrid: | ||
- | Next, add a button to the [[protogrid: | ||
- | {{ :protogrid:add_button.png? | + | Next, create a new [[protogrid:trigger| Trigger]]. The Trigger should have a well-understandable name. As Script Library choose the newly created one and insert the call to the second code-snippet into the field " |
+ | <code javascript> | ||
+ | create_product(); | ||
+ | </ | ||
+ | As last step, add a button to the [[protogrid: | ||
+ | That's it, clicking onto this button will immediately create and open a new Card! | ||