question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DisplayValue for custom widget?

See original GitHub issue

I have a few custom widgets and one of them is a widget that adds a the https://flatpickr.js.org/ to the survey.

The user sees a string like: 19 Mar 2018 but the actual value is 2018-03-19.

In my situation the user is selecting a date in step 1 and I would like to show this date later on in one of the steps. This works fine when I use the {field_name} placeholder but it is giving me the value of 2018-03-19 which makes sense because that is the actual value. But I would like to show there the date formatted as 19 Mar 2018.

Is there a way to add equal to checkboxes, radiogroups and selects to have a displayValue property on custom widgets so I can control this output?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewtelnovcommented, Mar 19, 2018

@kaphert You will have to write something like:

//return not null if you want to change the default behavior
getDisplayValue: function(question) {
 return question.value === 1 ? "one" : null;
}

Thank you, Andrew

0reactions
andrewtelnovcommented, Mar 19, 2018

@kaphert Yes, you are right. It is better, corrected.

Thank you, Andrew

Read more comments on GitHub >

github_iconTop Results From Across the Web

DisplayValue for custom widget? · Issue #1008 - GitHub
I have a few custom widgets and one of them is a widget that adds a the https://flatpickr.js.org/ to the survey.
Read more >
Custom widget to display value and information - Stack Overflow
No information is available for this page.
Read more >
populate widget fields when drop do... - ServiceNow Community
Solved: I have a custom widget with a sn-record-picker and some fields: ... displayValue); gr.query(); if (gr.next()) { data.name = gr.
Read more >
Using Widgets: Value Display - Embedded Wizard
However, if desired, you can create your own configuration objects and so customize the Value Display widgets according to your particular design ...
Read more >
Solved: Building Custom Widget Extension - PTC Community
Card Widget will display value with a certain style. ... Any Custom Card Widget Extension done by anyone would be a great help...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found