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

Be the first to comment:      

Comments

Write Preview Markdown: bold italic code link
Post

Filters:

Popular Recent

Application for adding, viewing, updating, and searching posts relating to a specific project.

2607

0

A demo of how to build, test and consume APIs

6269

0

0

MatUI light/dark auto-themeing.

7326

0

0

Optionally downloads the Material Icons and Material Symbols font files, @fontface rules files, and a JSON object for use with Profound UI's `pui.customIconList` configuration.

6423

0

0

Optionally downloads the Material Icons and Material Symbols font files, @fontface rules files, and a JSON object for use with Profound UI's `pui.customIconList` configuration.

7406

0

0

This is an example for a few ways you could set up a grid to be able to scroll/have any row at the top of a grid.

22161

0

1

Mat UI - Solarized Dracula Scheme

7550

0

0

6898

0

0

7666

0

0

7416

0

0

i80

7756

0

0

Mat UI - Solarized Color Scheme

7382

0

0