parse rrn from id
About This Space
Empty template with the basics set up for a quick display.
Last updated on August 19, 2019
Forked from: /megan_bond/bound-disabled-property/
Public Permissions: View Open/Fork Run Comment
Quick Display
Description
Explanations
The browser's limitations are often for good reason, though not everyone agrees with their reasoning. One limitation that is currently frustrating many developers is the lack of a standard JavaScript method to get from and copy to the user's clipboard. There is a weakly supported method for it now, but the problem is that it's not a universal standard, and it's not even a standard for the browsers that support it. It's in a kind-of beta phase and may change drastically in the future. This is upsetting for developer's who'd rather not have to go back and redesign code they've already written because of a breaking change to some of the API's they used.
That being said, using the combo box is almost the same, just needs a few adjustments. I have updated the workspace to include combo box column so you can check out the code in action. I would suggest using the code provided below instead of checking the event code on the workspace for now because I was investigating some potential issues I ran into while creating the combo box example and now the code is a bit of a mess in the workspace.
// Because the combo box is a div with a textbox inside of it, either element
// could really be the passed object, but our API has it set up to pass the input object
// instead of the combo box widget object as `this`, except for the onselect event, which
// can still use `this.id`. The div element has the widget's id, so we need to reference
// in this example because I'm using the onclick event. (onchange does not currently work
// with combo boxes, as far as I can tell.)
var selectboxID = this.parentElement.id;
var selectboxValue = get(selectboxID);
// Still need to get the index of the period.
var dotIndex = selectboxID.lastIndexOf('.');
// Still need to get the row number.
var rrnRowNum = selectboxID.substring(dotIndex+1);
// Still need to generate the textbox's id.
var textboxID = 'TextBox2' + '.' + rrnRowNum;
// The onclick event of the combo box is passed the rowNumber variable, the onselect event
// does not currently get the rowNumber variable.
pui.set(textboxID, 'You clicked the select box in row ' + rrnRowNum + '! ...No, wait... Row ' + rowNumber + '.' );
// Getting the value of the combo box widget is as easy as using `this.value` as done preivously,
// but you'll notice here that I put `this.value` twice, this is because there is no text value
// retained by the combo box to access, currently. So, for this one, you'd want the value to be
// what you want to get. The options can be whatever else you'd like.
pui.set(textboxID, 'You selected option "' + this.value + '" with value "' + this.value);
How to Use
Fork to new workspace to use.
App... | ...Name |
---|---|
File | index.js |
Function | index() {...} |
Display | index.json |
Screen | index |
Author: megan.bond
Date: June 11th, 2019
More Spaces By megan.bond (@megan_bond)
26873
0
0
27456
0
1
24670
0
0
A Hello World app with both dynamic output and input fields. It also illustrates the basics of screen transition animation.
24799
0
0
This app is designed to help decide what the next apparel options will be available for the Profound Logic team.
30270
0
4
This app is designed to help decide what the next apparel options will be available for the Profound Logic team.
11634
0
0
17493
0
0
Be the first to comment:
Comments