formBuilder icon indicating copy to clipboard operation
formBuilder copied to clipboard

Unable to save data of rendered form- Rating control plugin

Open syed-asim opened this issue 5 years ago • 2 comments

Description:

Thanks Kevin, for creating this wonderful tool.

I am using the the rating plugin with typeUserAttrs (custom attribute) "ratingData". typeUserAttrs: { starRating: { ratingData: { label: 'Rating', value: '5' } } }

However, once i render the form > fill in the form (change the rating). And then save the userData using:

$('#' + SurveyPages[currentPageIndex].PageId).formRender('userData');

The above return the data perfectly, but the value of typeUserAttrs (custom attribute) "ratingData" remains the same i.e. 5. Below is the onRender method for rating plugin.

onRender() {
           var el = this;

           $('#' + el.config.name).rateYo({

               onSet: function (rating, rateYoInstance) {
                   $(rateYoInstance).next().val(rating);

// tried setting the config
                   el.config.ratingData = rating;
// tried setting the  raw config
                   el.rawConfig.ratingData = rating;
// tried setting the value as well
                   el.config.value = rating;
               },
               rating: el.config.ratingData || 3,
               numStars: el.config.noStars || 5,
               fullStar: true,
           });

       }

Please advise how to get the updating value. Any help would be really appreciated.

I searched google and checked all the issues as well, but couldn't find a fix for it that is why i am reporting here.

Environment Details:

  • formBuilder Version:
  • Browser:
  • OS:

Expected Behavior

$('#' + SurveyPages[currentPageIndex].PageId).formRender('userData');

Actual Behavior

Return the default value

Steps to Reproduce

Screenshot - (optional)

image

syed-asim avatar Jun 07 '19 14:06 syed-asim

we're on the same page, please update if you found any solution. Thanks

iftkharhussain avatar Sep 22 '21 20:09 iftkharhussain

we're on the same page, please update if you found any solution. Thanks

any solution for this @iftkharhussain ?

MisterDuval avatar Sep 23 '22 08:09 MisterDuval

:tada: This issue has been resolved in version 3.14.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Oct 14 '23 03:10 github-actions[bot]